fix: recognize SEARCH clause support on Aura 5.27+ - #605
Aryan-Pardeshi wants to merge 1 commit into
Conversation
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
left a comment
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
I think this check for 5.28-aura can be removed
Problem
On Aura instances reporting
5.27-aura,VectorCypherRetriever(and the other vector retrievers) still route throughdb.index.vector.queryNodesand trigger its deprecation warning on every retrieval (#601), even though those instances support the Cypher 25SEARCHclause.Root cause
supports_search_clausecompares 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 vectorSEARCHqueries while still reporting a 5.x version string — so the gate never opens for them.Change
supports_search_clausenow 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 theClientErrorfrom an unsupportedSEARCHquery and fall back to the procedure-based query with a warning.Testing
TestSupportsSearchClauseparametrized cases:5.27-aura/5.28-auranow True,5.26.0-auraand self-managed5.27.0stay False; all prior cases unchanged.test_pipeline_drawfailure reproduces on cleanmain, unrelated — Windows temp-file handling).ruff check,ruff format --check, andmypyclean.Closes #601