-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Remove vectors from _source transparently
#130382
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 6 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
746a233
Introduce a new setting and a feature flag for the synthetic vectors …
jimczi 309e4c3
Introduce a synthetic vectors source loader and a synthetic vectors f…
jimczi 9bfea9c
Handle the new setting in search and get api to exclude vectors when …
jimczi 6c584e9
handle recovery and translog when synthetic vectors is on
jimczi 9357340
Add support for synthetic vectors in dense vector field mapper
jimczi 4ff2123
Update docs/changelog/130382.yaml
jimczi 883af2c
Merge branch 'main' into synthetic_vectors
jimczi 62c98c3
Propagate feature flag where it's needed
jimczi ba65346
Merge remote-tracking branch 'origin/synthetic_vectors' into syntheti…
jimczi fa02743
add yml tests for partial updates and get API
jimczi e419b76
Merge remote-tracking branch 'upstream/main' into synthetic_vectors
jimczi 56d7b75
fix propagation of leaf reader
jimczi 52d9278
fix RcsCcsCommonYamlTestSuiteIT
jimczi 1d64c86
add yaml tests with the fields option and patch the vectors as list t…
jimczi bacc3fe
Merge remote-tracking branch 'upstream/main' into synthetic_vectors
jimczi bf61ed2
Merge branch 'main' into synthetic_vectors
jimczi 9b383d3
Merge remote-tracking branch 'upstream/main' into synthetic_vectors
jimczi 6cdf89b
empty line
jimczi 439dae1
Merge branch 'main' into synthetic_vectors
jimczi 6554aee
Update 130382.yaml
jimczi 27c3a3b
apply review comments
jimczi 5845c27
Add comments and make the code more readable
jimczi 26ab174
Merge remote-tracking branch 'upstream/main' into synthetic_vectors
jimczi efaf6bd
Merge branch 'main' into synthetic_vectors
jimczi f0cbd8b
Merge remote-tracking branch 'upstream/main' into synthetic_vectors
jimczi e494584
Merge remote-tracking branch 'origin/synthetic_vectors' into syntheti…
jimczi 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 130382 | ||
| summary: Remove vectors from `_source` transparently | ||
| area: "Mapping, Vector Search" | ||
| type: enhancement | ||
| issues: [] |
151 changes: 151 additions & 0 deletions
151
...yamlRestTest/resources/rest-api-spec/test/search.vectors/240_source_synthetic_vectors.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,151 @@ | ||
| setup: | ||
| - requires: | ||
| reason: 'synthetic vectors are required' | ||
| test_runner_features: [ capabilities ] | ||
| capabilities: | ||
| - method: GET | ||
| path: /_search | ||
| capabilities: [ synthetic_vectors_setting ] | ||
| - skip: | ||
| features: "headers" | ||
|
|
||
| - do: | ||
| indices.create: | ||
| index: test | ||
| body: | ||
| settings: | ||
| index.mapping.synthetic_vectors: true | ||
| mappings: | ||
| properties: | ||
| name: | ||
| type: keyword | ||
| vector: | ||
| type: dense_vector | ||
| dims: 5 | ||
| similarity: l2_norm | ||
|
|
||
| nested: | ||
| type: nested | ||
| properties: | ||
| paragraph_id: | ||
| type: keyword | ||
| vector: | ||
| type: dense_vector | ||
| dims: 5 | ||
| similarity: l2_norm | ||
|
|
||
| - do: | ||
| index: | ||
| index: test | ||
| id: "1" | ||
| body: | ||
| name: cow.jpg | ||
| vector: [36, 267, -311, 12, -202] | ||
|
|
||
| - do: | ||
| index: | ||
| index: test | ||
| id: "2" | ||
| body: | ||
| name: moose.jpg | ||
| nested: | ||
| - paragraph_id: 0 | ||
| vector: [-0.5, 100.0, -13, 14.8, -156.0] | ||
| - paragraph_id: 2 | ||
| vector: [0, 100.0, 0, 14.8, -156.0] | ||
| - paragraph_id: 3 | ||
| vector: [0, 1.0, 0, 1.8, -15.0] | ||
|
|
||
| - do: | ||
| index: | ||
| index: test | ||
| id: "3" | ||
| body: | ||
| name: rabbit.jpg | ||
| vector: [-0.5, 100.0, -13, 14.8, -156.0] | ||
|
|
||
| - do: | ||
| index: | ||
| index: test | ||
| id: "4" | ||
| body: | ||
| name: zoolander.jpg | ||
| nested: | ||
| - paragraph_id: 0 | ||
| vector: [ -0.5, 100.0, -13, 14.8, -156.0 ] | ||
| - paragraph_id: 1 | ||
| - paragraph_id: 2 | ||
| vector: [ -9.8, 109, 32, 14.8, 23 ] | ||
|
|
||
|
|
||
| - do: | ||
| indices.refresh: {} | ||
|
|
||
| --- | ||
| "exclude synthetic vectors": | ||
| - do: | ||
| search: | ||
| index: test | ||
| body: | ||
| sort: ["name"] | ||
|
|
||
| - match: { hits.hits.0._id: "1"} | ||
| - match: { hits.hits.0._source.name: "cow.jpg"} | ||
| - not_exists: hits.hits.0._source.vector | ||
|
|
||
| - match: { hits.hits.1._id: "2"} | ||
| - match: { hits.hits.1._source.name: "moose.jpg"} | ||
| - length: { hits.hits.1._source.nested: 3 } | ||
| - not_exists: hits.hits.1._source.nested.0.vector | ||
| - match: { hits.hits.1._source.nested.0.paragraph_id: 0 } | ||
| - not_exists: hits.hits.1._source.nested.1.vector | ||
| - match: { hits.hits.1._source.nested.1.paragraph_id: 2 } | ||
| - not_exists: hits.hits.1._source.nested.2.vector | ||
| - match: { hits.hits.1._source.nested.2.paragraph_id: 3 } | ||
|
|
||
| - match: { hits.hits.2._id: "3" } | ||
| - match: { hits.hits.2._source.name: "rabbit.jpg" } | ||
| - not_exists: hits.hits.2._source.vector | ||
|
|
||
| - match: { hits.hits.3._id: "4" } | ||
| - match: { hits.hits.3._source.name: "zoolander.jpg" } | ||
| - length: { hits.hits.3._source.nested: 3 } | ||
| - not_exists: hits.hits.3._source.nested.0.vector | ||
| - match: { hits.hits.3._source.nested.0.paragraph_id: 0 } | ||
| - match: { hits.hits.3._source.nested.1.paragraph_id: 1 } | ||
| - not_exists: hits.hits.3._source.nested.2.vector | ||
| - match: { hits.hits.3._source.nested.2.paragraph_id: 2 } | ||
|
|
||
| --- | ||
| "include synthetic vectors": | ||
| - do: | ||
| search: | ||
| index: test | ||
| body: | ||
| _source: | ||
| exclude_vectors: false | ||
| sort: ["name"] | ||
benwtrent marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - match: { hits.hits.0._id: "1"} | ||
| - match: { hits.hits.0._source.name: "cow.jpg"} | ||
| - exists: hits.hits.0._source.vector | ||
|
|
||
| - match: { hits.hits.1._id: "2"} | ||
| - match: { hits.hits.1._source.name: "moose.jpg"} | ||
| - length: { hits.hits.1._source.nested: 3 } | ||
| - exists: hits.hits.1._source.nested.0.vector | ||
| - match: { hits.hits.1._source.nested.0.paragraph_id: 0 } | ||
| - exists: hits.hits.1._source.nested.1.vector | ||
| - match: { hits.hits.1._source.nested.1.paragraph_id: 2 } | ||
| - exists: hits.hits.1._source.nested.2.vector | ||
| - match: { hits.hits.1._source.nested.2.paragraph_id: 3 } | ||
|
|
||
| - match: { hits.hits.2._id: "3" } | ||
| - match: { hits.hits.2._source.name: "rabbit.jpg" } | ||
| - exists: hits.hits.2._source.vector | ||
|
|
||
| - match: { hits.hits.3._id: "4" } | ||
| - match: { hits.hits.3._source.name: "zoolander.jpg" } | ||
| - length: { hits.hits.3._source.nested: 3 } | ||
| - exists: hits.hits.3._source.nested.0.vector | ||
| - match: { hits.hits.3._source.nested.0.paragraph_id: 0 } | ||
benwtrent marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.