elasticsearch
elasticsearch copied to clipboard
Allow specifying field names for operators of range field types
Description
For example, currently for integer_range
field one has to provide such a value object:
"expected_attendees" : {
"gte" : 10,
"lt" : 20
}
I would propose that one could define for the field names for gte
, lt
, etc., operators. So that I could provide also:
"expected_attendees" : {
"min" : 10,
"max" : 20
}
Ideally, I could also have additional fields in the object, which would be ignored, but could be specified as fields for other indices, e.g.:
{
"name": "foobar",
"min_price": 10,
"max_price": 20
}
Pinging @elastic/es-search (Team:Search)
@mitar could you explain about the benefit of this enhancement? How would it help with your use case?
So my use case is that my incoming documents have min_price
and max_price
fields and I would like to index them to a range field. But currently this does not seem to be possible without modifying the structure of the document before indexing. This is a problem for me because I am using ES both as search engine and data store itself. So I would like to retain the original data structure and be able to index the range field.