My query is like:
query: {
filtered: {
filter: {
bool: {
must: [
range: {price: {gte: 222, lte: 1000}},
term: {city: Adana}
]
}
}
}
}
It returns empty result. But doing same using uri search (_search?q=city:Adana
gives correct result.
Giving multiple range queries, like latitude and price works, but adding term fails.
What can be problem here?
Try this:
query: {
filtered: {
filter: {
bool: {
must: [
{ range: {price: {gte: 222, lte: 1000}} },
{ term: {city: Adana} }
]
}
}
}
}
Here is some code I used to test it:
http://sense.qbox.io/gist/7a4811d00e562f4d41e252ae5084ec78fa23d80f
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With