ES突出显示未在结果中显示

时间:2016-05-04 22:13:13

标签: elasticsearch highlight

有人可以告诉我为什么这些字段不会显示在我的ES结果中(在highlight object内),当我知道我索引到ES的某些网站有这些特定HTML的内容时元素?

字段的ES映射

"metatag.description": {
    "type": "multi_field",
      "fields": {
        "metatag.description": {
          "type": "string",
          "index": "not_analyzed",
          "include_in_all": false
        },
        "autocomplete": {
          "type": "string",
          "index_analyzer": "autocomplete_analyzer",
          "search_analyzer": "whitespace_analyzer"
        }
      }
  },
  "metatag.keywords": {
    "type": "multi_field",
      "fields": {
        "metatag.keywords": {
          "type": "string",
          "index": "not_analyzed",
          "include_in_all": false
        },
        "autocomplete": {
          "type": "string",
          "index_analyzer": "autocomplete_analyzer",
          "search_analyzer": "whitespace_analyzer"
      }
    }
  },

仅出于某种原因" title.autocomplete"在结果中?

这是我的疑问:

    GET /hugetestindex/doc/_search
{
  "query": {
    "match": {
      "_all": {
        "query": "ford mu",
        "operator": "and"
      }
    }
  },
  "highlight": {
    "fields": {
      "title.autocomplete": {
        "pre_tags" : ["<em>"],
        "post_tags" : ["</em>"],
        "number_of_fragments": 10,
        "fragment_size": 300
      },
      "metatags.keywords.autocomplete": {
        "pre_tags" : ["<em>"],
        "post_tags" : ["</em>"],
        "number_of_fragments": 10,
        "fragment_size": 300
      },
      "metatags.description.autocomplete": {
        "pre_tags" : ["<em>"],
        "post_tags" : ["</em>"],
        "number_of_fragments": 10,
        "fragment_size": 300
      }
    }
  }
}

我哪里错了?

0 个答案:

没有答案