lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Busch <busch...@gmail.com>
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
>

Grant,

I mean the case when the same term has multiple positions in a document. 
In BoostingSpanScorer.next() you call super.next() (from SpanScorer), 
which calls SpanScorer.setFreqCurrentDoc(). This method iterates through 
all spans for the current doc via TermSpans.next(). So TermSpans.next() 
is the actual method which calls TermPositions.nextPosition(). This 
means when SpanScorer.next() 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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message