| 1234567891011121314151617181920212223242526272829303132333435363738394041 | [[mapping-analyzer-field]]=== `_analyzer`The `_analyzer` mapping allows to use a document field property as thename of the analyzer that will be used to index the document. Theanalyzer will be used for any field that does not explicitly defines an`analyzer` or `index_analyzer` when indexing.Here is a simple mapping:[source,js]--------------------------------------------------{    "type1" : {        "_analyzer" : {            "path" : "my_field"        }    }}--------------------------------------------------The above will use the value of the `my_field` to lookup an analyzerregistered under it. For example, indexing the following doc:[source,js]--------------------------------------------------{    "my_field" : "whitespace"}--------------------------------------------------Will cause the `whitespace` analyzer to be used as the index analyzerfor all fields without explicit analyzer setting.The default path value is `_analyzer`, so the analyzer can be driven fora specific document by setting the `_analyzer` field in it. If a custom jsonfield name is needed, an explicit mapping with a different path shouldbe set.By default, the `_analyzer` field is indexed, it can be disabled bysettings `index` to `no` in the mapping.
 |