Package org.apache.lucene.queries.mlt
Class MoreLikeThisQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.queries.mlt.MoreLikeThisQuery
A simple wrapper for MoreLikeThis for use in scenarios where a Query object is required eg in
custom QueryParser extensions. At query.rewrite() time the reader is used to construct the actual
MoreLikeThis object and obtain the real Query object.
-
Constructor Summary
ConstructorsConstructorDescriptionMoreLikeThisQuery(String likeText, String[] moreLikeFields, Analyzer analyzer, String fieldName) -
Method Summary
Modifier and TypeMethodDescriptionbooleanintintintString[]floatSet<?> inthashCode()rewrite(IndexSearcher indexSearcher) voidsetAnalyzer(Analyzer analyzer) voidsetLikeText(String likeText) voidsetMaxQueryTerms(int maxQueryTerms) voidsetMinDocFreq(int minDocFreq) voidsetMinTermFrequency(int minTermFrequency) voidsetMoreLikeFields(String[] moreLikeFields) voidsetPercentTermsToMatch(float percentTermsToMatch) voidsetStopWords(Set<?> stopWords) voidvisit(QueryVisitor visitor) Methods inherited from class org.apache.lucene.search.Query
classHash, createWeight, sameClassAs, toString
-
Constructor Details
-
Method Details
-
rewrite
- Overrides:
rewritein classQuery- Throws:
IOException
-
toString
-
getPercentTermsToMatch
public float getPercentTermsToMatch() -
setPercentTermsToMatch
public void setPercentTermsToMatch(float percentTermsToMatch) -
getAnalyzer
-
setAnalyzer
-
getLikeText
-
setLikeText
-
getMaxQueryTerms
public int getMaxQueryTerms() -
setMaxQueryTerms
public void setMaxQueryTerms(int maxQueryTerms) -
getMinTermFrequency
public int getMinTermFrequency() -
setMinTermFrequency
public void setMinTermFrequency(int minTermFrequency) -
getMoreLikeFields
-
setMoreLikeFields
-
getStopWords
-
setStopWords
-
getMinDocFreq
public int getMinDocFreq() -
setMinDocFreq
public void setMinDocFreq(int minDocFreq) -
hashCode
public int hashCode() -
equals
-
visit
-