Skip to content

fix: recognize SEARCH clause support on Aura 5.27+ - #605

Open
Aryan-Pardeshi wants to merge 1 commit into
neo4j:mainfrom
Aryan-Pardeshi:fix/search-clause-aura-version-gate
Open

Aryan-Pardeshi wants to merge 1 commit into
neo4j:mainfrom
Aryan-Pardeshi:fix/search-clause-aura-version-gate

Conversation

@Aryan-Pardeshi

Copy link
Copy Markdown

Problem

On Aura instances reporting 5.27-aura, VectorCypherRetriever (and the other vector retrievers) still route through db.index.vector.queryNodes and trigger its deprecation warning on every retrieval (#601), even though those instances support the Cypher 25 SEARCH clause.

Root cause

supports_search_clause compares every server against (2026, 1, 0). Aura kept the 5.x version scheme after self-managed servers moved to year-based versions, and the Aura March 2026 release line (5.27-aura and later) GA'd vector SEARCH queries while still reporting a 5.x version string — so the gate never opens for them.

Change

supports_search_clause now returns True for Aura instances on 5.27+. Self-managed 5.x servers keep the procedure-based path. An over-eager guess stays safe: retrievers already catch the ClientError from an unsupported SEARCH query and fall back to the procedure-based query with a warning.

Testing

  • Extended the TestSupportsSearchClause parametrized cases: 5.27-aura/5.28-aura now True, 5.26.0-aura and self-managed 5.27.0 stay False; all prior cases unchanged.
  • Full unit suite: 1244 passed (1 pre-existing test_pipeline_draw failure reproduces on clean main, unrelated — Windows temp-file handling).
  • ruff check, ruff format --check, and mypy clean.

Closes #601

supports_search_clause compared every server against (2026, 1, 0), but
Aura kept the 5.x version scheme after self-managed servers moved to
year-based versions. Aura instances on the March 2026 release line and
later GA'd the Cypher 25 SEARCH clause while reporting e.g. '5.27-aura',
so those servers were routed to the deprecated
db.index.vector.queryNodes procedure and hit its deprecation warning on
every retrieval.

Treat Aura 5.27+ as SEARCH-capable. Self-managed 5.x servers keep the
procedure path. If a server is guessed wrong, the existing ClientError
fallback still retries with the procedure-based query.

Closes neo4j#601

@NathalieCharbel NathalieCharbel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Aryan-Pardeshi for the fix!

A few comments that I left below worth to be addressed before we merge it.
In general, the proposed fix is one direction. I am afraid the version check for aura is not reliable for checking features support as stated in one of my comments. A more reliable check would be a CYPHER 25 EXPLAIN of the SEARCH query either returning a plan or not, but this can be done in a follow up PR.

Also, can you add a line in CHANGELOG about the fix?

)
return False
if is_aura:
return version_tuple >= (5, 27, 0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am afraid it passes for 2025.x too. In fact, Aura didn't keep a 5.x line. Since the March 2025 release it pins dbms.components() to 5.27.0 for clients that parse SemVer - a frozen constant that every Aura instance reports regardless of the engine it runs.

A safer check would be:

if is_aura and version_tuple == (5, 27, 0):
   return True

# year-based versions; the Aura March release line (5.27-aura+)
# GA'd the Cypher 25 SEARCH clause for vector queries (#601).
("5.27-aura", True),
("5.28-aura", True),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this check for 5.28-aura can be removed

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.

[BUG]: VectorCypherRetriever uses deprecated db.index.vector.queryNodes on Aura 5.27 even though SEARCH works

2 participants