[ 
https://issues.apache.org/jira/browse/SOLR-5084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13734266#comment-13734266
 ] 

Robert Muir commented on SOLR-5084:
-----------------------------------

{quote}
For sorting and value sources etc... nothing special happens – they still have 
the same numeric value under the covers; it's just that when writing out the 
"stored" values (ie: label) you act as if they have no value in the field at 
all (shouldn't affect efficiency at all.)
{quote}

Then this is just renaming a label to some special value.

I really think the best thing is to keep it simple, like java.lang.Enum. Just 
give a list of values. This way it will be efficient everywhere since the 
values will be dense. Its also conceptually simple.

Otherwise, things get complicated. and the implementation may suffer due to 
sparse "ordinals". Really, i dont care, as docvalues will do the right thing as 
long as you have < 256 values (regardless of sparsity). Fieldcache wont, but 
doesn't bother me a bit.

But still, there is no sense in making things complicated and inefficient for 
no good reason. Someone could make a HairyComplicatedAndInefficientEnumType for 
that.
                
> new field type - EnumField
> --------------------------
>
>                 Key: SOLR-5084
>                 URL: https://issues.apache.org/jira/browse/SOLR-5084
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Elran Dvir
>         Attachments: enumsConfig.xml, schema_example.xml, Solr-5084.patch, 
> Solr-5084.patch
>
>
> We have encountered a use case in our system where we have a few fields 
> (Severity. Risk etc) with a closed set of values, where the sort order for 
> these values is pre-determined but not lexicographic (Critical is higher than 
> High). Generically this is very close to how enums work.
> To implement, I have prototyped a new type of field: EnumField where the 
> inputs are a closed predefined  set of strings in a special configuration 
> file (similar to currency.xml).
> The code is based on 4.2.1.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to