-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add field usage support for vectors #80608
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
81 changes: 81 additions & 0 deletions
81
...gin/src/yamlRestTest/resources/rest-api-spec/test/vectors/50_dense_vector_field_usage.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| setup: | ||
| - skip: | ||
| features: headers | ||
|
|
||
| - do: | ||
| indices.create: | ||
| index: futest | ||
| body: | ||
| settings: | ||
| routing.rebalance.enable: none | ||
| index.number_of_shards: 1 | ||
| index.number_of_replicas: 0 | ||
| mappings: | ||
| properties: | ||
| name: | ||
| type: keyword | ||
| vector: | ||
| type: dense_vector | ||
| dims: 5 | ||
| index: true | ||
| similarity: l2_norm | ||
|
|
||
| - do: | ||
| index: | ||
| index: futest | ||
| body: | ||
| name: cow.jpg | ||
| vector: [ 230.0, 300.33, -34.8988, 15.555, -200.0 ] | ||
|
|
||
| - do: | ||
| index: | ||
| index: futest | ||
| id: 2 | ||
| body: | ||
| name: moose.jpg | ||
| vector: [ -0.5, 100.0, -13, 14.8, -156.0 ] | ||
|
|
||
| - do: | ||
| index: | ||
| index: futest | ||
| id: 3 | ||
| body: | ||
| name: rabbit.jpg | ||
| vector: [ 0.5, 111.3, -13.0, 14.8, -156.0 ] | ||
|
|
||
| - do: | ||
| indices.refresh: { } | ||
|
|
||
| --- | ||
| "Field usage": | ||
| - do: | ||
| knn_search: | ||
| index: futest | ||
| body: | ||
| fields: [ "name" ] | ||
| knn: | ||
| field: vector | ||
| query_vector: [-0.5, 90.0, -10, 14.8, -156.0] | ||
| k: 2 | ||
| num_candidates: 3 | ||
|
|
||
| - match: {hits.hits.0._id: "2"} | ||
| - match: {hits.hits.0.fields.name.0: "moose.jpg"} | ||
|
|
||
| - match: {hits.hits.1._id: "3"} | ||
| - match: {hits.hits.1.fields.name.0: "rabbit.jpg"} | ||
|
|
||
| - do: | ||
| indices.field_usage_stats: { index: futest } | ||
|
|
||
| - is_true: futest | ||
| - length: { futest.shards: 1 } | ||
|
|
||
| - gt: { futest.shards.0.stats.all_fields.any: 0 } | ||
| - gt: { futest.shards.0.stats.all_fields.knn_vectors: 0 } | ||
|
|
||
| - gt: { futest.shards.0.stats.fields.vector.any: 0 } | ||
| - gt: { futest.shards.0.stats.fields.vector.knn_vectors: 0 } | ||
|
|
||
| - gt: { futest.shards.0.stats.fields._id.stored_fields: 0 } | ||
| - match: { futest.shards.0.stats.fields._id.knn_vectors: 0 } | ||
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.
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 test might need a skip section for <8.1 for mixed cluster tests.
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.
hmm, don't really understand why this passes test. Maybe we don't run these in x-pack on mixed clusters?
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.
yes, this validates my understanding (I deliberately did not add the version constraint to check if anything breaks on CI). I find the findings very worrying though.
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.
Good to see that we both expected this to fail in some way. Maybe worth some parallel investigation, I'd be interested in the results.
Uh oh!
There was an error while loading. Please reload this page.
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.
It seems we don't have "mixed cluster" tests for x-pack like we do for the core apis. So we simply aren't running this test under that scenario at all. See #31096
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.
Wow, that's scary (and lol for linking to my own issue, guess my memory is failing me).
Perhaps that one needs to be reprioritized!
Uh oh!
There was an error while loading. Please reload this page.
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.
The issue seems to be tagged as core/infra but I'm not sure if that's strictly correct. There's no real clear ownership of these large cross-functional test suites. It's really just a matter of adding a qa project for this under x-pack similar to the existing core one.