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

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

{quote}
As long as the config forces them to be explicit about the values (and has 
error checking at startup that the values start a "0" and are monotomicly 
increasing ints) then anyone who wants to "insert" values into their config is 
going to have to pause and think about the fact that there is a concrete int 
associated with the existing values – and is more likely to realize that 
changing those ints has consequences.
{quote}

If the values are implicitly 0, 1, 2, ... n, then why force the user to write 
that out? 

If you are worried about idiot users, add a comment around the field type to 
the example:

{code}
<!-- note: you cannot change the order/existing values without reindexing.
     but you can always add new values to the end. -->
{code}

Otherwise it just makes the configuration overly verbose to have them write 
0..n themselves.
                
> 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, Solr-5084.patch, Solr-5084.patch, Solr-5084.trunk.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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to