-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix search_as_you_type not supporting multi-fields #15988
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
reta
merged 7 commits into
opensearch-project:main
from
gaobinlong:fix_search_as_you_type
Sep 23, 2024
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
46195e5
Fix search_as_you_type not supporting multi-fields
gaobinlong 087bf27
Modify change log
gaobinlong 605d96d
Fix test failure
gaobinlong b98cda7
merge main
gaobinlong c4c8fb1
merge main
gaobinlong 7658bb4
Merge remote-tracking branch 'upstream/main' into fix_search_as_you_type
gaobinlong ba5a497
Add more yaml test
gaobinlong 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
File renamed without changes.
63 changes: 63 additions & 0 deletions
63
rest-api-spec/src/main/resources/rest-api-spec/test/search/390_search_as_you_type.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,63 @@ | ||
| setup: | ||
| - do: | ||
| indices.create: | ||
| index: test_1 | ||
| body: | ||
| mappings: | ||
| properties: | ||
| text: | ||
| type: search_as_you_type | ||
| fields: | ||
| subField: | ||
| type: keyword | ||
| - do: | ||
| index: | ||
| index: test_1 | ||
| id: 1 | ||
| body: { text: test search as you type } | ||
|
|
||
| - do: | ||
| indices.refresh: | ||
| index: [test_1] | ||
|
|
||
| --- | ||
| teardown: | ||
| - do: | ||
| indices.delete: | ||
| index: test_1 | ||
|
|
||
| # related issue: https://github.com/opensearch-project/OpenSearch/issues/5035 | ||
| --- | ||
| "Test search_as_you_type data type supports multi-fields": | ||
| - skip: | ||
| version: " - 2.99.99" | ||
| reason: "the bug was fixed since 3.0.0" | ||
|
|
||
| - do: | ||
| indices.get_mapping: { | ||
| index: test_1 | ||
| } | ||
|
|
||
| - match: {test_1.mappings.properties.text.type: search_as_you_type} | ||
| - match: {test_1.mappings.properties.text.fields.subField.type: keyword} | ||
|
|
||
| - do: | ||
| search: | ||
| index: test_1 | ||
| body: | ||
| query: | ||
| multi_match: | ||
| query: "test search" | ||
| type: "bool_prefix" | ||
|
|
||
| - match: {hits.total.value: 1} | ||
|
|
||
| - do: | ||
| search: | ||
| index: test_1 | ||
| body: | ||
| query: | ||
| term: | ||
| text.subField: "test search as you type" | ||
|
|
||
| - match: {hits.total.value: 1} | ||
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.