Repository navigation
Docs: openCypher SEARCH and CREATE VECTOR INDEX (refs #267) - #294
Merged
Merged
Conversation
…with tests that pin each statement (refs #267) Row 7 of the docs audit. #264 left one paragraph on the vectors page that only linked to the main manual. The page now has a section for the SEARCH subclause and CREATE VECTOR INDEX (ArcadeDB 26.11.1): what SEARCH returns and how its inner WHERE differs from one after it, the query vector forms, the three mistakes it refuses, what CREATE VECTOR INDEX makes (name, index type, the label and the property declared, records covered), the settings it takes and lists back in SHOW INDEXES, what a refused statement leaves behind, an index that takes its dimensions from the first vector, and DROP INDEX. tests/test_cypher_vector_behavior.py pins each statement on both builds, and the existing vectors docs-page test runs the new blocks in order. The one difference between the builds is db.schema.get_vector_index for an index whose name is not Type[property]: native returns None (#288), pinned as a strict xfail on native, and the page says so. No local pytest run was possible (queue guard). The page blocks and every behaviour were run as plain scripts against the released arcadedb 26.11.1 and arcadedb-jvm 26.11.1 wheels: same output on both builds. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ex with any name (closes #288) The type-level rows of schema:indexes carry no file id, per-bucket rows do. The extra test for a bracket in the name hid every index named in openCypher. The strict xfail that pinned the difference is now an ordinary test on both builds, and the vectors page loses its workaround paragraph. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #267 (row 7, the openCypher vector features of 26.11.1). Not
Closes: the tracker stays open for the rest.Why this row: every other row of the tracker has a merged PR (rows 1, 6 and 13 in #264, 2 in #279, 3 and 9 in #281, 4 and 5 in #282, 8 in #284, 10 and 11 in #285, 12 in the Schema section of #281). Row 7 only has one paragraph from #264 that links to the main manual, with no example and no test.
The vectors page gets a section "openCypher: SEARCH and CREATE VECTOR INDEX" in place of that paragraph, and four new blocks in the chain that
tests/test_docs_vectors_page.pyalready runs. What it says and how each statement is pinned (all in the newtests/test_cypher_vector_behavior.py, one test or one parametrized test each):SEARCHreturns theknearest withSCORE AS, and the rows and scores ofdb.index.vector.queryNodes, higher is closer (test_search_returns_the_k_nearest_with_the_scores_of_query_nodes).float32array or afloat64array (test_the_query_vector_is_a_list_or_a_numpy_array).LIMITand the index name can be parameters (test_limit_and_the_index_name_can_be_parameters).WHEREinside the parentheses runs before the limit, one after it runs on thekrows (test_a_where_inside_the_search_runs_before_the_limit_and_one_after_it_runs_after).OPTIONAL MATCHand an unknown index raiseArcadeDBError(test_search_mistakes_raise_arcadedb_error).CREATE VECTOR INDEXkeeps the name,SHOW INDEXESlists the statement, andSEARCHandqueryNodesfind the index by that name (test_create_vector_index_keeps_its_name_and_lists_its_statement,test_the_index_is_found_by_its_name_by_search_and_by_query_nodes).ARRAY_OF_FLOATS(test_the_label_becomes_a_vertex_type_and_the_property_is_declared).test_the_index_covers_the_records_that_exist_and_those_written_later).IF NOT EXISTSis a no-op, and a second run without it raises (test_if_not_exists_makes_a_second_run_do_nothing_and_without_it_the_run_raises).euclidean,scalar,binaryandefSearchare listed as given, and the default quantization isnone(test_settings_are_listed_as_given_and_the_default_quantization_is_none).DROP INDEX(test_the_listed_statement_makes_the_same_index_again).test_a_refused_statement_creates_no_index_and_no_type).vector.dimensionsmay be left out and the first vector decides, a later vector of another length is refused (test_dimensions_may_be_left_out_and_the_first_vector_decides).DROP INDEXandDROP INDEX ... IF EXISTS(test_drop_index_drops_it_and_if_exists_does_not_raise_when_it_is_gone).While writing the page I found a difference between the builds, filed as #288:
db.schema.get_vector_index("Article", "embedding")returned theVectorIndexonarcadedb-jvmfor an index made byCREATE VECTOR INDEX, andNoneon native for any index whose name is notType[property]. The cause was a filter on"[" in namein_native/database.py(_vector_rows); the type-level rows ofschema:indexescarry nofileIdand the per-bucket rows do, so the filter onfileIdalone is enough. This PR now fixes it: the filter is gone,test_get_vector_index_returns_an_index_made_by_create_vector_indexis an ordinary test on both builds (it also checkslist_vector_indexes()), and the page drops its native workaround paragraph. Closes #288. The first CI run of this PR failed only because that test was a strictxfailon native, which the repository's no-skips gate counts as a skip.No local run of the new tests was possible (the laptop queue guard blocks the test runner), and CI is the first run of them. What I did run, as plain scripts against the released
arcadedb==26.11.1andarcadedb-jvm==26.11.1wheels: all 17 Python blocks of the page in order with the page's expected outputs (0 mismatches on both builds), and every statement and value the tests assert, with identical output on the two builds apart from the #288 difference. Static checks:compile(),pyflakes,pre-commit(black, isort, package-name guard) andbanditon the new test file are clean.🤖 Generated with Claude Code