You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Greg Miller (Jira)" <ji...@apache.org> on 2022/03/15 18:02:00 UTC

[jira] [Comment Edited] (LUCENE-10468) Do not always do checkField() in DocValues.getXXX(LeafReader, String)

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

Greg Miller edited comment on LUCENE-10468 at 3/15/22, 6:01 PM:
----------------------------------------------------------------

+1 to keeping the existing behavior. I appreciate the field checking done by the DocValues factory methods. It only throws if the field exists but was indexed with a different type, which likely indicates a user-initiated error.

Note that you can always use lower-level access by loading doc values directly from a LeafReader if you have some special use-case, or you can load FieldInfos and check those yourself as well. I've seen a few use-cases where this is useful, primarily optimizing the {{null}} case.


was (Author: gsmiller):
+1, I appreciate the field checking done by the DocValues factory methods. It only throws if the field exists but was indexed with a different type, which likely indicates a user-initiated error.

Note that you can always use lower-level access by loading doc values directly from a LeafReader if you have some special use-case, or you can load FieldInfos and check those yourself as well. I've seen a few use-cases where this is useful, primarily optimizing the {{null}} case.

> 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-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org