Adrien Grand a91b3fcbb9 Move the murmur3 field to a plugin and fix defaults.
This move the `murmur3` field to the `mapper-murmur3` plugin and fixes its
defaults so that values will not be indexed by default, as the only purpose
of this field is to speed up `cardinality` aggregations on high-cardinality
string fields, which only requires doc values.

I also removed the `rehash` option from the `cardinality` aggregation as it
doesn't bring much value (rehashing is cheap) and allowed to remove the
coupling between the `cardinality` aggregation and the `murmur3` field.

Close #12874
2015-08-18 11:41:52 +02:00

66 lines
1.3 KiB
YAML

# Integration tests for Mapper Murmur3 components
#
---
"Mapper Murmur3":
- do:
indices.create:
index: test
body:
mappings:
type1: { "properties": { "foo": { "type": "string", "fields": { "hash": { "type": "murmur3" } } } } }
- do:
index:
index: test
type: type1
id: 0
body: { "foo": null }
- do:
indices.refresh: {}
- do:
search:
body: { "aggs": { "foo_count": { "cardinality": { "field": "foo.hash" } } } }
- match: { aggregations.foo_count.value: 0 }
- do:
index:
index: test
type: type1
id: 1
body: { "foo": "bar" }
- do:
index:
index: test
type: type1
id: 2
body: { "foo": "baz" }
- do:
index:
index: test
type: type1
id: 3
body: { "foo": "quux" }
- do:
index:
index: test
type: type1
id: 4
body: { "foo": "bar" }
- do:
indices.refresh: {}
- do:
search:
body: { "aggs": { "foo_count": { "cardinality": { "field": "foo.hash" } } } }
- match: { aggregations.foo_count.value: 3 }