Skip to content

Support collection fields and OData lambda operators#33

Merged
paulirwin merged 1 commit into
mainfrom
issue/6
May 8, 2026
Merged

Support collection fields and OData lambda operators#33
paulirwin merged 1 commit into
mainfrom
issue/6

Conversation

@paulirwin
Copy link
Copy Markdown
Member

@paulirwin paulirwin commented May 8, 2026

Summary

  • Adds Collection(Edm.String|Int32|Int64|Double|Boolean|DateTimeOffset) indexing using Lucene's native multi-valued field model, plus a __azs_collection__<name> sidecar StoredField so JSON arrays round-trip with order, type fidelity, and emptiness preserved.
  • Implements OData lambda operators in ODataQueryVisitor: Tags/any(t: t eq 'red'), Tags/any() (non-empty collection), Tags/all(t: t ne 'x'), search.in inside lambdas, numeric range comparisons (s ge 12), and combinations with and/or/not. Range-variable references resolve back to the collection's field path via a context stack so nested lambdas would compose cleanly.
  • all(t: P(t)) is rewritten as MatchAll MUST_NOT P′ where the leaf comparison is inverted, which keeps the resulting Lucene query a single clean negation against the multi-valued field.

Test plan

  • 26 new unit tests in CollectionFieldTests.cs covering indexing, retrieval, lambda translation, merge-replace of collections through LuceneNetSearchIndexer, and empty-collection semantics. 134/134 unit tests pass.
  • 6 new integration tests in EmulatorIntegrationTests.cs exercising the full SDK → HTTP → emulator path with the official Azure.Search.Documents client: upload + GetDocument round-trip, any(eq), any(search.in), all(ne), numeric any(ge), and free-text search across a searchable string collection. 25/25 integration tests pass against a Testcontainer-hosted emulator.

Fixes #6

🤖 Generated with Claude Code

Implements Collection(Edm.*) field types end-to-end: multi-valued
indexing via Lucene's native multi-field model, JSON-array round-trip
through a sidecar stored field, and OData any/all lambda support
(Tags/any(t: t eq 'red'), Sizes/all(s: s ge 12), search.in inside
lambdas, any() with no body).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@paulirwin paulirwin changed the title Support collection fields and OData lambda operators (closes #6) Support collection fields and OData lambda operators May 8, 2026
@paulirwin paulirwin merged commit 6db12cb into main May 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collection field support

1 participant