Skip to content

feat: expose filters and lifecycle options in REST list and search (#89)#92

Open
dcfocus wants to merge 2 commits into
lance-format:mainfrom
dcfocus:feat/issue-89-rest-filters
Open

feat: expose filters and lifecycle options in REST list and search (#89)#92
dcfocus wants to merge 2 commits into
lance-format:mainfrom
dcfocus:feat/issue-89-rest-filters

Conversation

@dcfocus

@dcfocus dcfocus commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Brings the REST search and list endpoints to parity with the core and Python APIs by adding filters, include_expired, and include_retired, reusing the existing RecordFilters JSON semantics and LifecycleQueryOptions — mirroring the plumbing already used by REST retrieve. No new query language, no SQL, and no change to default visibility for expired/retired/superseded records.

Closes #89.

⚠️ Stacked on #93 — review/merge that first

This branch is stacked on top of #93 (deferred embedding, #88). Until #93 lands on main, the diff below shows both commits (b336bdc is #93's work; 1aae34a is this PR's #89 work). Once #93 merges I'll rebase this branch onto main so the diff is #89-only. Please review the second commit for #89.

What changed (#89)

  • lance-context-apiSearchRequest gains filters / include_expired / include_retired (legacy {query, limit} payloads still deserialize). The ContextStoreApi trait now takes search(&SearchRequest) and list(limit, offset, filters, include_expired, include_retired) (breaking change to the trait; acceptable pre-1.0).
  • lance-context-core — trait search/list route through the existing search_filtered_with_options / list_filtered_with_options.
  • lance-context-serversearch applies filters + lifecycle; list_records accepts filters (URL JSON string) plus include_expired / include_retired query params, matching the existing related_records style.
  • lance-context (unified) + lance-context-client — dispatch and RemoteContextStore updated; the low-level client list_records sends the new query params. Adds a serde_json dependency to the lance-context crate (the trait now exposes serde_json::Value).

Tests

Verification

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test: core (44), server (14, incl. 8 new), api (3) — all green.
  • Python untouched (already had filter/lifecycle parity).

🤖 Generated with Claude Code

dcfocus and others added 2 commits June 14, 2026 05:30
)

Append raw records first and enrich them with embeddings later. Adds an
`embedding` field to the record patch path so a vector can be attached or
replaced by id or external_id after the original write.

- core: RecordPatch.embedding, applied in update_visible_record
- api: RecordPatchDto.embedding; copied in core + server patch_from_dto
- python: embedding param on PyO3 update and Context.update()
- Rust client inherits the field via the UpdateRecordRequest JSON body

A record without an embedding is durably stored but excluded from vector
search until enriched, since search skips null-embedding records.

Tests: Rust core round-trip (by id + external_id) and Python e2e
(raw-first -> enrich, incl. add_many bulk). README documents the pattern.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ance-format#89)

Bring the REST `search` and `list` endpoints to parity with the core and
Python APIs by reusing the existing RecordFilters JSON semantics and
LifecycleQueryOptions, mirroring the existing `retrieve` plumbing.

- api: add `filters`/`include_expired`/`include_retired` to SearchRequest
  (legacy {query,limit} payloads still deserialize); change the
  ContextStoreApi trait so `search` takes `&SearchRequest` and `list` takes
  filters + lifecycle flags.
- core: route trait `search`/`list` through search_filtered_with_options /
  list_filtered_with_options.
- server: `search` route applies filters + lifecycle; `list_records` accepts
  `filters` (URL JSON string) plus `include_expired`/`include_retired` query
  params, matching the `related_records` style.
- unified + client: dispatch and RemoteContextStore updated; low-level
  list_records sends the new query params. Adds serde_json dep to the
  lance-context crate (trait now exposes serde_json::Value).
- tests: 8 server route tests (search & list x metadata/built-in field/
  expired/retired/relationships), a list invalid-filters test, and 3 api
  serde backward-compat tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

Expose filters and lifecycle options consistently in REST list and search APIs

1 participant