Using mappings to define a field as non-searchable in Elasticsearch You may have noticed that Elasticsearch automatically tries to index all of the fields given to it. However, sometimes you will find that you want to just store a field without indexing it.

In Elasticsearch, defining settings and mappings that determine how fields should be analysed is done using Index Templates.

PUT my_index {"mappings": {"doc": {"properties": {"title": {"type": "text"}, "name": {"type": "text"}, "age": {"type": "integer"} }} }} We can see that title will be a text field, name will also be a text field and age will be an integer field.

Related Articles