Class FlattenedFieldMapper

java.lang.Object
org.elasticsearch.index.mapper.Mapper
org.elasticsearch.index.mapper.FieldMapper
org.elasticsearch.index.mapper.flattened.FlattenedFieldMapper
All Implemented Interfaces:
Cloneable, Iterable<Mapper>, ToXContent, ToXContentFragment

public final class FlattenedFieldMapper extends FieldMapper
A field mapper that accepts a JSON object and flattens it into a single field. This data type can be a useful alternative to an 'object' mapping when the object has a large, unknown set of keys. Currently the mapper extracts all leaf values of the JSON object, converts them to their text representations, and indexes each one as a keyword. It creates both a 'keyed' version of the token to allow searches on particular key-value pairs, as well as a 'root' token without the key As an example, given a flattened field called 'field' and the following input { "field": { "key1": "some value", "key2": { "key3": true } } } the mapper will produce untokenized string fields with the name "field" and values "some value" and "true", as well as string fields called "field._keyed" with values "key\0some value" and "key2.key3\0true". Note that \0 is used as a reserved separator character (see FlattenedFieldParser.SEPARATOR).