lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@apache.org>
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.
-Grant

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

--------------------------
Grant Ingersoll
Center for Natural Language Processing
http://www.cnlp.org

Read the Lucene Java FAQ at http://wiki.apache.org/jakarta-lucene/ 
LuceneFAQ



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