Exclude a field on a Elasticsearch query

前端 未结 2 1427
悲哀的现实
悲哀的现实 2021-01-21 06:03

Having the following mapping:

curl -XPUT \'localhost:9200/testidx?pretty=true\' -d \'{
  \"mappings\": {
    \"items\": {
       \"dynamic\": \"strict\",
                


        
2条回答
  •  南方客
    南方客 (楼主)
    2021-01-21 06:12

    Up to elasticsearch 6.0.0 you can set "include_in_all": false to your index field properties, see e.g. https://www.elastic.co/guide/en/elasticsearch/reference/5.5/include-in-all.html.

    (This of course needs a reindexing of the data.)

提交回复
热议问题