Skip to content

Add opt-in in-index filtering to Neo4jVectorStore - #6991

Open
Shay-Deng wants to merge 1 commit into
spring-projects:mainfrom
Shay-Deng:feature/6990-neo4j-search
Open

Shay-Deng wants to merge 1 commit into
spring-projects:mainfrom
Shay-Deng:feature/6990-neo4j-search

Conversation

@Shay-Deng

Copy link
Copy Markdown

The current procedure-based search takes the global topK candidates before applying metadata filters. With five nearer nonmatching documents and ten farther matching documents, a filtered request for five results returns none.

Add an opt-in Cypher 25 SEARCH strategy for Neo4j 2026.01+ that applies supported metadata predicates inside vector index search. Keep VECTOR_QUERY as the default for compatibility. Expose the strategy and filterable metadata fields through the builder and Spring Boot properties, and document setup and restrictions.

The new strategy supports equality and range comparisons joined with AND. Values are bound as parameters and identifiers are escaped. Unsupported predicates fail explicitly. Schema initialization creates filtering properties and rejects incompatible existing indexes without migrating them. Externally managed indexes remain the application's responsibility.

Related to #6990. This change addresses post-filtering behavior; it does not establish that the existing procedure bypasses its index or provide performance benchmark claims.

Validation:

  • The selected 14-module reactor passed verify, including 48 unit tests and 31 integration tests on Neo4j 5.24 and 2026.01, using fixed embeddings without provider API keys.
  • The regression test returns zero results through the legacy path and five matching documents through SEARCH. Tests also cover Spring Boot binding, thresholds, predicate restrictions, incompatible schemas and escaped identifiers.
  • Full repository ./mvnw clean package passed: all 169 reactor modules succeeded (JDK 25, Maven build cache disabled).

Add an opt-in Cypher 25 SEARCH strategy with indexed metadata
predicates while retaining the default procedure-based search.
Include schema validation, Spring Boot configuration, documentation
and fixed-vector tests for Neo4j 5.24 and 2026.01.

Related to spring-projects#6990.

Signed-off-by: HowieDeng <116950190+Shay-Deng@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants