[
https://issues.apache.org/jira/browse/LUCENE-6226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14312125#comment-14312125
]
Adrien Grand commented on LUCENE-6226:
--------------------------------------
+1
The documentation says that -1 will be returned if positions were not indexed.
Maybe it should rather say something like if positions are not "available" or
"implemented" so that users are not surprised that eg. boolean queries always
return -1 right now even if you index positions?
Something that should not prevent the patch from being committed but worries me
a bit is how the flags work. I understand they are not powers of two since we
want POSITIONS (3) to implicitely enable FREQS (1) or OFFSETS and PAYLOADS (7
and 11) to implicitely enable POSITIONS (3). But on the other hand, I think
this is a bit error-prone. For instance if I'm reviewing a patch and see
something like "if ((flags & POSITIONS) != 0) // then consider positions", I
would not see the bug although the if condition would be true if flags=FREQS.
Maybe our APIs should rather take something like IndexOptions instead of an int
flag? If I understand correctly, the only thing that it would prevent is that
you could not have payloads without offsets, but maybe it's not a big deal?
> Allow TermScorer to expose positions, offsets and payloads
> ----------------------------------------------------------
>
> Key: LUCENE-6226
> URL: https://issues.apache.org/jira/browse/LUCENE-6226
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Alan Woodward
> Assignee: Alan Woodward
> Fix For: Trunk, 5.1
>
> Attachments: LUCENE-6226.patch, LUCENE-6226.patch, LUCENE-6226.patch,
> LUCENE-6226.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]