Skip to content

[ci][integrations] Enable Elasticsearch vector-store tests - #1011

Merged
wenjin272 merged 3 commits into
apache:mainfrom
kaiwangleo:bug/issue-999-elasticsearch-filter
Aug 14, 2026
Merged

[ci][integrations] Enable Elasticsearch vector-store tests#1011
wenjin272 merged 3 commits into
apache:mainfrom
kaiwangleo:bug/issue-999-elasticsearch-filter

Conversation

@kaiwangleo

@kaiwangleo kaiwangleo commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Fixes #999

Root cause

Filtered queryEmbedding requests applied the combined filter through SearchRequest.postFilter(...) after Elasticsearch had already selected the unfiltered KNN top-k results. This could return fewer than k matching documents.

Fix

Apply the combined filter directly to the Elasticsearch KNN clause through KnnSearch.Builder.filter(...).

Existing unified filters, raw filter_query handling, AND composition, k, num_candidates, and exception behavior are preserved.

Tests

  • WSL Maven compilation for the Elasticsearch module passed.
  • Real Elasticsearch 8.19 integration tests passed: 6 tests, 0 failures, 0 errors, 0 skipped.
  • Regression coverage includes:
    • unified filters;
    • raw filter_query;
    • combined filters;
    • matching documents outside the unfiltered top-k.

@github-actions github-actions Bot added doc-label-missing The Bot applies this label either because none or multiple labels were provided. fixVersion/0.4.0 priority/major Default priority of the PR or issue. and removed doc-label-missing The Bot applies this label either because none or multiple labels were provided. labels Aug 13, 2026
@kaiwangleo
kaiwangleo force-pushed the bug/issue-999-elasticsearch-filter branch from e3f654c to e2d30ef Compare August 14, 2026 06:26
@wenjin272 wenjin272 added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing The Bot applies this label either because none or multiple labels were provided. labels Aug 14, 2026
@wenjin272 wenjin272 changed the title [bug][vector-store][java] Fix filtered Elasticsearch KNN queries [ci][integrations] Enable Elasticsearch vector-store tests Aug 14, 2026
@github-actions github-actions Bot added doc-label-missing The Bot applies this label either because none or multiple labels were provided. and removed doc-not-needed Your PR changes do not impact docs labels Aug 14, 2026
@wenjin272

Copy link
Copy Markdown
Contributor

Thanks for taking this on. I have adjusted the PR title to reflect the current CI-focused scope.

@wenjin272
wenjin272 merged commit 750ceee into apache:main Aug 14, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-label-missing The Bot applies this label either because none or multiple labels were provided. fixVersion/0.4.0 priority/major Default priority of the PR or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Elasticsearch queryEmbedding applies filters as a post-filter, returning fewer than k documents

2 participants