简体   繁体   中英

How to specify fields which should not be indexed in ElasticSearch

How do I specify the fields in ElasticSearch which I do not want to be indexed? I read this SO question but I didn't understand its answers.

Your mapping should be something like this:

"index_name": {
  "mappings": {
    "type_name": {
      "mappings": {
        "properties": {
          "unsearchable_field_name": {
            "index": "no"
          }
        }
      }
    }
  }
}

Notice that unsearchable_field_name still may to be stored (depends on your dynamic mapping config, take a look into Dynamic Mapping ), but by setting index: no , Elasticsearch ignores this field on search requests.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM