Whenever I attempt to add a range filter to a "number" result field, the resultant query takes my input (a double) and converts to a string.
Example:
Flutter end
ElasticAppSearch(...)
.engine('example')
.query('')
.filter('price',
isGreaterThanOrEqualTo: 80.0, isLessTan: 100.0);
.get();
Request as displayed in Kibana
{
"query": "",
"page": {
"size": 20,
"current": 1
},
"filters": {
"all": [
{
"price": {
"from": "80.0",
"to": "100.0"
}
}
],
"none": [],
"any": []
}
}
Response
{
"errors": [
"Filters 'from' must be a number for field: price",
"Filters 'to' must be a number for field: price"
]
}
I would also like to note that if the input is changed to an int value, then null is produced for the price filter section of the query.
Example:
Flutter end
ElasticAppSearch(...)
.engine('example')
.query('')
.filter('price',
isGreaterThanOrEqualTo: 80, isLessTan: 100);
.get();
Request as displayed in Kibana
{
"query": "",
"page": {
"size": 20,
"current": 1
},
"filters": {
"all": [
{
{
"price": null
}
}
],
"none": [],
"any": []
}
}
Response
{
"errors": [
"Filters contains invalid value for field: price; must be a number, an array of numbers, or a range object with `to` and/or `from` keys"
]
}
I tried to debug this in your src code, but it does seem you are casting "from" and "to" as double. I'm not sure what the issue is. Is there something I'm missing on my end? Otherwise great package, very useful in my case :)