Skip to content
Open
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
67 changes: 66 additions & 1 deletion modules/ROOT/pages/errors/gql-errors/51N65.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,73 @@
= 51N65

== Status description
error: system configuration or operation exception - vector index dimensionality mismatch. Vector index `{ <<idx>> }` has a dimensionality of `{ <<dim>>1 }`, but indexed vectors have `{ $dim2 }`.
error: system configuration or operation exception - vector index dimensionality mismatch. Vector index `{ <<idx>> }` has a configured dimensionality of `{ <<dim>>1 }`, but the provided vector has a dimension `{ <<dim>>2 }`.

== Example scenario
For example, given that you have created the following vector index:

[source,cypher]
----
CREATE VECTOR INDEX indexName
FOR (n: Label) ON n.prop
OPTIONS {
indexConfig: {`vector.dimensions`: 1048}
}
----

When querying it with a vector with a dimension other than 1048:

[source,cypher]
----
CYPHER 25
MATCH (n)
SEARCH n IN (
VECTOR INDEX indexName
FOR vector([1, 2, 3], 3, INTEGER)
LIMIT 5
)
RETURN n
----

or

[source,cypher]
----
CALL db.index.vector.queryNodes('indexName', 5, [1, 2, 3])
----

You will receive an error with GQLSTATUS 51N65 and a status description:

[source]
----
error: system configuration or operation exception - vector index dimensionality mismatch. Vector index `indexName` has a configured dimensionality of 1048, but the provided vector has dimension 3.
----

== Possible solution

If you want to store and query vectors of varying dimensions in the same vector index, it cannot have a configured dimension.
For example:

. Drop the index you want to change the configuration of:
+
[source,cypher]
----
DROP INDEX indexName
----

. Recreate the index without the configured dimension:
+
[source,cypher]
----
CREATE VECTOR INDEX indexName
FOR (n: Label) ON n.prop
----

[NOTE]
====
It is recommended to configure dimensions when creating a vector index.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I understand the note.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a note which I stole from the operations manual. So depending on what the user aimed to do with the failing query, the solution to the error might be to not configure dimensions for the index. But they should be aware that we generally recommend to configure dimensions unless you have that specific usecase with vectors of mixed dimensions.

Something like that. Do you think I should rephrase it to make it more clear that it is kind of a warning/caveat to the proposed solution or should we remove the note you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find it in the operations manual to see the context, but I like your suggestion. Maybe something like this:

Suggested change
It is recommended to configure dimensions when creating a vector index.
Depending on what you want to do with the failing query, the solution might be to omit the dimension when creating the index on vectors with different dimensions.
However, keep in mind that in all other cases, it is recommended to provide a dimension, as this adds additional checks that ensure only vectors with the configured dimensions are indexed.

For most use cases, you would instead want to query the index with only vectors of dimension 1048.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For most use cases, you would instead want to query the index with only vectors of dimension 1048.

====

ifndef::backend-pdf[]
[discrete.glossary]
Expand Down