mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-14 17:05:36 +00:00
This commit brings the benefits of the `count` search type to search requests that have a `size` of 0: - a single round-trip to shards (no fetch phase) - ability to use the query cache Since `count` now provides no benefits over `query_then_fetch`, it has been deprecated. Close #7630
34 lines
561 B
YAML
34 lines
561 B
YAML
---
|
|
"search_type=count (deprecated) support":
|
|
- do:
|
|
indices.create:
|
|
index: test
|
|
- do:
|
|
index:
|
|
index: test
|
|
type: test
|
|
id: 1
|
|
body: { foo: bar }
|
|
|
|
- do:
|
|
index:
|
|
index: test
|
|
type: test
|
|
id: 2
|
|
body: { foo: bar }
|
|
|
|
- do:
|
|
indices.refresh:
|
|
index: [test]
|
|
|
|
- do:
|
|
search:
|
|
index: test
|
|
search_type: count
|
|
body:
|
|
query:
|
|
match:
|
|
foo: bar
|
|
|
|
- match: {hits.total: 2}
|