From 4c2be48070f105d6f3fcdfe36b4ae24a1ba3f7e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Pryce-=C3=85klundh?= <112686610+JPryce-Aklundh@users.noreply.github.com> Date: Tue, 20 Aug 2024 08:25:35 +0200 Subject: [PATCH 1/2] clarify text index use --- modules/ROOT/pages/query-tuning/indexes.adoc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/modules/ROOT/pages/query-tuning/indexes.adoc b/modules/ROOT/pages/query-tuning/indexes.adoc index a32db2c53..42136fe17 100644 --- a/modules/ROOT/pages/query-tuning/indexes.adoc +++ b/modules/ROOT/pages/query-tuning/indexes.adoc @@ -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. From 12b86f8e2d4ef085dd5c6ba1f690c3a2fdc9ea1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Pryce-=C3=85klundh?= <112686610+JPryce-Aklundh@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:14:05 +0200 Subject: [PATCH 2/2] 4.4.38 --- antora.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/antora.yml b/antora.yml index ee469e47b..ef50a59fe 100644 --- a/antora.yml +++ b/antora.yml @@ -8,4 +8,4 @@ asciidoc: attributes: neo4j-major-version: '4' neo4j-version: '4.4' - neo4j-version-exact: '4.4.37' + neo4j-version-exact: '4.4.38'