Package org.apache.solr.handler
Class MoreLikeThisHandler.MoreLikeThisHelper
java.lang.Object
org.apache.solr.handler.MoreLikeThisHandler.MoreLikeThisHelper
- Enclosing class:
MoreLikeThisHandler
Helper class for MoreLikeThis that can be called from other request handlers
-
Constructor Summary
ConstructorsConstructorDescriptionMoreLikeThisHelper(org.apache.solr.common.params.SolrParams params, SolrIndexSearcher searcher) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.search.BooleanQueryorg.apache.lucene.search.BooleanQuerygetBoostedMLTQuery(int docNum) SetsboostedMLTQueryand returns itgetInterestingTerms(org.apache.lucene.search.BooleanQuery boostedMLTQuery, int maxTerms) Yields terms with boosts from the boosted MLT query.org.apache.lucene.queries.mlt.MoreLikeThisgetMoreLikeThis(int id, int start, int rows, List<org.apache.lucene.search.Query> filters, int flags) getMoreLikeThis(Reader reader, int start, int rows, List<org.apache.lucene.search.Query> filters, int flags) org.apache.lucene.search.Queryorg.apache.lucene.search.Query
-
Constructor Details
-
MoreLikeThisHelper
public MoreLikeThisHelper(org.apache.solr.common.params.SolrParams params, SolrIndexSearcher searcher) throws IOException - Throws:
IOException
-
-
Method Details
-
getRawMLTQuery
public org.apache.lucene.search.Query getRawMLTQuery() -
getBoostedMLTQuery
public org.apache.lucene.search.BooleanQuery getBoostedMLTQuery() -
getRealMLTQuery
public org.apache.lucene.search.Query getRealMLTQuery() -
getMoreLikeThis
public DocListAndSet getMoreLikeThis(int id, int start, int rows, List<org.apache.lucene.search.Query> filters, int flags) throws IOException - Throws:
IOException
-
getBoostedMLTQuery
SetsboostedMLTQueryand returns it- Throws:
IOException
-
getMoreLikeThis
public DocListAndSet getMoreLikeThis(Reader reader, int start, int rows, List<org.apache.lucene.search.Query> filters, int flags) throws IOException - Throws:
IOException
-
getInterestingTerms
public List<MoreLikeThisHandler.InterestingTerm> getInterestingTerms(org.apache.lucene.search.BooleanQuery boostedMLTQuery, int maxTerms) Yields terms with boosts from the boosted MLT query.- Parameters:
maxTerms- how many terms to return, a negative value means all terms are returned
-
getMoreLikeThis
public org.apache.lucene.queries.mlt.MoreLikeThis getMoreLikeThis()
-