To specify that a field should not be indexed in an Elasticsearch index mapping, you can use the index property with a value of false. For example, suppose you have a mapping for an index called my_index, and you want to include a field called my_field that should not be indexed. You can define the mapping like this:
PUT my_index |
In this mapping, the my_field field is defined as a text field with the index property set to false. This tells Elasticsearch not to index the field, which means that it will not be searchable.
Note that if you set a field’s index property to false, you will not be able to search for that field’s values using Elasticsearch’s search API. However, you can still retrieve the field’s values from Elasticsearch using the get API.
If you are using python do do the indxing, notice that, in Python, the value for index should be False (with a capital “F”), not false. Here is the corrected example:
from elasticsearch import Elasticsearch |