tags:

views:

24

answers:

1

Let's say I have documents with two fields, A and B.

I'd like to use SOLR's MoreLikeThis, but with a twist: I'm most interested in bossting documents whose A field is like my model document's B field.

I don't see a way to use the mlt.fl fields or mlt.qf boosts to achieve this effect in a single query. Am I missing some option?

Or will I have to extract the 'interesting terms' myself and swap the 'field:term' details?

(Other ideas in this same vein appreciated as well.)

+1  A: 

Two options I see are:

  1. Use a copyField - index your original document with a copy of field A named B, and then query using B.
  2. Extend MoreLikeThisHandler and change the fields you query.

The first option costs a bit of programming (mostly configuration changes) and some memory consumption. The second involves more programming but no memory footprint increase. Hope one of them suits your needs.

Yuval F