0
votes

I put a mapping into ES as followed:

curl -XPOST http://localhost:9200/developer/document/_mapping -d '
{
      "document" : {
        "properties" : {
          "content" : {
            "type" : "string",
            "analyzer": "ik_max_word",
            "search_analyzer": "ik_max_word",
            "copy_to":"single_word_content"
          },
          "ID" : {
            "type" : "string"
          },
          "title" : {
            "type" : "string",
            "analyzer": "ik_max_word",
            "search_analyzer": "ik_max_word",
            "copy_to":"single_word_content"
          },
          "single_word_content":{
            "type": "string",
            "analyzer":"standard",
           }
        }
    }
}'

Then I insert a document without single_word_content field into ES. When I search from ES, no single_word_content field returned in the search results & highlight not working on single_word_content field either

1

1 Answers

0
votes

There is an important note ES documentation about this.

The original _source field will not be modified to show the copied values.

You can check the documentation. This note is valid for 5.0. So, you can specifically indicate your copy fields to get back in your search result.