开发者

Limiting the output from MoreLikeThis in Solr

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


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜