The MoreLikeThisHandler is designed to generate information about "similar" documents using the MoreLikeThis functionality provided by Lucene. It supports faceting, paging, and filtering using CommonQueryParameters.

(warning) Solr1.3

Params

param

description

rows

Use this to control the number of results returned, instead of the mlt.count option normally used with the MoreLikeThis search component.

mlt.match.include

Should the response include the matched document? If false, the response will look exactly like a normal /select response

mlt.match.offset

By default, the MoreLikeThis query operates on the first result for 'q'

mlt.interestingTerms

One of: "list", "details", "none" – this will show what "interesting" terms are used for the MoreLikeThis query. These are the top tf/idf terms. NOTE: if you select 'details', this shows you the term and boost used for each term. Unless mlt.boost=true all terms will have boost=1.0

See MoreLikeThis for additional input parameters.

The MoreLikeThisHandler can also use a ContentStream to find similar documents. It will extract the "interesting terms" from the posted text.

Examples

The following example URLs assume that the MoreLikeThisHandler is configured with the name "/mlt" ...

  <requestHandler name="/mlt" class="solr.MoreLikeThisHandler">
  </requestHandler>

Simple

http://localhost:8983/solr/mlt?q=id:UTF8TEST&mlt.fl=manu,cat&mlt.mindf=1&mlt.mintf=1

http://localhost:8983/solr/mlt?q=id:UTF8TEST&mlt.fl=manu,cat&mlt.mindf=1&mlt.mintf=1&mlt.match.include=false

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

Using ContentStreams

If you post text in the body, that will be used for similarity. Alternatively, you can put the posted content in the URL using something like:

http://localhost:8983/solr/mlt?stream.body=electronics%20memory&mlt.fl=manu,cat&mlt.interestingTerms=list&mlt.mintf=0

If remoteStreaming is enabled, you can find documents similar to the text on a webpage:

http://localhost:8983/solr/mlt?stream.url=http://lucene.apache.org/solr/&mlt.fl=manu,cat&mlt.interestingTerms=list&mlt.mintf=0


CategorySolrRequestHandler

  • No labels