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

Lu Xugang edited comment on LUCENE-10468 at 3/16/22, 7:55 AM:
--------------------------------------------------------------

checkField() originally designed for sorting/grouping since LUCENE-6064 which 
make sense, but in some DocValuesQueries like SortedNumericDocValuesRangeQuery, 
if field in query does not to be indexed with doc values but with other types, 
we should return empty instand of throwing exception?

So we could change the way to get DocIdSetIterator in 
SortedNumericDocValuesRangeQuery like DocValuesFieldExistsQuery did or supply a 
DocValues factory methods without checkField?


was (Author: chrislu):
checkField() originally designed for sorting/grouping since LUCENE-6064 which 
make sense, but in some DocValuesQueries like SortedNumericDocValuesRangeQuery, 
if field in query does not to be indexed with doc values, we should return 
empty instand of throwing exception?

So we could change the way to get DocIdSetIterator in 
SortedNumericDocValuesRangeQuery like DocValuesFieldExistsQuery did or supply a 
DocValues factory methods without checkField?

> Do not always do checkField() in DocValues.getXXX(LeafReader, String)
> ---------------------------------------------------------------------
>
>                 Key: LUCENE-10468
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10468
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Lu Xugang
>            Priority: Trivial
>         Attachments: 1.png
>
>
> IndexQuery can always get an empty result when field in Query does not exist 
> or even it was indexed with different FieldType.
> But when doing DocValuesQuery and field in such query does not exist, if this 
> field was not indexed by any other FieldType, DocValues query's behavior is 
> as the same as IndexQuery, otherwise it will throw a exception, because 
> getting a DocValuesIterator always do DocValues#checkField(...).
> I mean checkFIeld(...) is not needed if only do getting a DocValuesIterator, 
> and the exception's content is not friendly, so we can keep 'query result 
> consistency'?
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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

Reply via email to