ElasticsearchDSL
ElasticsearchDSL copied to clipboard
Some queries should support multiple fields
I have tested range query and found out that it works with multiple fields (tested with ES 2.1.1). This library does not support that.
Example:
{
"range": {
"price": {
"gt": 50
},
"title": {
"gt": "ccc"
}
}
}
Currently if you want to achieve something like that using our library you need to create two range
queries and put them into bool
.
We should check how many queries support multiple fields and think how we could add support for it.
Edit: prefix
and regexp
queries also supports multiple fields (tested on ES 2.1.1).
Hi @mvar , I've been checking out these and some other queries on this functionality and in reality it seems that there are quite a few queries that can accept multiple fields, however, that does not mean that they work correctly with them. My tests show that if multiple fields are provided to these queries the results will come out only for the last field that was specified, that is if i would have such a query:
{
"query": {
"range": {
"age": {
"gte": 30,
"lte": 40
},
"price": {
"gte": 10,
"lte": 30
}
}
}
}
I would only get results for price
and the age
field would be ignored.
@einorler I think in such case you should open issue in Elasticsearch repository.
https://github.com/elastic/elasticsearch/issues/19547