Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions modules/ROOT/pages/query-tuning/indexes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,26 @@ In summary, `TEXT` indexes support the following predicates:

|===

=== Ensuring text index use

In order for the planner to use text indexes, it must be able to confirm that the properties included in the predicate are `STRING` values.
This is not possible when accessing property values within nodes or relationships, or values within a `MAP`, since Cypher does not store the type information of these values.
To ensure text indexes are used in these cases, the xref:functions/string.adoc#functions-tostring[`toString`] function should be used.

.Text index not used
[source,cypher]
----
WITH {name: 'John'} AS varName
MERGE (:Person {name:varName.name})
----

.Text index used
[source,cypher]
----
WITH {name: 'John'} AS varName
MERGE (:Person {name: toString(varName.name)})
----

== Index preference

When multiple indexes are available and able to solve a predicate, there is an order defined that decides which index to use.
Expand Down