我在elastic-search 5中有一个文档,如下
{
  "_index": "my_index",
  "_type": "json",
  "_id": "document_id",
  "_score": 1,
  "_source": {
    "message": "{\"the_id\": \"custom_id\", \"more\": \"Data\"}",
    "type": "json",
    "the_id": "custom_id",
    "@timestamp": "2017-04-03T13:31:39.995Z",
    "port": 48038,
    "@version": "1",
    "host": "127.0.0.1"
  }
}
当我使用 Kibana 控制台查询_id时,如下所示,它工作正常并获取记录
 GET _search
{
  "query": { 
    "bool": { 
      "filter": [ 
        { "term":  { "_id": "document_id" }} 
      ]
    }
  }
}
但是,如果我查询 _source 级别字段(在本例中为the_id ),则不会得到任何结果。
 GET _search
{
  "query": { 
    "bool": { 
      "filter": [ 
        { "term":  { "the_id": "custom_id" }} 
      ]
    }
  }
}
如何确保我始终能够查询到 _source 级别。
| 归档时间: | 
 | 
| 查看次数: | 6454 次 | 
| 最近记录: |