Elasticsearch es查询结果只返回指定筛选字段_source

参考:https://www.exception.site/elasticsearch/elasticsearch-query-custom-columns

1、查询特别值查询,结果只返回指定字段

*** 只返回title、channel结果;下列两种语法方式都可以

{
  "_source": [
    "title",
    "channel"
  ],
  "query": {
   "term": {"aid": "cfxa***253i1y"}
  }
}
{
  "_source": [
    "title",
    "channel"
  ],
  "query": {
    "query_string": {
      "default_field": "aid",
      "query": "cfx***53i1y"
    }
  }
}

2、查询全部数据,结果只返回指定字段

{
  "_source": [
    "title",
    "channel"
  ],
  "query": {
    "match_all": { }
  }
}

你可能感兴趣的:(知识点,数据挖掘,es)