We have a multi-tenant app using a vector index for similarity search. Each node has a company_id property identifying the tenant.
Current approach (post-filtering):
CALL db.index.vector.queryNodes('my_vector_index', 50, $embedding)
YIELD node, score
WHERE node.company_id = $company_id
RETURN node, score
ORDER BY score DESC LIMIT 5
This fetches the 50 nearest vectors globally across all tenants, then filters. As tenants grow, smaller tenants get crowded out by larger ones and return zero results despite having valid matches.
Questions:
-
Does Neo4j support pre-filtering vector search by a property like company_id? Which version introduced this?
-
What's the syntax to create a vector index with a filterable property?
-
Can an existing vector index be altered, or must it be dropped and recreated?
-
After recreating the index, are existing nodes automatically re-indexed?
Environment:
so its in preview mode? i am using neo4j community editon
Some more information for your questions 2-4:
- Creating the index with filtering on
company_id would look like this:
CREATE VECTOR INDEX my_vector_index IF NOT EXISTS
FOR (n:Label)
ON n.embedding
WITH [n.company_id]
OPTIONS { indexConfig: {
`vector.dimensions`: 1536,
`vector.similarity_function`: 'cosine'
}}
- You can't alter the existing index, you need to create a new one.
- Yes, existing nodes (that match e.g.
(n:Label)) will be indexed.
It's GA since 2026.02. It is available in Community, but with restrictions. See docs here.
Restrictions: Can u elaborate or share link where restrictions are mentioned?
There is a note in that section:
Vector indexes are available in both Neo4j Enterprise Edition and Community Edition. Community Edition can index embeddings stored as LIST<INTEGER | FLOAT> properties. Storing embeddings as native VECTOR properties requires block format, which is available in Enterprise Edition and Aura.
so if i am using community edition so going for pre-filtering is not a good idea?
If you can work with LIST<INTEGER|FLOAT> for your embeddings, you should be able to use vector search with filters (which is what you want). Or try Aura.