You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2007/09/18 02:40:08 UTC
[Solr Wiki] Update of "MoreLikeThisHandler" by HossMan
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by HossMan:
http://wiki.apache.org/solr/MoreLikeThisHandler
New page:
The [http://lucene.apache.org/solr/api/org/apache/solr/handler/MoreLikeThisHandler.html MoreLikeThisHandler] is designed to generate information about "similar" documents using the MoreLikeThis functionality provided by Lucene. It supports faceting, paging, and filtering using CommonQueryParameters.
<!> ["Solr1.3"]
[[TableOfContents(3)]]
== Params ==
|| '''param''' || '''description''' ||
|| 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 ||
The MoreLikeThisHandler can also use a ContentStream to find similar documents. It will extract the "interesting terms" from the posted text.
== Examples ==
=== 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.displayTerms=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.displayTerms=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.displayTerms=list&mlt.mintf=0
----
CategorySolrRequestHandler