-
Notifications
You must be signed in to change notification settings - Fork 24.3k
/
20_no_index.yml
54 lines (45 loc) · 1.34 KB
/
20_no_index.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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 }