-
Notifications
You must be signed in to change notification settings - Fork 2.5k
added yaml rest integration test & document-indexing test #20691
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1240,3 +1240,32 @@ setup: | |
|
|
||
| - match: { hits.total: 1 } | ||
| - match: { hits.hits.0._source.a_field: "quick brown fox jump lazy dog" } | ||
|
|
||
| --- | ||
| "index document with term_vector on search_as_you_type field": | ||
|
|
||
| - do: | ||
| indices.delete: | ||
| index: test-term-vector-index | ||
| ignore_unavailable: true | ||
|
|
||
| - do: | ||
| indices.create: | ||
| index: test-term-vector-index | ||
| body: | ||
| settings: | ||
| number_of_replicas: 0 | ||
| mappings: | ||
| properties: | ||
| my_field: | ||
| type: search_as_you_type | ||
| term_vector: with_positions_offsets | ||
|
|
||
| - do: | ||
| index: | ||
| index: test-term-vector-index | ||
| id: 1 | ||
| body: | ||
| my_field: "hello world" | ||
|
|
||
| - match: { result: created } | ||
|
Comment on lines
+1244
to
+1271
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check for duplicate occurrences of the test scenario name across YAML test files
rg -rn "index document with term_vector on search_as_you_type field" --type yamlRepository: opensearch-project/OpenSearch Length of output: 177 🏁 Script executed: #!/bin/bash
# Find the actual file and examine its structure
find . -name "10_basic.yml" -path "*search-as-you-type*" -type fRepository: opensearch-project/OpenSearch Length of output: 174 🏁 Script executed: #!/bin/bash
# Get file size and line count
wc -l "modules/mapper-extras/src/yamlRestTest/resources/rest-api-spec/test/search-as-you-type/10_basic.yml" 2>/dev/null || echo "File not found"Repository: opensearch-project/OpenSearch Length of output: 177 🏁 Script executed: #!/bin/bash
# Read the end of the file to see the test in question and any teardown
tail -50 "modules/mapper-extras/src/yamlRestTest/resources/rest-api-spec/test/search-as-you-type/10_basic.yml"Repository: opensearch-project/OpenSearch Length of output: 1403 🏁 Script executed: #!/bin/bash
# Search for all occurrences of "term_vector" and "search_as_you_type" together in the file
rg -n "term_vector|teardown|---" "modules/mapper-extras/src/yamlRestTest/resources/rest-api-spec/test/search-as-you-type/10_basic.yml" | head -100Repository: opensearch-project/OpenSearch Length of output: 793 🏁 Script executed: #!/bin/bash
# Simple grep to find if the test scenario name appears more than once
grep -n "index document with term_vector" "modules/mapper-extras/src/yamlRestTest/resources/rest-api-spec/test/search-as-you-type/10_basic.yml"Repository: opensearch-project/OpenSearch Length of output: 140 Add a teardown section to clean up the test-term-vector-index created in this test. This test creates a persistent index ( This prevents state pollution and ensures the test can be re-run without encountering a 409 Conflict error. 🤖 Prompt for AI Agents |
||
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.
Was the issue resolved by #3119? So this PR aims to add more 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.
Yup. The issue fixed by PR #3119. This PR only added test to verifies actual document indexing doesn't throw, and not just that FieldType flags are set correctly. They close a gap in the existing test coverage so we could regress the production fix without the existing tests catching the actual exception.
Let me know what your thoughts about it?
Thank you!