Skip to content

Commit

Permalink
SHOW INDEXES can now be filtered on VECTOR same as other index ty…
Browse files Browse the repository at this point in the history
…pe filtering

allowing for `SHOW VECTOR INDEXES`
  • Loading branch information
Hunterness committed Nov 22, 2023
1 parent 9519ef4 commit 0693cc5
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,29 @@ New features are added to the language continuously, and occasionally, some feat
This section lists all of the features that have been removed, deprecated, added, or extended in different Cypher versions.
Replacement syntax for deprecated and removed features are also indicated.

[[cypher-deprecations-additions-removals-5.15]]
== Neo4j 5.15

=== Updated features

[cols="2", options="header"]
|===
| Feature
| Details
a|
label:functionality[]
label:updated[]

[source, cypher, role="noheader"]
----
SHOW VECTOR INDEXES
----

| Extended xref:indexes-for-search-performance.adoc#indexes-list-indexes[`SHOW INDEXES`] with easy filtering for vector indexes.
This is equivalent to `SHOW INDEXES WHERE type = 'VECTOR'`.

|===

[[cypher-deprecations-additions-removals-5.14]]
== Neo4j 5.14

Expand Down
6 changes: 3 additions & 3 deletions modules/ROOT/pages/indexes-for-search-performance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ Listing indexes can be done with `SHOW INDEXES`.

[source, syntax, role="noheader"]
----
SHOW [ALL \| FULLTEXT \| LOOKUP \| POINT \| RANGE \| TEXT] INDEX[ES]
SHOW [ALL \| FULLTEXT \| LOOKUP \| POINT \| RANGE \| TEXT \| VECTOR] INDEX[ES]
[YIELD { * \| field[, ...] } [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]
[WHERE expression]
[RETURN field[, ...] [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]
Expand Down Expand Up @@ -627,7 +627,7 @@ This command will produce a table with the following columns:
| `FLOAT`

| `type`
| The IndexType of this index (`FULLTEXT`, `LOOKUP`, `POINT`, `RANGE`, or `TEXT`). label:default-output[]
| The IndexType of this index (`FULLTEXT`, `LOOKUP`, `POINT`, `RANGE`, `TEXT`, or `VECTOR`). label:default-output[]
| `STRING`

| `entityType`
Expand Down Expand Up @@ -1095,7 +1095,7 @@ With `IF EXISTS`, no error is thrown and nothing happens should the index not ex
|
[source, syntax, role="noheader"]
----
SHOW [ALL \| FULLTEXT \| LOOKUP \| POINT \| RANGE \| TEXT] INDEX[ES]
SHOW [ALL \| FULLTEXT \| LOOKUP \| POINT \| RANGE \| TEXT \| VECTOR] INDEX[ES]
[YIELD { * \| field[, ...] } [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]
[WHERE expression]
[RETURN field[, ...] [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]
Expand Down
28 changes: 19 additions & 9 deletions modules/ROOT/pages/indexes-for-vector-search.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ Returns the requested number of approximate nearest neighbor nodes and their sim

| Drop vector index.
| `+DROP INDEX index_name+`
| Drop the specified index.
| Drop the specified index, see the xref:indexes-for-search-performance.adoc#indexes-drop-indexes[`DROP INDEX`] command for details.

| Listing all vector indexes.
| `SHOW INDEXES WHERE type = "VECTOR"`
| Lists all vector indexes, see the xref:indexes-for-search-performance.adoc#indexes-list-indexes[`SHOW INDEXES`] command for details. There is no vector index filter built into `SHOW INDEXES`.
| `SHOW VECTOR INDEXES`
| Lists all vector indexes, see the xref:indexes-for-search-performance.adoc#indexes-list-indexes[`SHOW INDEXES`] command for details.

| Set vector property.
| {link-procedures-reference}#procedure_db_create_setNodeVectorProperty[`db.create.setNodeVectorProperty`]
Expand Down Expand Up @@ -142,8 +142,7 @@ You can see that the vector index has been created using `SHOW INDEXES`:
.Query
[source,cypher]
----
SHOW INDEXES YIELD name, type, labelsOrTypes, properties, options
WHERE type = 'VECTOR'
SHOW VECTOR INDEXES YIELD name, type, labelsOrTypes, properties, options
----
.Result
Expand Down Expand Up @@ -400,7 +399,7 @@ For example, you cannot have one xref:indexes-vector-similarity-euclidean[Euclid

* Changes made within the same transaction are not visible to the index.

* There is no Cypher syntax for creating a vector index, nor for the standard index type filtering with xref:indexes-for-search-performance.adoc#indexes-list-indexes[`SHOW INDEXES`] command.
* There is no Cypher syntax for creating a vector index.

[[index-vector-issues]]
== Known issues
Expand All @@ -412,6 +411,19 @@ The following table lists the known issues and the version in which they were fi
|===
| Known issues | Fixed in

| The standard index type filtering for xref:indexes-for-search-performance.adoc#indexes-list-indexes[`SHOW INDEXES`] command is missing.

[TIP]
====
Filtering on vector indexes can be done with the `WHERE` clause as well:
[source,cypher]
----
SHOW INDEXES
WHERE type = 'VECTOR'
----
====
| Neo4j 5.15

| Querying for a _single_ approximate nearest neighbor from an index would fail a validation check. Passing a `null` value would also provide an unhelpful exception.
| Neo4j 5.13

Expand Down Expand Up @@ -477,9 +489,7 @@ If a store copy is required, make a note of the information in the `createStatem
For example:
[source,cypher]
----
SHOW INDEXES YIELD type, createStatement
WHERE type = 'VECTOR'
RETURN createStatement
SHOW VECTOR INDEXES YIELD createStatement
----
====
| Neo4j 5.12
Expand Down

0 comments on commit 0693cc5

Please sign in to comment.