I have a problem with Elasticsearch
The following json values work in my local server but not in the remote server.
ERROR:query doesn't support multiple fields, found [date] and [price]
post.json
{
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "product:DESKTOP"
}
},
{
"range": {
"date": {
"gt": "2018-04-24",
"lte": "2018-06-24"
},
"price": {
"gt": 0,
"lte": 2000
}
}
}
]
}
},
"from": 10,
"size": 200 }
Where do I mistake? Thank you for answers
You can only specify one field per range
query.
Try including two separate range
queries. They'll be AND'd together, since they both show up in your must
clause.
{
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "product:DESKTOP"
}
},
{
"range": {
"date": {
"gt": "2018-04-24",
"lte": "2018-06-24"
}
}
},
{
"range": {
"price": {
"gt": 0,
"lte": 2000
}
}
}
]
}
},
"from": 10,
"size": 200
}
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