Hi all,

I am the one that contributed EnumField code to Solr.
There was a long discussion how the integer values of an enum field should be 
indicated in the configuration.
It was decided that the integer value wouldn't be written explicitly, but would 
be implicitly determined by the value order.
For example:
<enum name="severity">
        <value>Not Available</value>
        <value>Low</value>
        <value>Medium</value>
        <value>High</value>
        <value>Critical</value>
</enum> 
"Not Available" will get the value 0, "Low" will get 1 and so on.

I have a use case where this configuration does not meet my needs. 
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:
    <enum name="myField">
        <pair name="a" value="1000"/>
        <pair name="b" value="1500"/>
        <pair name="c" value="2000"/>
        <pair name="d" value="2500"/>
        <pair name="e" value="3000"/>
    </enum>

So I think we have to be able to indicate the integer values of an EnumField in 
the configuration.
What do you think?

Thanks.

Reply via email to