# Cypher Indexes and Constraints: Check your understanding Question 2(index on an array)

**URL:** https://community.neo4j.com/t/cypher-indexes-and-constraints-check-your-understanding-question-2-index-on-an-array/58794
**Category:** General
**Tags:** migrated
**Created:** [August 16, 2022, 2:09pm UTC](https://community.neo4j.com/t/cypher-indexes-and-constraints-check-your-understanding-question-2-index-on-an-array/58794 "2022-08-16T14:09:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![apankraz](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/apankraz/32/9504_2.png) [@apankraz](https://community.neo4j.com/u/apankraz)
#### Post date: [August 16, 2022, 2:09pm UTC](https://community.neo4j.com/t/cypher-indexes-and-constraints-check-your-understanding-question-2-index-on-an-array/58794/1 "2022-08-16T14:09:58Z")

</div>

Hi all,

the following assessment in the Cypher Indexes and Constraints course seems to be wrong and might actually lead to a wrongful implementation and assumption of index usage.

![apankraz_0-1660658578666.png](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/4/b/4b1915e649d9eded1182ef6d1a9681d37798239c.png "apankraz\_0-1660658578666.png")

As I understand non of the current available indexes would improve this query. Looking for a value in an indexed array property will in fact NOT use an index for lookup.

Please correct me if I am wrong and show me how an Index could be used on an actual multivalued property to find a specific value like in the example.

I would really, really like to be wrong about that 🙂

---

<div class="post-metadata">

### Author: ![elaine\_rosenber](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/elaine_rosenber/32/27409_2.png) [@elaine\_rosenber](https://community.neo4j.com/u/elaine_rosenber)
#### Post date: [August 16, 2022, 3:45pm UTC](https://community.neo4j.com/t/cypher-indexes-and-constraints-check-your-understanding-question-2-index-on-an-array/58794/2 "2022-08-16T15:45:19Z")

</div>

[@apankraz](https://community.neo4j.com/t5/user/viewprofilepage/user-id/3828) ,

This is a BAD question that needs to be rewritten. You are absolutely correct! Cypher does not (yet) support indexes on array elements. It will be a a future release.

Thank you for pointing this out. I will change the example.

Elaine

---

<div class="post-metadata">

### Author: ![vialard](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/vialard/32/18749_2.png) [@vialard](https://community.neo4j.com/u/vialard)
#### Post date: [December 21, 2022, 4:56pm UTC](https://community.neo4j.com/t/cypher-indexes-and-constraints-check-your-understanding-question-2-index-on-an-array/58794/3 "2022-12-21T16:56:23Z")

</div>

Hi Elaine,

how come there is a formula to compute the size of the key in the documentation for an index that is not used anyway?

[https://neo4j.com/developer/kb/index-limitations-and-workaround/#index-configuration-limitations-arrays](https://neo4j.com/developer/kb/index-limitations-and-workaround/#index-configuration-limitations-arrays)

---

<div class="post-metadata">

### Author: ![elaine\_rosenber](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/elaine_rosenber/32/27409_2.png) [@elaine\_rosenber](https://community.neo4j.com/u/elaine_rosenber)
#### Post date: [December 21, 2022, 5:33pm UTC](https://community.neo4j.com/t/cypher-indexes-and-constraints-check-your-understanding-question-2-index-on-an-array/58794/4 "2022-12-21T17:33:36Z")

</div>

That KB article is a general purpose description of how data is stored in the db.  
In 5.0, there is now support for string arrays in full text indexes  
[https://neo4j.com/release-notes/database/neo4j-5/](https://neo4j.com/release-notes/database/neo4j-5/)

---

<div class="post-metadata">

### Author: ![vialard](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/vialard/32/18749_2.png) [@vialard](https://community.neo4j.com/u/vialard)
#### Post date: [December 21, 2022, 7:27pm UTC](https://community.neo4j.com/t/cypher-indexes-and-constraints-check-your-understanding-question-2-index-on-an-array/58794/5 "2022-12-21T19:27:53Z")

</div>

I suppose you meant:

> * * *
> 
> In 5.0, there is _ **NOW** _ support for string arrays in full text indexes

Nice. But I have to convert my integer IDs to strings, define a fulltext index using the keyword analyzer and then start all my queries by a procedure call to retrieve the matching nodes instead of letting the query planner do its job like with a normal index.

And it is still weird that in 4.4. you can define a b-tree index on any array property that will never get used.
