FAQ
Hi All,

I am not sure if any one got chance to go over my question (below).

The question was to check if I can modify MoreLikeThis.like() result
using index time boosting.

I have found a work around as there is no easy way to influence MoreLikeThis
result using index time payload value.

The work around is to write class similar to MoreLikeThis (can not extend
this call as it is final) and in the createQuery method of MoreLikeThis
class change the Query class from TermQuery to PayloadTermQuery.

Change:
TermQuery tq = new TermQuery(new Term((String) ar[1], (String) ar[0]));

To:
Term payloadTerm = new Term((String) ar[1], (String) ar[0]);
Query tq = new PayloadTermQuery(payloadTerm, new AveragePayloadFunction());

Thats it, rest of the MoreLikeThis code stays the same :)

With this change, I could boost my MoreLikeThis result with the payload
value setup at the index time

If any one has any better thoughts, I would be glad to hear about them

Thanks

Saurabh


On Tue, May 10, 2011 at 1:36 PM, Saurabh Gokhale
wrote:
Hi,

In the Lucene 2.9.4 project, there is a requirement to boost some of the
keywords in the document using payload.

Now while searching, is there a way I can boost the MoreLikeThis result
using the index time payload values?

Or can I merge MoreLikeThis output and PayloadTermQuery output somehow to
get the final percentage output?

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedMay 12, '11 at 5:00a
activeMay 12, '11 at 5:00a
posts1
users1
websitelucene.apache.org

1 user in discussion

Saurabh Gokhale: 1 post

People

Translate

site design / logo © 2021 Grokbase