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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to