Skip to content

fix: route Neo4j fulltext searches through the overridable query builder - #1829

Open
g33kroid wants to merge 1 commit into
getzep:mainfrom
g33kroid:fix/fulltext-query-override-point
Open

g33kroid wants to merge 1 commit into
getzep:mainfrom
g33kroid:fix/fulltext-query-override-point

Conversation

@g33kroid

@g33kroid g33kroid commented Sep 3, 2026

Copy link
Copy Markdown

What

SearchOperations declares build_fulltext_query as an override point, but the four fulltext search methods in Neo4jSearchOperations call the module-level _build_neo4j_fulltext_query directly:

fuzzy_query = _build_neo4j_fulltext_query(query, group_ids)

So a subclass that overrides the method is silently bypassed. This routes all four through self.build_fulltext_query.

Why it matters

Any Bolt-compatible backend that reuses Neo4jSearchOperations — ArcadeDB is the case we hit (#1259 / #1310) — inherits Neo4j's Lucene field-scoped syntax no matter what it overrides. The override point exists; it just isn't used. The FalkorDB and Kuzu backends avoid this only by reimplementing the methods wholesale.

The MAX_QUERY_LENGTH detail

MAX_QUERY_LENGTH is passed explicitly rather than relying on the default. The direct calls default to MAX_QUERY_LENGTH (128); build_fulltext_query's own default is 8000. Omitting it would quietly raise the cap 60×, changing which queries short-circuit to ''. search_utils.py:94 already calls it in this explicit form.

Behaviour

No change for Neo4j — build_fulltext_query delegates to _build_neo4j_fulltext_query with the same argument. This only makes the declared extension point work.

Verification

  • pytest tests/utils tests/driver tests/test_edge_db_queries.py tests/test_node_label_security.py — 253 passed, 1 skipped
  • ruff check and ruff format --check clean on the changed file

4 lines changed, one file. Not an integration, so no RFC — but it is a prerequisite for the ArcadeDB backend discussed in #1259 to work without duplicating the search operations.

@zep-cla-assistant

zep-cla-assistant Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@g33kroid

g33kroid commented Sep 3, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: mina.abkarino@hotmail.com

SearchOperations declares build_fulltext_query as an override point, but the
four fulltext search methods in Neo4jSearchOperations call the module-level
_build_neo4j_fulltext_query directly. A subclass that overrides the method —
any Bolt-compatible backend reusing this class — is silently bypassed and gets
Neo4j's Lucene field-scoped syntax regardless.

Route the four call sites through self.build_fulltext_query, passing
MAX_QUERY_LENGTH explicitly so the 128-word cap is preserved: the method's own
default is 8000, so omitting it would raise the limit 60x. search_utils.py
already calls it in this form.

No behaviour change for Neo4j — build_fulltext_query delegates to the same
function with the same argument.
@g33kroid
g33kroid force-pushed the fix/fulltext-query-override-point branch from ed0db89 to 646c9f0 Compare September 3, 2026 10:34
zep-cla-assistant Bot added a commit that referenced this pull request Sep 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant