diff --git a/commands/graph.query.md b/commands/graph.query.md index 74cb1eb..bfde652 100644 --- a/commands/graph.query.md +++ b/commands/graph.query.md @@ -1581,3 +1581,70 @@ For a node label, the full-text index deletion syntax is: ```sh GRAPH.QUERY DEMO_GRAPH "CALL db.idx.fulltext.drop('Movie')" ``` + +## Vector indexing + +With the introduction of the vector data-type a new type of index was introduce. +A vector index is a dedicated index for indexing and retriving vectors + +To create this type of index use the following syntax: + +```sh +CREATE VECTOR INDEX FOR ON OPTIONS +``` + +For example, to create a vector index over all Product nodes description attribute +use the following syntax: + +```sh +CREATE VECTOR INDEX FOR (p:Product) ON (p.description) OPTIONS {dim:128, similarityFunction:'euclidean'} +``` + +Please note when creating a vector index both the vector dimension and similarity function +must be provided. At the moment the only supported similarity function is 'euclidean'. + +### Query vector index + +Vector indices are used to retrieved similar vectors to a given query vector +using the similarity function as a measure of "distance" + +To query the index use the vector.query procedure as follows: + +```sh +CALL db.idx.vector.query( { + type: 'NODE'/'RELATIONSHIP', + label: