lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Busch <>
Subject Re: [jira] Commented: (LUCENE-834) Payload Queries
Date Thu, 19 Apr 2007 18:27:15 GMT
Grant Ingersoll wrote:
> OK, I need to take a step back, Michael, b/c I thought I understood 
> your original comment, but I went to make the change and am no longer 
> sure.
>   By "first term position" are you referring to multiple terms per 
> position or do you mean the same term in different positions?  When I 
> implemented the BTQ (BoostingTermQuery) I modeled it pretty much off 
> of the SpanTermQuery (STQ) which I felt had very similar 
> functionality, other than having to load the payload.
> Doesn't the next() method on the BoostingSpanScorer take care of 
> moving through the various positions that the term appears at, 
> whereupon it loads the payload at the position?  Could you write up a 
> patch to the test to demonstrate?
> Thanks,
> Grant


I mean the case when the same term has multiple positions in a document. 
In you call (from SpanScorer), 
which calls SpanScorer.setFreqCurrentDoc(). This method iterates through 
all spans for the current doc via So 
is the actual method which calls TermPositions.nextPosition(). This 
means when returns it has iterated through all 
positions of that doc already. Then you load the payload, which means 
that you only get the payload of the first term position of the next 
(the wrong!) document in the term's posting list.

Your testcase does not show this behavior, because the term you search 
for only appears once at most in each document. And since all payloads 
of the term you search for have the same value, the testcase doesn't 
fail even though it loads the payloads of the wrong documents for scoring.

- Michael

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message