[
https://issues.apache.org/jira/browse/LUCENE-10468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17507399#comment-17507399
]
Adrien Grand commented on LUCENE-10468:
---------------------------------------
I agree that there is inconsistency between doc-values-based queries, which
would fail if the field is not indexed with the right doc-value-type, and
term-based queries, which would leniently return no match when used against a
field that e.g. only indexes doc values. But if we want to change one, I'd
rather change term-based queries to be less lenient. I can't think of a single
case when this leniency would be desired? It makes total sense to me to return
empty results when the field does *not* exist. But if it exists and is not
indexed correctly, it's better to fail?
> 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: [email protected]
For additional commands, e-mail: [email protected]