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

#_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"]
  }
}

发布了298 篇原创文章 · 获赞 107 · 访问量 14万+

猜你喜欢

转载自blog.csdn.net/ywl470812087/article/details/104876419