forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55f4554
commit 47732ce
Showing
3 changed files
with
77 additions
and
34 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
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
54 changes: 54 additions & 0 deletions
54
x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/counted_keyword/20_no_index.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,54 @@ | ||
setup: | ||
|
||
- skip: | ||
version: " - 8.12.99" | ||
reason: "index option on counted_keyword was added in 8.13" | ||
|
||
- do: | ||
indices.create: | ||
index: test-events-no-index | ||
body: | ||
mappings: | ||
properties: | ||
events: | ||
type: counted_keyword | ||
index: false | ||
|
||
- do: | ||
index: | ||
index: test-events-no-index | ||
id: "1" | ||
body: { "events": [ "a", "a", "b" ] } | ||
|
||
|
||
- do: | ||
indices.refresh: { } | ||
|
||
--- | ||
"Counted keyword with index false is not searchable": | ||
- do: | ||
field_caps: | ||
index: test-events-no-index | ||
fields: [ events ] | ||
|
||
- match: { fields.events.counted_keyword.searchable: false } | ||
- match: { fields.events.counted_keyword.aggregatable: true } | ||
|
||
--- | ||
"Counted Terms agg only relies on doc values": | ||
# although the field is not indexed, the counted_terms agg should still work | ||
- do: | ||
search: | ||
index: test-events-no-index | ||
body: | ||
size: 0 | ||
aggs: | ||
event_terms: | ||
counted_terms: | ||
field: events | ||
|
||
- match: { aggregations.event_terms.buckets.0.key: "a" } | ||
- match: { aggregations.event_terms.buckets.0.doc_count: 2 } | ||
- match: { aggregations.event_terms.buckets.1.key: "b" } | ||
- match: { aggregations.event_terms.buckets.1.doc_count: 1 } | ||
- length: { aggregations.event_terms.buckets: 2 } |