ElasticSearch学习

文章40 |   阅读 18150 |   点赞0

来源:https://blog.csdn.net/ywl470812087/category_9621251.html

elasticsearch控制返回字段查询三(英文分词)match查询

x33g5p2x  于2021-12-19 转载在 其他  
字(0.6k)|赞(0)|评价(0)|浏览(453)

**#_source指定查询返回的字段信息 **

#_source指定查询返回的字段信息
GET /lib3/user/_search
{
  "from":0, 
  "size": 2, 
  "_source": ["address" , "name"] ,
  "query": {
    "match": {"interests": "changge"}
  }
}

#includes查询返回字段包含name address
#excludes查询返回字段不包含age birthday

#includes查询返回字段包含name address
#excludes查询返回字段不包含age birthday
GET /lib3/user/_search
{
  "from":0, 
  "size": 2, 
  "query": {
    "match_all": {}
  },
  "_source": {
      "includes": ["name" , "address"] ,
      "excludes": ["age","birthday"]
  }
}

相关文章