I'm trying to create a vector index on neo4j community 5.21. I attempted this using the following syntax:
CREATE VECTOR INDEX vector IF NOT EXISTS
FOR (n:Chunk|Table)
ON n.embedding
OPTIONS { indexConfig: {
vector.dimensions: 384,
vector.similarity_function: 'cosine'
}}
I was able to produce this with a fulltext index using similar cypher. With the vector index, I get an error on the syntax (n:Chunk|Table), specifically the | character. How can i create one vector index for two labels. The two node labels have the same node property n.embedding.
Hi, sadly we don't have multi-label indexes other than the fulltext index.
So for vector indexes you'd either need two indexes with one per label or to add a common label on all the nodes with the two labels and then add the vector index for that label.