Vector Indexing Across Multiple Node Labels

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.

Thanks

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.

Hope that helps,
Therese

1 Like

@sergicxs

Create vector indexes
A vector index is a single-label, single-property index for nodes or
 a single-relationship-type, .... .....

and so given single-label, single-property what you are proposing isnt currently possible

1 Like