lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@apache.org>
Subject Re: How to pass additional information into Similarity.scorePayload(...)
Date Fri, 15 Feb 2008 12:49:11 GMT

On Feb 14, 2008, at 3:44 AM, Cedric Ho wrote:
>
> Anyway, I know my requirement is a bit strange, so it's ok if I can't
> do this in Lucene. I'll settle with using a ThreadLocal to store the
> [10/5/2] weighting and retrieve it in the Similarity.scorePayload(...)
> function.
>

I don't think you are still considering this, but I wanted to note  
that Similarity.scorePayload() is a call back function, just like the  
other methods on Similarity.  The only query that currently makes that  
callback is the BoostingTermQuery.  Essentially, the only queries that  
can use payloads are those that use position information when scoring,  
i.e. the SpanQuerys, of which the BoostingTQ is one.

The takeaway here, being, you can't retrieve the payload from the  
Similarity class.  You can only get payloads via the TermPositions  
object.

-Grant

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message