Op Thursday 14 February 2008 02:11:24 schreef Cedric Ho:
> I am using Lucene's Built-in query classes: TernQuery, PhraseQuery,
> WildcardQuery, BooleanQuery and many of the SpanQueries.
> 
> The info I am going to pass in is just some weightings for different
> part of the indexed contents. For example if the payload indicate that
> a term is in the 2nd paragraph, then I'll take the weighting for the
> 2nd paragraph and multiply it by the score.
> 
> So it seems without writing my own query there's no way to do it ?

In case it is only positional information that is stored in the payload
(i.e. some integer number that does not decrease when tokenizing the
document), it is also possible to use an extra field and make sure the
position increment for that field is only positive when the number
(currently your payload) increases.
A SpanFirstQuery on this extra field would almost do, and you will
probably need https://issues.apache.org/jira/browse/LUCENE-1093 .
This will be somewhat slower than using a payload, because the search
will be done in two separate fields, but it will work.

Regards,
Paul Elschot

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to