![](/img/trans.png)
[英]How can I write "select * from users where username ='kuldeep' and (status = 'active' OR status = 'inactive' )" in elastic with exact search?
[英]I want to fetch data from elasticsearch based on status, If status is active I want to fetch data could you help me to write an elastic query?
我想根據狀態從彈性搜索中獲取數據,如果狀態是活動的,我想獲取數據你能幫我寫一個彈性查詢嗎?
GET /customer-fr/_search
{"query":{
"bool":{
"must":{
"match_all":{}
},
"filter":{
"bool":{
"must":[{
"status" : "In-Active"
}]}
}}}
您不需要為此進行range
查詢。 像這樣的簡單term
查詢應該可以工作:
{
"query": {
"bool": {
"filter": {
"term": {
"status": "In-Active"
}
}
}
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.