: I have  an external system that indexes the data. 

: One field has a closed set of values, the values are sent as integer but 
: should be represented as String. EnumField is perfect for it. The 
: problem is that the values are predefined and not order sequentially 
: (the values were "spaced" for future growth). It looks like this:

The problem with what you are suggesting is that it completely overlooks 
the points rmuir made in SOLR-5084 about why the current version does 
*not* allow you to specify arbitrary numeric values: keeping the enum 
values adjacent -- and keeping the numeric values small -- makes the 
indexed terms very compact and improves both the index size and query 
perforamnce.  you really don't want to let the ordinal values in the index 
be sparse.

If your indexing client is providing values like "1000", "1500", "2000" 
etc... but you don't care about those values and want to map them to 
labels like "a", "b", "c", etc... then there is really no advantage to 
using the original numeric values under the covers in the index.

It would make more sense to have an UpdateProcessor that handled the 
mappings of 1000=>a, 1500=>b, etc... and let EnumField work as it 
currently does automaticly picking sequential (dense) numeric values.


-Hoss
http://www.lucidworks.com/

Reply via email to