lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <>
Subject Re: [jira] Commented: (LUCENE-834) Payload Queries
Date Thu, 19 Apr 2007 18:47:13 GMT
OK, I see it now.  I was thinking I was scoring that individual term  
at that position, but if I had read the Scorer documentation better  
instead of assuming I knew what it meant I wouldn't have had this  
problem, as it clearly says it advances the document.

I will try to fix it by the end of this weekend.

Thanks for the review.

On Apr 19, 2007, at 2:27 PM, Michael Busch wrote:

> 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 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:

Grant Ingersoll
Center for Natural Language Processing

Read the Lucene Java FAQ at 

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

View raw message