-
Notifications
You must be signed in to change notification settings - Fork 169
Issue #2284: Added Integration Tests for mixed vector documents #2818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Issue #2284: Added Integration Tests for mixed vector documents #2818
Conversation
@night-owl-1709 Thanks for adding in these tests. Looks like there are some CI failures which are related to the new tests: https://productionresultssa3.blob.core.windows.net/actions-results/9b41f7c3-9b55-49d9-a3bd-a68e10de9b41/workflow-job-run-6fdb6202-e42f-5733-908b-057e4d234ac3/logs/job/job-logs.txt?rsct=text%2Fplain&se=2025-08-04T22%3A37%3A18Z&sig=EfPWjtqDwcsUulX2%2BV740umx8BRBBziXfcDhjBkBdN8%3D&ske=2025-08-05T09%3A59%3A04Z&skoid=ca7593d4-ee42-46cd-af88-8b886a2f84eb&sks=b&skt=2025-08-04T21%3A59%3A04Z&sktid=398a6654-997b-47e9-b12b-9515b896b4de&skv=2025-05-05&sp=r&spr=https&sr=b&st=2025-08-04T22%3A27%3A13Z&sv=2025-05-05 Search for |
c2fced7
to
2dc3ebc
Compare
2dc3ebc
to
1f54561
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@night-owl-1709 can you please resolve the conflicts |
39bce47
to
dcca8a7
Compare
@navneet1v done |
src/test/java/org/opensearch/knn/integ/MixedVectorDocumentIT.java
Outdated
Show resolved
Hide resolved
2d6344e
to
9b0a3b0
Compare
Signed-off-by: Abhinav Tripathi <[email protected]>
9b0a3b0
to
f4dfd21
Compare
@navneet1v addressed your comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall
assertTrue("Should return search results for " + indexName, response.contains(HITS_PATTERN)); | ||
|
||
// Verify non-vector document (doc 10) is not in k-NN results | ||
assertFalse("Non-vector document should not appear in k-NN results for " + indexName, response.contains("\"_id\":\"10\"")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking just one document is a bit of a weak assert, you might want to collect ids in a set and find the difference to always be empty.
@night-owl-1709 can we fix comments from @shatejas and also rebase the code. |
); | ||
} | ||
|
||
private void addDocument(String indexName, int docId, XContentBuilder doc) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be in the base class
); | ||
} | ||
|
||
private Settings createIndexSettings(KNNEngine engine, SpaceType spaceType, boolean diskBased) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see if this in the base class or not
Description
This PR adds comprehensive integration tests to validate OpenSearch's ability to handle documents with mixed vector and non-vector fields across multiple engines (FAISS, Lucene) and query types (k-NN, script scoring, filters, etc). The implementation focuses on functional validation and performance testing with optimised test code and robust error handling.
Components:
MixedVectorDocumentIT.java
: Comprehensive functional and performance validations with enhanced error handling and loggingMixedVectorDocumentIT.java – Integration Tests
Query Types Covered
knn
queries with multiple k values and result validationscript_score
with cosine similarity and score verificationexists
field validation with count assertionsterm
+bool
filtered queries with category validationterms_aggregation
on categorical fields with proper error handlingEngines & Configuration
Related Issues
Implements #2284
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following the Developer Certificate of Origin and signing off your commits, please check here.