From 546c4eb243cd191d336f9555bee62ce6950a63ff Mon Sep 17 00:00:00 2001 From: emmaholmbergohlsson Date: Tue, 5 Nov 2024 15:31:23 +0100 Subject: [PATCH] Remove use of index-provider option (#1096) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Supplying the index-provider option will no longer have any effect, and a user should not specify it. From 5.26 using the index-provider option will generate a warning. The index-provider has never controlled index behaviour in the 5.x series, and the latest provider will always be the best one. --------- Co-authored-by: Jens Pryce-Åklundh <112686610+JPryce-Aklundh@users.noreply.github.com> --- .../constraints/managing-constraints.adoc | 62 ------------------- modules/ROOT/pages/constraints/syntax.adoc | 24 ------- ...ions-additions-removals-compatibility.adoc | 13 ++++ .../managing-indexes.adoc | 32 ++-------- .../semantic-indexes/vector-indexes.adoc | 5 +- modules/ROOT/pages/indexes/syntax.adoc | 24 +++---- 6 files changed, 29 insertions(+), 131 deletions(-) diff --git a/modules/ROOT/pages/constraints/managing-constraints.adoc b/modules/ROOT/pages/constraints/managing-constraints.adoc index 148258f0f..283d567e3 100644 --- a/modules/ROOT/pages/constraints/managing-constraints.adoc +++ b/modules/ROOT/pages/constraints/managing-constraints.adoc @@ -910,7 +910,6 @@ Constraint already exists: Constraint( id=7, name='book_title_year', type='UNIQU === Constraints and indexes * xref:constraints/managing-constraints.adoc#constraints-and-backing-indexes[] -* xref:constraints/managing-constraints.adoc#create-constraint-with-index-provider[] * xref:constraints/managing-constraints.adoc#constraint-failures-and-indexes[] [[constraints-and-backing-indexes]] @@ -994,60 +993,6 @@ SHOW INDEXES WHERE owningConstraint IS NOT NULL [NOTE] Property existence and property type constraints are not backed by indexes. -[[create-constraint-with-index-provider]] -==== Creating constraints with an index provider - -Because property uniqueness and key constraints have backing indexes, an index provider can be provided when creating these constraints using the `OPTIONS` clause and the `indexProvider` option. - -The only valid value for the index provider is: - -* `range-1.0` label:default[] - - -.Create a node key constraint with a specified index provider -====== - -.Create a constraint requiring `Actor` nodes to have a unique `surname` property as a node key, specifying `range-1.0` as index provider -[source, cypher] ----- -CREATE CONSTRAINT constraint_with_provider -FOR (actor:Actor) REQUIRE actor.surname IS NODE KEY -OPTIONS { - indexProvider: 'range-1.0' -} ----- - -.Result -[source, queryresult] ----- -Added 1 constraint. ----- - -====== - -.Create a relationship property uniqueness constraint with a specified index provider -====== - -.Create a constraint requiring `SEQUEL_OF` relationships to have a unique combination of `order`, `seriesTitle`, and `number` properties, specifying `range-1.0` as index provider -[source, cypher] ----- -CREATE CONSTRAINT rel_constraint_with_options -FOR ()-[sequel:SEQUEL_OF]-() REQUIRE (sequel.order, sequel.seriesTitle, sequel.number) IS UNIQUE -OPTIONS { - indexProvider: 'range-1.0' -} ----- - -.Result -[source, queryresult] ----- -Added 1 constraint. ----- - -====== - -There are no valid index configuration values for the constraint-backing range indexes. - [[constraint-failures-and-indexes]] ==== Constraint failures and indexes @@ -1509,7 +1454,6 @@ SHOW CONSTRAINTS | 10 | "author_name" | "NODE_PROPERTY_EXISTENCE" | "NODE" | ["Author"] | ["name"] | NULL | NULL | | 3 | "book_isbn" | "UNIQUENESS" | "NODE" | ["Book"] | ["isbn"] | "book_isbn" | NULL | | 7 | "book_title_year" | "UNIQUENESS" | "NODE" | ["Book"] | ["title", "publicationYear"] | "book_title_year" | NULL | -| 28 | "constraint_with_provider" | "NODE_KEY" | "NODE" | ["Actor"] | ["surname"] | "constraint_with_provider" | NULL | | 17 | "director_imdbId" | "NODE_KEY" | "NODE" | ["Director"] | ["imdbId"] | "director_imdbId" | NULL | | 23 | "knows_since_how" | "RELATIONSHIP_KEY" | "RELATIONSHIP" | ["KNOWS"] | ["since", "how"] | "knows_since_how" | NULL | | 14 | "movie_tagline" | "NODE_PROPERTY_TYPE" | "NODE" | ["Movie"] | ["tagline"] | NULL | "STRING | LIST" | @@ -1519,7 +1463,6 @@ SHOW CONSTRAINTS | 13 | "part_of" | "RELATIONSHIP_PROPERTY_TYPE" | "RELATIONSHIP" | ["PART_OF"] | ["order"] | NULL | "INTEGER" | | 15 | "part_of_tags" | "RELATIONSHIP_PROPERTY_TYPE" | "RELATIONSHIP" | ["PART_OF"] | ["tags"] | NULL | "STRING | LIST" | | 9 | "prequels" | "RELATIONSHIP_UNIQUENESS" | "RELATIONSHIP" | ["PREQUEL_OF"] | ["order", "author"] | "prequels" | NULL | -| 30 | "rel_constraint_with_options" | "RELATIONSHIP_UNIQUENESS" | "RELATIONSHIP" | ["SEQUEL_OF"] | ["order", "seriesTitle", "number"] | "rel_constraint_with_options" | NULL | | 26 | "rel_exist_param" | "RELATIONSHIP_PROPERTY_EXISTENCE" | "RELATIONSHIP" | ["WROTE"] | ["published"] | NULL | NULL | | 5 | "sequels" | "RELATIONSHIP_UNIQUENESS" | "RELATIONSHIP" | ["SEQUEL_OF"] | ["order"] | "sequels" | NULL | | 11 | "wrote_year" | "RELATIONSHIP_PROPERTY_EXISTENCE" | "RELATIONSHIP" | ["WROTE"] | ["year"] | NULL | NULL | @@ -1549,7 +1492,6 @@ SHOW CONSTRAINTS YIELD * | 10 | "author_name" | "NODE_PROPERTY_EXISTENCE" | "NODE" | ["Author"] | ["name"] | NULL | NULL | NULL | "CREATE CONSTRAINT `author_name` FOR (n:`Author`) REQUIRE (n.`name`) IS NOT NULL" | | 3 | "book_isbn" | "UNIQUENESS" | "NODE" | ["Book"] | ["isbn"] | "book_isbn" | NULL | {indexConfig: {}, indexProvider: "range-1.0"} | "CREATE CONSTRAINT `book_isbn` FOR (n:`Book`) REQUIRE (n.`isbn`) IS UNIQUE" | | 7 | "book_title_year" | "UNIQUENESS" | "NODE" | ["Book"] | ["title", "publicationYear"] | "book_title_year" | NULL | {indexConfig: {}, indexProvider: "range-1.0"} | "CREATE CONSTRAINT `book_title_year` FOR (n:`Book`) REQUIRE (n.`title`, n.`publicationYear`) IS UNIQUE" | -| 28 | "constraint_with_provider" | "NODE_KEY" | "NODE" | ["Actor"] | ["surname"] | "constraint_with_provider" | NULL | {indexConfig: {}, indexProvider: "range-1.0"} | "CREATE CONSTRAINT `constraint_with_provider` FOR (n:`Actor`) REQUIRE (n.`surname`) IS NODE KEY" | | 17 | "director_imdbId" | "NODE_KEY" | "NODE" | ["Director"] | ["imdbId"] | "director_imdbId" | NULL | {indexConfig: {}, indexProvider: "range-1.0"} | "CREATE CONSTRAINT `director_imdbId` FOR (n:`Director`) REQUIRE (n.`imdbId`) IS NODE KEY" | | 23 | "knows_since_how" | "RELATIONSHIP_KEY" | "RELATIONSHIP" | ["KNOWS"] | ["since", "how"] | "knows_since_how" | NULL | {indexConfig: {}, indexProvider: "range-1.0"} | "CREATE CONSTRAINT `knows_since_how` FOR ()-[r:`KNOWS`]-() REQUIRE (r.`since`, r.`how`) IS RELATIONSHIP KEY" | | 14 | "movie_tagline" | "NODE_PROPERTY_TYPE" | "NODE" | ["Movie"] | ["tagline"] | NULL | "STRING | LIST" | NULL | "CREATE CONSTRAINT `movie_tagline` FOR (n:`Movie`) REQUIRE (n.`tagline`) IS :: STRING | LIST" | @@ -1559,7 +1501,6 @@ SHOW CONSTRAINTS YIELD * | 13 | "part_of" | "RELATIONSHIP_PROPERTY_TYPE" | "RELATIONSHIP" | ["PART_OF"] | ["order"] | NULL | "INTEGER" | NULL | "CREATE CONSTRAINT `part_of` FOR ()-[r:`PART_OF`]-() REQUIRE (r.`order`) IS :: INTEGER" | | 15 | "part_of_tags" | "RELATIONSHIP_PROPERTY_TYPE" | "RELATIONSHIP" | ["PART_OF"] | ["tags"] | NULL | "STRING | LIST" | NULL | "CREATE CONSTRAINT `part_of_tags` FOR ()-[r:`PART_OF`]-() REQUIRE (r.`tags`) IS :: STRING | LIST" | | 9 | "prequels" | "RELATIONSHIP_UNIQUENESS" | "RELATIONSHIP" | ["PREQUEL_OF"] | ["order", "author"] | "prequels" | NULL | {indexConfig: {}, indexProvider: "range-1.0"} | "CREATE CONSTRAINT `prequels` FOR ()-[r:`PREQUEL_OF`]-() REQUIRE (r.`order`, r.`author`) IS UNIQUE" | -| 30 | "rel_constraint_with_options" | "RELATIONSHIP_UNIQUENESS" | "RELATIONSHIP" | ["SEQUEL_OF"] | ["order", "seriesTitle", "number"] | "rel_constraint_with_options" | NULL | {indexConfig: {}, indexProvider: "range-1.0"} | "CREATE CONSTRAINT `rel_constraint_with_options` FOR ()-[r:`SEQUEL_OF`]-() REQUIRE (r.`order`, r.`seriesTitle`, r.`number`) IS UNIQUE" | | 26 | "rel_exist_param" | "RELATIONSHIP_PROPERTY_EXISTENCE" | "RELATIONSHIP" | ["WROTE"] | ["published"] | NULL | NULL | NULL | "CREATE CONSTRAINT `rel_exist_param` FOR ()-[r:`WROTE`]-() REQUIRE (r.`published`) IS NOT NULL" | | 5 | "sequels" | "RELATIONSHIP_UNIQUENESS" | "RELATIONSHIP" | ["SEQUEL_OF"] | ["order"] | "sequels" | NULL | {indexConfig: {}, indexProvider: "range-1.0"} | "CREATE CONSTRAINT `sequels` FOR ()-[r:`SEQUEL_OF`]-() REQUIRE (r.`order`) IS UNIQUE" | | 11 | "wrote_year" | "RELATIONSHIP_PROPERTY_EXISTENCE" | "RELATIONSHIP" | ["WROTE"] | ["year"] | NULL | NULL | NULL | "CREATE CONSTRAINT `wrote_year` FOR ()-[r:`WROTE`]-() REQUIRE (r.`year`) IS NOT NULL" | @@ -1594,7 +1535,6 @@ SHOW KEY CONSTRAINTS | id | name | type | entityType | labelsOrTypes | properties | ownedIndex | propertyType | +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 21 | "actor_fullname" | "NODE_KEY" | "NODE" | ["Actor"] | ["firstname", "surname"] | "actor_fullname" | NULL | -| 28 | "constraint_with_provider" | "NODE_KEY" | "NODE" | ["Actor"] | ["surname"] | "constraint_with_provider" | NULL | | 17 | "director_imdbId" | "NODE_KEY" | "NODE" | ["Director"] | ["imdbId"] | "director_imdbId" | NULL | | 23 | "knows_since_how" | "RELATIONSHIP_KEY" | "RELATIONSHIP" | ["KNOWS"] | ["since", "how"] | "knows_since_how" | NULL | | 19 | "ownershipId" | "RELATIONSHIP_KEY" | "RELATIONSHIP" | ["OWNS"] | ["ownershipId"] | "ownershipId" | NULL | @@ -1627,7 +1567,6 @@ WHERE entityType = 'RELATIONSHIP' | 13 | "part_of" | "RELATIONSHIP_PROPERTY_TYPE" | "RELATIONSHIP" | ["PART_OF"] | ["order"] | NULL | "INTEGER" | | 15 | "part_of_tags" | "RELATIONSHIP_PROPERTY_TYPE" | "RELATIONSHIP" | ["PART_OF"] | ["tags"] | NULL | "STRING | LIST" | | 9 | "prequels" | "RELATIONSHIP_UNIQUENESS" | "RELATIONSHIP" | ["PREQUEL_OF"] | ["order", "author"] | "prequels" | NULL | -| 30 | "rel_constraint_with_options" | "RELATIONSHIP_UNIQUENESS" | "RELATIONSHIP" | ["SEQUEL_OF"] | ["order", "seriesTitle", "number"] | "rel_constraint_with_options" | NULL | | 26 | "rel_exist_param" | "RELATIONSHIP_PROPERTY_EXISTENCE" | "RELATIONSHIP" | ["WROTE"] | ["published"] | NULL | NULL | | 5 | "sequels" | "RELATIONSHIP_UNIQUENESS" | "RELATIONSHIP" | ["SEQUEL_OF"] | ["order"] | "sequels" | NULL | | 11 | "wrote_year" | "RELATIONSHIP_PROPERTY_EXISTENCE" | "RELATIONSHIP" | ["WROTE"] | ["year"] | NULL | NULL | @@ -1669,7 +1608,6 @@ YIELD name, type, createStatement | "part_of" | "RELATIONSHIP_PROPERTY_TYPE" | "CREATE CONSTRAINT `part_of` FOR ()-[r:`PART_OF`]-() REQUIRE (r.`order`) IS :: INTEGER" | | "part_of_tags" | "RELATIONSHIP_PROPERTY_TYPE" | "CREATE CONSTRAINT `part_of_tags` FOR ()-[r:`PART_OF`]-() REQUIRE (r.`tags`) IS :: STRING | LIST" | | "prequels" | "RELATIONSHIP_UNIQUENESS" | "CREATE CONSTRAINT `prequels` FOR ()-[r:`PREQUEL_OF`]-() REQUIRE (r.`order`, r.`author`) IS UNIQUE" | -| "rel_constraint_with_options" | "RELATIONSHIP_UNIQUENESS" | "CREATE CONSTRAINT `rel_constraint_with_options` FOR ()-[r:`SEQUEL_OF`]-() REQUIRE (r.`order`, r.`seriesTitle`, r.`number`) IS UNIQUE" | | "rel_exist_param" | "RELATIONSHIP_PROPERTY_EXISTENCE" | "CREATE CONSTRAINT `rel_exist_param` FOR ()-[r:`WROTE`]-() REQUIRE (r.`published`) IS NOT NULL" | | "sequels" | "RELATIONSHIP_UNIQUENESS" | "CREATE CONSTRAINT `sequels` FOR ()-[r:`SEQUEL_OF`]-() REQUIRE (r.`order`) IS UNIQUE" | | "wrote_year" | "RELATIONSHIP_PROPERTY_EXISTENCE" | "CREATE CONSTRAINT `wrote_year` FOR ()-[r:`WROTE`]-() REQUIRE (r.`year`) IS NOT NULL" | diff --git a/modules/ROOT/pages/constraints/syntax.adoc b/modules/ROOT/pages/constraints/syntax.adoc index 1267b5ba9..ba695630f 100644 --- a/modules/ROOT/pages/constraints/syntax.adoc +++ b/modules/ROOT/pages/constraints/syntax.adoc @@ -26,10 +26,6 @@ It may still throw an error if conflicting data, indexes, or constraints exist. Examples of this are nodes with missing properties, indexes with the same name, or constraints with same schema but a different conflicting constraint type. As of Neo4j 5.17, an informational notification is returned in case nothing happens showing the existing constraint which blocks the creation. -For constraints that are backed by an index, the index provider for the backing index can be specified using the `OPTIONS` clause. -Only one valid value exists for the index provider, `range-1.0`, which is the default value. -There is no supported index configuration for range indexes. - [[create-property-uniqueness-constraints]] === Create property uniqueness constraints @@ -39,7 +35,6 @@ There is no supported index configuration for range indexes. CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS] FOR (n:LabelName) REQUIRE n.propertyName IS [NODE] UNIQUE -[OPTIONS "{" option: value[, ...] "}"] ---- .Syntax for creating a composite node property uniqueness constraint on multiple properties @@ -48,7 +43,6 @@ REQUIRE n.propertyName IS [NODE] UNIQUE CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS] FOR (n:LabelName) REQUIRE (n.propertyName_1, ..., n.propertyName_n) IS [NODE] UNIQUE -[OPTIONS "{" option: value[, ...] "}"] ---- .Syntax for creating a relationship property uniqueness constraint on a single property label:new[Introduced in 5.7] @@ -57,7 +51,6 @@ REQUIRE (n.propertyName_1, ..., n.propertyName_n) IS [NODE] UNIQUE CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS] FOR ()-"["r:RELATIONSHIP_TYPE"]"-() REQUIRE r.propertyName IS [REL[ATIONSHIP]] UNIQUE -[OPTIONS "{" option: value[, ...] "}"] ---- .Syntax for creating a composite relationship property uniqueness constraint on multiple properties label:new[Introduced in 5.7] @@ -66,11 +59,8 @@ REQUIRE r.propertyName IS [REL[ATIONSHIP]] UNIQUE CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS] FOR ()-"["r:RELATIONSHIP_TYPE"]"-() REQUIRE (r.propertyName_1, ..., r.propertyName_n) IS [REL[ATIONSHIP]] UNIQUE -[OPTIONS "{" option: value[, ...] "}"] ---- -An index provider can be specified using the `OPTIONS` clause. - For examples on how to create property uniqueness constraints, see xref:constraints/managing-constraints.adoc#create-property-uniqueness-constraints[Create, show, and drop constraints -> Create property uniqueness constraint]. Property uniqueness constraints are xref:constraints/managing-constraints.adoc#constraints-and-indexes[index-backed]. @@ -84,7 +74,6 @@ Property uniqueness constraints are xref:constraints/managing-constraints.adoc#c CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS] FOR (n:LabelName) REQUIRE n.propertyName IS NOT NULL -[OPTIONS "{" "}"] ---- .Syntax for creating a relationship property existence constraint @@ -93,11 +82,8 @@ REQUIRE n.propertyName IS NOT NULL CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS] FOR ()-"["r:RELATIONSHIP_TYPE"]"-() REQUIRE r.propertyName IS NOT NULL -[OPTIONS "{" "}"] ---- -There are no supported `OPTIONS` values for property existence constraints, but an empty options map is allowed for consistency. - For examples on how to create property existence constraints, see xref:constraints/managing-constraints.adoc#create-property-existence-constraints[Create, show, and drop constraints -> Create property existence constraints]. [role=label--enterprise-edition label--new-5.9] @@ -110,7 +96,6 @@ For examples on how to create property existence constraints, see xref:constrai CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS] FOR (n:LabelName) REQUIRE n.propertyName {[IS] :: | IS TYPED} -[OPTIONS "{" "}"] ---- .Syntax for creating a relationship property type constraint @@ -119,7 +104,6 @@ REQUIRE n.propertyName {[IS] :: | IS TYPED} CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS] FOR ()-"["r:RELATIONSHIP_TYPE"]"-() REQUIRE r.propertyName {[IS] :: | IS TYPED} -[OPTIONS "{" "}"] ---- The three variations of the expression, `IS ::`, `::`, and `IS TYPED` are syntactic synonyms for the same expression. @@ -153,8 +137,6 @@ Where `` is one of the following property types: Allowed syntax variations of these types are listed in xref::values-and-types/property-structural-constructed.adoc#types-synonyms[Types and their synonyms]. -There are no supported `OPTIONS` values for property type constraints, but an empty options map is allowed for consistency. - For examples on how to create property type constraints, see xref:constraints/managing-constraints.adoc#create-property-type-constraint[Create, show, and drop constraints -> Create property type constraints]. @@ -168,7 +150,6 @@ For examples on how to create property type constraints, see xref:constraints/m CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS] FOR (n:LabelName) REQUIRE n.propertyName IS [NODE] KEY -[OPTIONS "{" option: value[, ...] "}"] ---- .Syntax for creating a composite node key constraint on multiple properties @@ -177,7 +158,6 @@ REQUIRE n.propertyName IS [NODE] KEY CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS] FOR (n:LabelName) REQUIRE (n.propertyName_1, ..., n.propertyName_n) IS [NODE] KEY -[OPTIONS "{" option: value[, ...] "}"] ---- .Syntax for creating a relationship key constraint on a single property label:new[Introduced in 5.7] @@ -186,7 +166,6 @@ REQUIRE (n.propertyName_1, ..., n.propertyName_n) IS [NODE] KEY CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS] FOR ()-"["r:RELATIONSHIP_TYPE"]"-() REQUIRE r.propertyName IS [REL[ATIONSHIP]] KEY -[OPTIONS "{" option: value[, ...] "}"] ---- .Syntax for creating a composite relationship key constraint on multiple properties label:new[Introduced in 5.7] @@ -195,11 +174,8 @@ REQUIRE r.propertyName IS [REL[ATIONSHIP]] KEY CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS] FOR ()-"["r:RELATIONSHIP_TYPE"]"-() REQUIRE (r.propertyName_1, ..., r.propertyName_n) IS [REL[ATIONSHIP]] KEY -[OPTIONS "{" option: value[, ...] "}"] ---- -An index provider can be specified using the `OPTIONS` clause. - For examples on how to create key constraints, see xref:constraints/managing-constraints.adoc#create-key-constraints[Create, show, and drop constraints -> Create key constraints]. Key constraints are xref:constraints/managing-constraints.adoc#constraints-and-indexes[index-backed]. diff --git a/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc b/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc index c0f2277fe..8f05eae70 100644 --- a/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc +++ b/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc @@ -26,6 +26,19 @@ Replacement syntax for deprecated and removed features are also indicated. | Feature | Details +a| +label:functionality[] +label:deprecated[] +[source, cypher, role="noheader"] +---- +CREATE ... INDEX ... OPTIONS { indexProvider: ... } +CREATE ... CONSTRAINTS ... OPTIONS { indexProvider: ... } +---- +| Specifying an index provider in the `OPTIONS` map when creating an index or constraint is deprecated. + +This also means that the xref:indexes/semantic-indexes/vector-indexes.adoc[vector index] index provider, `vector-1.0`, is deprecated. +Use the default index provider, `vector-2.0`, instead. + a| label:functionality[] label:deprecated[] diff --git a/modules/ROOT/pages/indexes/search-performance-indexes/managing-indexes.adoc b/modules/ROOT/pages/indexes/search-performance-indexes/managing-indexes.adoc index 2487e32ad..9a71c9a5b 100644 --- a/modules/ROOT/pages/indexes/search-performance-indexes/managing-indexes.adoc +++ b/modules/ROOT/pages/indexes/search-performance-indexes/managing-indexes.adoc @@ -33,10 +33,8 @@ If `IF NOT EXISTS` is appended to the command, no error is thrown and nothing ha It may still throw an error if conflicting constraints exist, such as constraints with the same name or schema and backing index type. As of Neo4j 5.17, an informational notification is instead returned showing the existing index which blocks the creation. -Index providers and configuration settings can be specified using the `OPTIONS` clause.footnote:[Index providers are essentially different implementations of the same index type. -Different providers are only available for xref:indexes/search-performance-indexes/managing-indexes.adoc#create-a-text-index-specifying-the-index-provider[text indexes].] - -However, not all indexes have available configuration settings or more than one provider. +Index configuration settings can be specified using the `OPTIONS` clause. +However, not all indexes have available configuration settings. In those cases, nothing needs to be specified and the `OPTIONS` map should be omitted from the query. [TIP] @@ -50,7 +48,7 @@ A newly created index is not immediately available but is created in the backgro Creating a range index can be done with the `CREATE INDEX` command. Note that the index name must be unique. -Range indexes have only one index provider available, `range-1.0`, and no supported index configuration. +Range indexes have no supported index configuration. [[range-indexes-supported-predicates]] [discrete] @@ -294,7 +292,6 @@ Text indexes are only used for exact query matches. To perform approximate match * xref:indexes/search-performance-indexes/managing-indexes.adoc#create-a-relationship-text-index[] * xref:indexes/search-performance-indexes/managing-indexes.adoc#create-a-text-index-by-param[] * xref:indexes/search-performance-indexes/managing-indexes.adoc#create-a-text-index-only-if-it-does-not-already-exist[] -* xref:indexes/search-performance-indexes/managing-indexes.adoc#create-a-text-index-specifying-the-index-provider[] [discrete] [[create-a-node-text-index]] @@ -366,30 +363,13 @@ As of Neo4j 5.17, an informational notification is instead returned. `TEXT INDEX node_text_index_nickname FOR (e:Person) ON (e.nickname)` already exists. ---- -[discrete] -[[create-a-text-index-specifying-the-index-provider]] -===== Create a text index specifying the index provider - -To create a text index with a specific index provider, the `OPTIONS` clause is used. -The valid values for the index provider are `text-2.0` and `text-1.0` (deprecated). -The default provider is `text-2.0`. - -.Creating a text index with index provider -[source, cypher] ----- -CREATE TEXT INDEX text_index_with_indexprovider FOR ()-[r:TYPE]-() ON (r.prop1) -OPTIONS {indexProvider: 'text-2.0'} ----- - -There is no supported index configuration for text indexes. - [[create-point-index]] === Create a point index Creating a point index can be done with the `CREATE POINT INDEX` command. Note that the index name must be unique. -Point indexes have supported index configuration, but only one index provider available, `point-1.0`. +Point indexes have supported index configuration. [discrete] [[point-indexes-supported-predicates]] @@ -554,7 +534,7 @@ Only one node label and one relationship type lookup index can exist at the same If a token lookup index has been deleted, it can be recreated with the `CREATE LOOKUP INDEX` command. Note that the index name must be unique. -Token lookup indexes have only one index provider available, `token-lookup-1.0`, and no supported index configuration. +Token lookup indexes have no supported index configuration. [discrete] [[lookup-index-supported-predicates]] @@ -844,7 +824,6 @@ SHOW INDEXES | 7 | "rel_text_index_name" | "ONLINE" | 100.0 | "TEXT" | "RELATIONSHIP" | ["KNOWS"] | ["interest"] | "text-2.0" | NULL | 2023-04-01T10:40:44.537Z | 3 | | 15 | "rel_type_lookup_index" | "ONLINE" | 100.0 | "LOOKUP" | "RELATIONSHIP" | NULL | NULL | "token-lookup-1.0" | NULL | 2023-04-12T21:41:44.537Z | 7 | | 8 | "text_index_param" | "ONLINE" | 100.0 | "TEXT" | "NODE" | ["Person"] | ["favoriteColor"] | "text-2.0" | NULL | NULL | 0 | -| 9 | "text_index_with_indexprovider" | "ONLINE" | 100.0 | "TEXT" | "RELATIONSHIP" | ["TYPE"] | ["prop1"] | "text-2.0" | NULL | NULL | 0 | | 18 | "uniqueBookIsbn" | "ONLINE" | 100.0 | "RANGE" | "NODE" | ["Book"] | ["isbn"] | "range-1.0" | "uniqueBookIsbn" | 2023-04-13T11:41:44.692Z | 6 | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 18 rows @@ -887,7 +866,6 @@ RETURN name, type, provider, options.indexConfig AS config, createStatement | "rel_point_index_name" | "POINT" | "point-1.0" | {`spatial.cartesian.min`: [-1000000.0, -1000000.0], `spatial.wgs-84.min`: [-180.0, -90.0], `spatial.wgs-84.max`: [180.0, 90.0], `spatial.cartesian.max`: [1000000.0, 1000000.0], `spatial.wgs-84-3d.max`: [180.0, 90.0, 1000000.0], `spatial.cartesian-3d.min`: [-1000000.0, -1000000.0, -1000000.0], `spatial.cartesian-3d.max`: [1000000.0, 1000000.0, 1000000.0], `spatial.wgs-84-3d.min`: [-180.0, -90.0, -1000000.0]} | "CREATE POINT INDEX `rel_point_index_name` FOR ()-[r:`STREET`]-() ON (r.`intersection`) OPTIONS {indexConfig: {`spatial.cartesian-3d.max`: [1000000.0, 1000000.0, 1000000.0],`spatial.cartesian-3d.min`: [-1000000.0, -1000000.0, -1000000.0],`spatial.cartesian.max`: [1000000.0, 1000000.0],`spatial.cartesian.min`: [-1000000.0, -1000000.0],`spatial.wgs-84-3d.max`: [180.0, 90.0, 1000000.0],`spatial.wgs-84-3d.min`: [-180.0, -90.0, -1000000.0],`spatial.wgs-84.max`: [180.0, 90.0],`spatial.wgs-84.min`: [-180.0, -90.0]}, indexProvider: 'point-1.0'}" | | "rel_range_index_name" | "RANGE" | "range-1.0" | {} | "CREATE RANGE INDEX `rel_range_index_name` FOR ()-[r:`KNOWS`]-() ON (r.`since`)" | | "rel_text_index_name" | "TEXT" | "text-2.0" | {} | "CREATE TEXT INDEX `rel_text_index_name` FOR ()-[r:`KNOWS`]-() ON (r.`interest`) OPTIONS {indexConfig: {}, indexProvider: 'text-2.0'}" | -| "text_index_with_indexprovider" | "TEXT" | "text-2.0" | {} | "CREATE TEXT INDEX `text_index_with_indexprovider` FOR ()-[r:`TYPE`]-() ON (r.`prop1`) OPTIONS {indexConfig: {}, indexProvider: 'text-2.0'}" | | "uniqueBookIsbn" | "RANGE" | "range-1.0" | {} | "CREATE CONSTRAINT `uniqueBookIsbn` FOR (n:`Book`) REQUIRE (n.`isbn`) IS UNIQUE OPTIONS {indexConfig: {}, indexProvider: 'range-1.0'}" | +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ---- diff --git a/modules/ROOT/pages/indexes/semantic-indexes/vector-indexes.adoc b/modules/ROOT/pages/indexes/semantic-indexes/vector-indexes.adoc index 13c8334b2..fd73ea3c4 100644 --- a/modules/ROOT/pages/indexes/semantic-indexes/vector-indexes.adoc +++ b/modules/ROOT/pages/indexes/semantic-indexes/vector-indexes.adoc @@ -71,7 +71,7 @@ A vector index allows you to retrieve a neighborhood of nodes or relationships b A vector index is a single-label, single-property index for nodes or a single-relationship-type, single-property index for relationships. It can be used to index nodes or relationships by `LIST` properties valid to the dimensions and vector similarity function of the index. -Note that the available vector index providers (`vector-2.0` (default) and `vector-1.0`) support different index schemas, property value types, and vector dimensions. +Note that the available vector index providers (`vector-2.0` (default) and `vector-1.0` (deprecated)) support different index schemas, property value types, and vector dimensions. For more information, see xref:indexes/semantic-indexes/vector-indexes.adoc#vector-index-providers[]. A vector index is created by using the `CREATE VECTOR INDEX` command. @@ -350,9 +350,8 @@ DROP INDEX moviePlots [[vector-index-providers]] == Vector index providers for compatibility -As of Neo4j 5.18, the default and preferred vector index provider is `vector-2.0`. +As of Neo4j 5.18, the default index provider is `vector-2.0`. Previously created `vector-1.0` indexes will continue to function. -New indexes can still be created with the `vector-1.0` provider if it is specified in the `OPTIONS` map. .Learn more about vector index provider differences [%collapsible] diff --git a/modules/ROOT/pages/indexes/syntax.adoc b/modules/ROOT/pages/indexes/syntax.adoc index baede5cba..47183f194 100644 --- a/modules/ROOT/pages/indexes/syntax.adoc +++ b/modules/ROOT/pages/indexes/syntax.adoc @@ -27,8 +27,8 @@ As of Neo4j 5.17, an informational notification is instead returned showing the The index name must be unique among both indexes and constraints. A random name will be assigned if no name is explicitly given when an index is created. -Index providers and configuration settings can be specified using the `OPTIONS` clause. -However, not all indexes have available configuration settings or multiple providers. +Index configuration settings can be specified using the `OPTIONS` clause. +However, not all indexes have available configuration settings. In those cases, nothing needs to be specified and the `OPTIONS` map should be omitted from the query. [TIP] @@ -37,8 +37,8 @@ Creating an index requires link:{neo4j-docs-base-uri}/operations-manual/{page-ve [[create-range-index]] === Range indexes -Range indexes have only one index provider, `range-1.0`, and no supported index configuration. -Since the index provider will be assigned by default, the `OPTIONS` map has been omitted from the syntax below. +Range indexes have no supported index configuration. +The `OPTIONS` map has, therefore, been omitted from the syntax below. .Create a range index for a node label, either on a single property or composite [source,syntax] @@ -67,13 +67,15 @@ For more information, see xref:indexes/search-performance-indexes/managing-index [[create-text-index]] === Text indexes +Text indexes have no supported index configuration. +The `OPTIONS` map has, therefore, been omitted from the syntax below. + .Create a text index for a node label on a single property [source,syntax] ---- CREATE TEXT INDEX [index_name] [IF NOT EXISTS] FOR (n:LabelName) ON (n.propertyName_1) -[OPTIONS “{“ option: value[, …] “}”] ---- .Create a text index for a relationship type on a single property @@ -82,11 +84,8 @@ ON (n.propertyName_1) CREATE TEXT INDEX [index_name] [IF NOT EXISTS] FOR ()-”[“r:TYPE_NAME”]”-() ON (r.propertyName_1) -[OPTIONS “{“ option: value[, …] “}”] ---- -Text indexes have no supported index configuration and, as of Neo4j 5.1, they have two index providers available, `text-2.0` (default) and `text-1.0` (deprecated). - [NOTE] It is not possible to create composite text indexes on multiple properties. @@ -113,7 +112,6 @@ ON (r.propertyName_1) [OPTIONS “{“ option: value[, …] “}”] ---- -Point indexes have only one index provider available, `point-1.0`. The following settings can be specified for point indexes: * `spatial.cartesian.min` @@ -133,8 +131,8 @@ For more information, see xref:indexes/search-performance-indexes/managing-index [[create-lookup-index]] === Token lookup indexes -Token lookup indexes have only one index provider, `token-lookup-1.0`, and no supported index configuration. -Since the index provider will be assigned by default, the `OPTIONS` map has been omitted from the syntax below. +Token lookup indexes have no supported index configuration. +The `OPTIONS` map has, therefore, been omitted from the syntax below. .Create a node label lookup index [source,syntax] @@ -177,7 +175,6 @@ ON EACH “[“ r.propertyName[, ...] “]” [OPTIONS “{“ option: value[, …] “}”] ---- -Full-text indexes have only one index provider available, `fulltext-1.0`. The following settings can be specified for full-text indexes: * `fulltext.analyzer` - specifies what analyzer to use (the `db.index.fulltext.listAvailableAnalyzers` procedure lists what analyzers are available). @@ -207,9 +204,6 @@ ON (r.propertyName) [OPTIONS “{“ option: value[, …] “}”] ---- -As of Neo4j 5.18, vector indexes have two vector index providers available, `vector-2.0` (default) and `vector-1.0`. -For more information, see xref:indexes/semantic-indexes/vector-indexes.adoc#vector-index-providers[Vector index providers for compatibility]. - For a full list of all vector index settings, see xref:indexes/semantic-indexes/vector-indexes.adoc#configuration-settings[Vector index configuration settings]. Note that the `OPTIONS` clause was mandatory prior to Neo4j 5.23 because it was necessary to configure the `vector.dimensions` and `vector.similarity_function` settings when creating a vector index.