I'm having a hard time understanding how the entries in the list are sorted. I would assume they're sorted alphabetically, but this still doesn't explain the behavior we're seeing.
Can you please explain how sorting works and if there's any workaround that we can leverage to have our entries sorted numerically ?
The highlighted entries in the image above have the same length, so even if they were sorted lexicographically I would expect them to be in order.
Before v8.7, the options list suggestions were always sorted descending by document count - i.e., the values that are most common in your data would show up at the top, descending from there. This is what you are currently seeing - this means that 104490 occurs more often than 106959 which occurs more than 101290, which is why you are seeing that ordering.
Once v8.7, is released, you will see that we added support for dynamic sorting - i.e. you will have the ability to sort by either document count or alphabetically, ascending or descending. Here's a quick little GIF of this in action:
Note that you might still get slightly unexpected results when selecting alphabetical sorting for a numeric string, as alphabetical sorting is doing a string comparison and not a numerical comparison. So, "10" is actually less than "2" because it's only comparing the first character of "10" and "1" < "2". This should be resolved once we had the ability to create options list controls on numeric fields
@hkhalil The planned release for v8.7 is in late March, 2023. Adding support for numeric fields is on our roadmap for v8.8 - you can keep track of the related issue here
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.