Skip to content

Docs: openCypher SEARCH and CREATE VECTOR INDEX (refs #267) - #294

Merged
tae898 merged 2 commits into
mainfrom
docs/cypher-vector
Nov 6, 2026
Merged

tae898 merged 2 commits into
mainfrom
docs/cypher-vector

Conversation

@tae898

@tae898 tae898 commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

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.py already runs. What it says and how each statement is pinned (all in the new tests/test_cypher_vector_behavior.py, one test or one parametrized test each):

  • SEARCH returns the k nearest with SCORE AS, and the rows and scores of db.index.vector.queryNodes, higher is closer (test_search_returns_the_k_nearest_with_the_scores_of_query_nodes).
  • The query vector is a list, a float32 array or a float64 array (test_the_query_vector_is_a_list_or_a_numpy_array).
  • LIMIT and the index name can be parameters (test_limit_and_the_index_name_can_be_parameters).
  • A WHERE inside the parentheses runs before the limit, one after it runs on the k rows (test_a_where_inside_the_search_runs_before_the_limit_and_one_after_it_runs_after).
  • A bad binding variable, OPTIONAL MATCH and an unknown index raise ArcadeDBError (test_search_mistakes_raise_arcadedb_error).
  • CREATE VECTOR INDEX keeps the name, SHOW INDEXES lists the statement, and SEARCH and queryNodes find 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).
  • A new label becomes a vertex type and the property is declared ARRAY_OF_FLOATS (test_the_label_becomes_a_vertex_type_and_the_property_is_declared).
  • The index covers existing records and later ones (test_the_index_covers_the_records_that_exist_and_those_written_later).
  • IF NOT EXISTS is 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, binary and efSearch are listed as given, and the default quantization is none (test_settings_are_listed_as_given_and_the_default_quantization_is_none).
  • The listed statement makes the same index again after DROP INDEX (test_the_listed_statement_makes_the_same_index_again).
  • An unknown setting or a setting given under two names is refused and leaves no index and no type (test_a_refused_statement_creates_no_index_and_no_type).
  • vector.dimensions may 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 INDEX and DROP 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 the VectorIndex on arcadedb-jvm for an index made by CREATE VECTOR INDEX, and None on native for any index whose name is not Type[property]. The cause was a filter on "[" in name in _native/database.py (_vector_rows); the type-level rows of schema:indexes carry no fileId and the per-bucket rows do, so the filter on fileId alone is enough. This PR now fixes it: the filter is gone, test_get_vector_index_returns_an_index_made_by_create_vector_index is an ordinary test on both builds (it also checks list_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 strict xfail on 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.1 and arcadedb-jvm==26.11.1 wheels: 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) and bandit on the new test file are clean.

🤖 Generated with Claude Code

tae898 and others added 2 commits November 7, 2026 01:10
…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>
@tae898
tae898 merged commit a7a4143 into main Nov 6, 2026
42 checks passed
@tae898
tae898 deleted the docs/cypher-vector branch November 6, 2026 17:16
@github-actions github-actions Bot added this to the 26.12.1 milestone Nov 6, 2026
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.

Native: get_vector_index() and list_vector_indexes() miss a vector index whose name is not Type[property]

1 participant