Hi, > find me the 10 most similar documents
I suppose you mean "mlt.count" supported by MoreLikeThisComponent. https://cwiki.apache.org/confluence/display/solr/MoreLikeThis MLT is ordinary search in Lucene, so you get documents in order of similarity (default scoring criteria) and can limit result size by "n" parameter. (With "mlt.count", however, Solr gets all possible docs, re-sorts and truncates the list to merge and de-duplicate sharded results.) > created in the last month I wonder about solr supports such filtering for MLT, but with lucene, you can specify Filters when you call search() method. Just for information, here is the snippet. MoreLikeThis mlt = new MoreLikeThis( ... ); mlt.setFieldNames( ... ); mlt.setAnalyzer( ... ); Query mltQuery = mlt.like( ... ) Filter filter = ... TopDocs hits = searcher.search(mltQuery, filter, 10) // filter and limit size Regards Tomoko 2015-01-08 19:45 GMT+09:00 chrisbamford <chrisbamf...@chrisbamford.plus.com> : > Hi, > > I was wondering if Lucene supports applying a filter to an MLT search? I > believe that Solr can do it, but I'm not sure if Lucene can .. > > A possible use case is "find me the 10 most similar documents to X created > in the last month". > > Thanks > > - Chris > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >