how to filter and sort a field with entries of different version numbers in Elasticsearch documents?
For example different documents contain the field version with entries like "10.0", "10.1.5", "9" or "23.932.01".
How can a "greater than" search be done by entering a version number. By default Elasticsearch saves the data as string. Simple conversion to a number is not possible due to the different formats.
Is there a similar data structure as the data type ip to represent version numbers?
thanks for your answer. Unfortunately I didn't find a way to narrow down the search in Elasticsearch by using the DSL syntax and a range filter. (The Range filter does not work with string fields.)
Or do you think I should use the datatype ip here? Unfortunately I am limited in the formatting of the version numbers again.
A data can be indexed in several ways at the same time by using copy_to and appropriate data type and analyse. For instance as a string for sorting and filtering and as text in order to tokenized. You can also imagine split the field in 4 distinct numeric or keyword fields.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.