Hi

I would extend SpanFirstQuery instead of using payloads. You can accept, 
discard and advance the position before finally accepting. For each advance you 
can decrease the boost, or discard of it is too far away from first position.

Cheers,
Markus




Summer Shire <shiresum...@gmail.com> schreef:Hi All,

I have a scenario where for example my document titles are 
1. battle of the zords
2. joes battle
3. who was in that crazy battle.

and if the search term is [battle]
I want to penalize the second and third document score because battle was 
matched further down than in the first documents case.

One way I can do this is store the title field and then retrieve the data at 
query time -  compute the relative position of the token 
- and use it in my custom scorer.
But this is not just extremely slow but also my index is huge.

So I am planning to index payloads along with each token which will be some 
value relative to the term position in the original string.
and then use the payload information along with any other scoring i have.

Am I thinking on the right lines? is there anything better that i could do ?

Thanks
Summer



Reply via email to