-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do NOT allow termvectors on nested fields (#32728)
Requesting _termvectors on a nested field or any sub-fields of a nested field returns empty results. Closes #21625
- Loading branch information
1 parent
8f8d3a5
commit fdff8f3
Showing
3 changed files
with
67 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
49 changes: 49 additions & 0 deletions
49
rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/50_nested.yml
This file contains 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,49 @@ | ||
setup: | ||
- do: | ||
indices.create: | ||
index: testidx | ||
body: | ||
mappings: | ||
_doc: | ||
properties: | ||
nested1: | ||
type : nested | ||
properties: | ||
nested1-text: | ||
type: text | ||
object1: | ||
properties: | ||
object1-text: | ||
type: text | ||
object1-nested1: | ||
type: nested | ||
properties: | ||
object1-nested1-text: | ||
type: text | ||
- do: | ||
index: | ||
index: testidx | ||
type: _doc | ||
id: 1 | ||
body: | ||
"nested1" : [{ "nested1-text": "text1" }] | ||
"object1" : [{ "object1-text": "text2" }, "object1-nested1" : [{"object1-nested1-text" : "text3"}]] | ||
|
||
- do: | ||
indices.refresh: {} | ||
|
||
--- | ||
"Termvectors on nested fields should return empty results": | ||
|
||
- do: | ||
termvectors: | ||
index: testidx | ||
type: _doc | ||
id: 1 | ||
fields: ["nested1", "nested1.nested1-text", "object1.object1-nested1", "object1.object1-nested1.object1-nested1-text", "object1.object1-text"] | ||
|
||
- is_false: term_vectors.nested1 | ||
- is_false: term_vectors.nested1\.nested1-text # escaping as the field name contains dot | ||
- is_false: term_vectors.object1\.object1-nested1 | ||
- is_false: term_vectors.object1\.object1-nested1\.object1-nested1-text | ||
- is_true: term_vectors.object1\.object1-text |
This file contains 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