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

Robert Muir commented on SOLR-2671:
-----------------------------------

{quote}
It's not a valid value on the enum, but it is seems like it should be a valid 
value indicating that no IndexOptions should be used 
(AbstractField.setIndexOptions doesn't seem to reject null as valid input)

Either that or there should be an explicit IndexOptions.NONE value (which kind 
of makes me wonder why we have both FieldInfos.IndexOptions and Field.Index ... 
seems like maybe they should be one Class with setters for the optional parts)
{quote}

{quote}
better docs on IndexOptions / AbstractField about null not being a valid value 
for IndexOptions (unless i've convinced you that it should be)
{quote}

I don't think we should do any of this.
This thing is totally expert, and labeled as such.
Its used in the lowest level postings readers and other performance critical 
places.
I don't think it should be made friendly, and I don't think we need null checks 
anywhere in lucene code that takes it.

If we want the Solr SchemaField stuff to use something more friendly, then it 
shouldn't use this IndexOptions enum at all, and instead use its own system 
internally and convert to it at the last minute.


> SchemaField.indexOptions() should return null if SchemaField.indexed() 
> returns false
> ------------------------------------------------------------------------------------
>
>                 Key: SOLR-2671
>                 URL: https://issues.apache.org/jira/browse/SOLR-2671
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>             Fix For: 3.4, 4.0
>
>
> It doesn't make sense for SchemaField.indexOptions() to return any of the 
> values from the IndexOptions enum if the field is not going to be indexed at 
> all.
> we should return null to prevent missleading any code that calls that method

--
This message is automatically generated by JIRA.
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