[
https://issues.apache.org/jira/browse/LUCENE-6226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14312157#comment-14312157
]
Alan Woodward commented on LUCENE-6226:
---------------------------------------
So for the PhraseScorers, if the caller doesn't need positions, it just passes
in PostingsEnum.FLAG_NONE. PhraseWeight itself checks to see if frequencies
are asked for in the passed in postings flags to set it's own needsScores
parameter, and then adds in FLAG_POSITIONS when it pulls it's child scorers.
{code}
public PhraseWeight(IndexSearcher searcher, int postingsFlags)
throws IOException {
super(PhraseQuery.this);
this.postingsFlags = postingsFlags | PostingsEnum.FLAG_POSITIONS;
this.needsScores = (postingsFlags & PostingsEnum.FLAG_FREQS) != 0;
{code}
If that's too confusing, then maybe createWeight should have separate
needsScores and postingsFlags parameters?
> 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]