How to remove field display in elastic search

I have an index with the following display

{ "testmap": { "mappings": { "user": { "properties": { "plans": { "type": "nested", "properties": { "user": { "type": "long" } } }, "status": { "type": "integer" } } } } } } 

I want to remove the display of status fields. I do not mind losing data in this area. Is it possible to delete the status field. I tried

 curl -XDELETE http://192.168.2.2:9200/testmap/user/status {"found":false,"_index":"testmap","_type":"user","_id":"status","_version":1 

Your help is greatly appreciated. Thanks.

+5
source share
2 answers

You cannot remove the status field from this mapping. If you really need to get rid of this field, you will need to create another mapping without the status field and reindex your data. Take a look at this answer .

+4
source

If you just need to change the type of mapping in the status field, you cannot delete it, but you can change it to the multi_field type, which indexes this field with several sets of parameters.

Old data will not be indexed in the new field, but index queries will move forward. In some use cases, this is a worthy alternative for "deleting the index and creating a new one with a new mapping."

https://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/mapping-multi-field-type.html

+2
source

Source: https://habr.com/ru/post/1214712/


All Articles