5

I'm trying to use MoreLikeThis to get all similar documents but not documents with a specific contenttype.

So the first query needs to find the one document that I want to get "More Like This" of - and the second query needs to limit the similar documents to not be pdf's (-contenttype:pdf)

Does anyone know if this is possible?

Thanks

javanna
  • 59,145
  • 14
  • 144
  • 125
Svenn
  • 111
  • 2
  • 5

1 Answers1

6

When using the MoreLikeThisHandler, all the common parameters applied to the mlt results set. So you can use the fq parameter to exclude your pdf documents from the mlt results:

http://localhost:8983/solr/mlt?q=test&mlt.fl=text&fq=-contenttype:pdf

The q parameter allows to select the document to generate mlt results (actually, it's the first document matching the initial query that is used).

Pascal Dimassimo
  • 6,908
  • 1
  • 37
  • 34
  • Hey - Im using the /select handler and then apply &mlt params to it. That way the fq relates to the select of the document that i want to find more-like-this from. Im using SolrNet for this and I dont think that there is a way to use the mlt-handler on its own... – Svenn Nov 26 '10 at 09:16