You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Ravish Bhagdev <ra...@gmail.com> on 2012/03/02 01:12:51 UTC

Using MLT Handler to find similar documents but also filter similar documents by a keyword.

Hi,

Apologies if this has been answered before, I tried searching for it and
didn't find anything answering this exactly.

I want to find similar documents using MLT Handler using some specified
fields but I want to filter down the returned matches with some keywords as
well.

I looked at the example provided at
http://wiki.apache.org/solr/MoreLikeThisHandler :

/solr/mlt?q=id:SP2514N&mlt.fl=manu,cat&mlt.mindf=1&mlt.mintf=1&*
fq=inStock:true*&mlt.interestingTerms=details

which is specifying a filter query using fq to filter (something).

I understand that the first document returned as a result of query
(q=id:SP2514N) is used for performing the matching and fq actually affects
this result rather than the matched documents returned by MLT.  Am I right
or wrong?

That is the "fq" in above example going to filter the MLT match results by
the fq query or will it just affect the initial query to  get the first
document to match by?  If former, that is what I want to do, but is fq the
way to do it?  Can I use this fq on any kind of text/string field?

I hope my question is making sense, it is a bit hard to explain so I am
sorry if not!

Thanks,
Ravish

Fwd: Using MLT Handler to find similar documents but also filter similar documents by a keyword.

Posted by Ravish Bhagdev <ra...@gmail.com>.
I will appreciate any comments or help on this. Thanks.

Rav

---------- Forwarded message ----------
From: Ravish Bhagdev <ra...@gmail.com>
Date: Fri, Mar 2, 2012 at 12:12 AM
Subject: Using MLT Handler to find similar documents but also filter
similar documents by a keyword.
To: solr-user@lucene.apache.org


Hi,

Apologies if this has been answered before, I tried searching for it and
didn't find anything answering this exactly.

I want to find similar documents using MLT Handler using some specified
fields but I want to filter down the returned matches with some keywords as
well.

I looked at the example provided at
http://wiki.apache.org/solr/MoreLikeThisHandler :

/solr/mlt?q=id:SP2514N&mlt.fl=manu,cat&mlt.mindf=1&mlt.mintf=1&*
fq=inStock:true*&mlt.interestingTerms=details

which is specifying a filter query using fq to filter (something).

I understand that the first document returned as a result of query
(q=id:SP2514N) is used for performing the matching and fq actually affects
this result rather than the matched documents returned by MLT.  Am I right
or wrong?

That is the "fq" in above example going to filter the MLT match results by
the fq query or will it just affect the initial query to  get the first
document to match by?  If former, that is what I want to do, but is fq the
way to do it?  Can I use this fq on any kind of text/string field?

I hope my question is making sense, it is a bit hard to explain so I am
sorry if not!

Thanks,
Ravish