[ https://issues.apache.org/jira/browse/LUCENE-6271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14395077#comment-14395077 ]
Robert Muir commented on LUCENE-6271: ------------------------------------- As ryan mentioned in the email list, this one needs to be in 5.1 or we can never fix it without a tricky semantics-only change. I will help get this in, ive been hammering tests at it the last few days and I'm satisfied there. We added lots of tests that will get tested across all codecs (including older ones) so we know there aren't sneaky bugs. Basically, this is what we are saving our users from. Please just give me a few hours for each branch. > PostingsEnum should have consistent flags behavior > -------------------------------------------------- > > Key: LUCENE-6271 > URL: https://issues.apache.org/jira/browse/LUCENE-6271 > Project: Lucene - Core > Issue Type: Bug > Reporter: Ryan Ernst > Assignee: Robert Muir > Fix For: 5.1 > > Attachments: LUCENE-6271.patch, LUCENE-6271.patch > > > When asking for flags like OFFSETS or PAYLOADS with DocsAndPositionsEnum, the > behavior was to always return an enum, even if offsets or payloads were not > indexed. They would just not be available from the enum if they were not > present. This behavior was carried over to PostingsEnum, which is good. > However, the new POSITIONS flag has different behavior. If positions are not > available, null is returned, instead of a PostingsEnum that just gives access > to freqs. This behavior is confusing, as it means you have to special case > asking for positions (only ask if you know they were indexed) which sort of > defeats the purpose of the unified PostingsEnum. > We should make POSITIONS have the same behavior as other flags. The trickiest > part will be maintaining backcompat for DocsAndPositionsEnum in 5.x, but I > think it can be done. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org