Yes, it is easily doable through "Payload" facility. During indexing process
(mainly tokenization), you need to push this extra information in each
token. And then you can use BoostingTermQuery for using Payload value to
include Payload in the score. You also need to implement Similarity for this
(mainly scorePayload method).

Other way can be to extend SpanTermQuery, this already calculates the
position of match. You just need to do something to use this position value
in the score calculation.

One possible advantage of SpanTermQuery approach is that you can play
around, without re-creating indices everytime.

Thanks,
Shailendra Sharma,
CTO, Ver se' Innovation Pvt. Ltd.
Bangalore, India

On 8/1/07, Cedric Ho <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I was wondering if it is possible to do boosting by search terms'
> position in the document.
>
> for example:
> search terms appear in the first 100 words, or first 10% words, or in
> first two paragraphs would be given higher score.
>
> Is it achievable through using the new Payload function in lucene 2.2?
> Or are there any easier ways to achieve these ?
>
>
> Regards,
> Cedric
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to