【问题标题】:Retrieve all metadata fields of a document in the search - elastic search在搜索中检索文档的所有元数据字段 - 弹性搜索
【发布时间】:2022-12-17 21:04:09
【问题描述】:

我正在尝试检索文档在 elasticsearch 中的所有元数据字段。有没有办法强制查询将它们全部显示在搜索结果中?

ex:

GET /search-test/_search
{
"fields": ["_id","_doc_count","_field_names","_ignored","_index","_meta"],
   "query": {
    "bool":{
    "must":[
        {"match" : { "_id":"11085" }}
      ]
  }
  }
}

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    你试过在source字段上使用*吗?

    GET /search-test/_search
    {
      "source": ["*"],
      "query": {
        "bool": {
          "must": [
            {"match" : { "_id":"11085" }}
          ]
        }
      }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-06-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-12
      • 2017-09-01
      • 2017-07-01
      • 2015-12-18
      相关资源
      最近更新 更多