Extract Lucene query tests into engine-agnostic JSON test suite#2
Draft
Copilot wants to merge 1 commit into
Draft
Extract Lucene query tests into engine-agnostic JSON test suite#2Copilot wants to merge 1 commit into
Copilot wants to merge 1 commit into
Conversation
…format Extract Lucene core query tests into engine-agnostic JSON test suite with: - 14 reusable datasets covering all query types - 8 field schemas (keyword, text, positions) - 70 test cases across 10 query types in 23 test files - JSON Schema for validation - Java reference test runner - Rust runner placeholder with implementation guide Agent-Logs-Url: https://github.com/infinilabs/lucene/sessions/38e89113-7701-4f8d-ad64-20e8ae5d87ca Co-authored-by: medcl <64487+medcl@users.noreply.github.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.
Extracts core Lucene search query tests into a portable, implementation-independent JSON format — decoupling the semantic contract (given documents + query → expected results) from Java/Lucene internals. Designed to validate a Rust-based engine implementation against the same behavioral spec.
Format
Each test file references a reusable dataset + schema, defines queries, and asserts on results:
{ "dataset": "fuzzy-words", "schema": "single-keyword-field", "tests": [ { "id": "fuzzy-ordering-bbbbb", "description": "Results ordered by edit distance: bbbbb(0), abbbb(1), aabbb(2)", "query": { "type": "fuzzy", "field": "field", "value": "bbbbb", "max_edits": 2, "prefix_length": 0 }, "expected": { "count": 3, "ordered": ["bbbbb", "abbbb", "aabbb"] } } ] }What's included
search-test-suite/— self-contained at repo rootterm,boolean,phrase,fuzzy,prefix,wildcard,range,regexp,match_all,match_noneschema.json) for structural validation of test filesSearchTestSuiteRunner.javaexecutes the suite against Lucene to verify spec correctnessExtraction criteria
Only tests following the
index docs → query → assert hitspattern were extracted. Skipped: equals/hashCode, rewrite internals, scorer/weight, randomized stress tests, codec-specific tests — anything coupled to Lucene implementation details rather than search semantics.Expected results support
count(exact),count_min(lower bound),ordered(strict relevance order),hits.must_contain/hits.must_not_contain(set membership),match_field(which stored field to check).