Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
55 changes: 0 additions & 55 deletions modules/ROOT/pages/constraints/managing-constraints.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down Expand Up @@ -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

Expand Down
24 changes: 0 additions & 24 deletions modules/ROOT/pages/constraints/syntax.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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].

Expand All @@ -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
Expand All @@ -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]
Expand All @@ -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} <TYPE>
[OPTIONS "{" "}"]
----

.Syntax for creating a relationship property type constraint
Expand All @@ -119,7 +104,6 @@ REQUIRE n.propertyName {[IS] :: | IS TYPED} <TYPE>
CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS]
FOR ()-"["r:RELATIONSHIP_TYPE"]"-()
REQUIRE r.propertyName {[IS] :: | IS TYPED} <TYPE>
[OPTIONS "{" "}"]
----

The three variations of the expression, `IS ::`, `::`, and `IS TYPED` are syntactic synonyms for the same expression.
Expand Down Expand Up @@ -153,8 +137,6 @@ Where `<TYPE>` 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].


Expand All @@ -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
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@ Replacement syntax for deprecated and removed features are also indicated.
| Feature
| Details

a|
label:functionality[]
label:deprecated[]
[source, cypher, role="noheader"]
----
CREATE VECTOR INDEX vector_index IF NOT EXISTS
FOR (n:Label)
ON n.embedding
OPTIONS {
indexProvider: 'vector-1.0'
}
----

| Specifying an index provider in the `OPTIONS` map when creating an index 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[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -216,7 +214,7 @@ As of Neo4j 5.17, an informational notification is instead returned.
Creating a text index can be done with the `CREATE TEXT INDEX` command.
Note that the index name must be unique.

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).
Text indexes have no supported index configuration.

[[text-indexes-supported-predicates]]
[discrete]
Expand Down Expand Up @@ -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]]
Expand Down Expand Up @@ -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]]
Expand Down Expand Up @@ -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]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<INTEGER | FLOAT>` 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.
Expand Down Expand Up @@ -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]
Expand Down
Loading