我已推送下面的JSON文档
{
"Apartment_Area": "marathahali",
"Apartment_bhk": "2bhk",
"Apartment_owner": "praveen",
"Apartment_forSale": "sold_out"
}
{
"Apartment_Area": "kadugodi",
"Apartment_bhk": "1bhk",
"Apartment_owner": "praveen",
"Apartment_forSale": "for_sale"
}
现在我尝试使用下面的查询从弹性搜索中搜索1bhk和2 bhk,它给了我1 bhk和2 bhk的JSON数据。
/ _搜索漂亮&安培; Q = 1bhk,2bhk
现在我正在尝试使用名称1 bhk
获取Praveen
,这意味着我只想查看1 bhk
名称为Praveen
的数据
对此任何想法的查询是什么?在此先感谢:)
答案 0 :(得分:1)
Elasticsearch有很好的文档,请查看文档here:
尝试使用以下正文POST
至/_search?pretty
:
{
"query" : {
"constant_score" : {
"filter" : {
"terms" : {
"Apartment_bhk" : ["1bhk", "2bhk"]
}
}
}
}
}