在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/Java  Python/ elasticsearch高亮不生效

elasticsearch高亮不生效

es5.5, 高亮沒(méi)有生效,例子是照搬官方文檔的,但返回結(jié)果沒(méi)有highlight字段,是不是某些設(shè)置問(wèn)題? https://www.elastic.co/guide/...

GET /1266/default_type/_search
{
  "query" : {
    "match" : {
      "_all" : "who"
    }
  },
  "highlight": {
        "fields" : {
            "_all" : {}
        }
  }
}

返回

{
  "took": 50,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 1000,
    "max_score": 0.002578699,
    "hits": [
      {
        "_index": "1266",
        "_type": "default_type",
        "_id": "8",
        "_score": 0.002578699,
        "_source": {
          "object_id": "8",
          "film_id": 8,
          "title": "AIRPORT POLLOCK",
          "description": "A Epic Tale of a Moose And a Girl who must Confront a Monkey in Ancient India",
          "release_year": 2006,
          "language_id": 1,
          "original_language_id": null,
          "rental_duration": 6,
          "rental_rate": "4.99",
          "length": 54,
          "replacement_cost": "15.99",
          "rating": "R",
          "special_features": "Trailers",
          "last_update": "2006-02-15 05:03:42"
        }
      },
回答
編輯回答
心夠野

你的高亮字段不可以設(shè)置為_all

In order to perform highlighting, the actual content of the field is required. If the field in question is stored (has store set to true in the mapping) it will be used, otherwise, the actual _source will be loaded and the relevant field will be extracted from it.
The _all field cannot be extracted from _source, so it can only be used for highlighting if it mapped to have store set to true.

關(guān)聯(lián)地址

意思是說(shuō),這個(gè)位置高亮查詢不可以對(duì)_all進(jìn)行查詢,只允許對(duì)指定字段進(jìn)行高亮。

2018年8月8日 20:41