|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.search.Query org.apache.lucene.search.similar.MoreLikeThisQuery
public class 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 | |
---|---|
MoreLikeThisQuery(String likeText,
String[] moreLikeFields,
Analyzer analyzer)
Deprecated. use MoreLikeThisQuery(String, String[], Analyzer, String) instead. |
|
MoreLikeThisQuery(String likeText,
String[] moreLikeFields,
Analyzer analyzer,
String fieldName)
|
Method Summary | |
---|---|
Analyzer |
getAnalyzer()
|
String |
getLikeText()
|
int |
getMaxQueryTerms()
|
int |
getMinDocFreq()
|
int |
getMinTermFrequency()
|
String[] |
getMoreLikeFields()
|
float |
getPercentTermsToMatch()
|
Set<?> |
getStopWords()
|
Query |
rewrite(IndexReader reader)
Expert: called to re-write queries into primitive queries. |
void |
setAnalyzer(Analyzer analyzer)
|
void |
setLikeText(String likeText)
|
void |
setMaxQueryTerms(int maxQueryTerms)
|
void |
setMinDocFreq(int minDocFreq)
|
void |
setMinTermFrequency(int minTermFrequency)
|
void |
setMoreLikeFields(String[] moreLikeFields)
|
void |
setPercentTermsToMatch(float percentTermsToMatch)
|
void |
setStopWords(Set<?> stopWords)
|
String |
toString(String field)
Prints a query to a string, with field assumed to be the
default field and omitted. |
Methods inherited from class org.apache.lucene.search.Query |
---|
clone, combine, createWeight, equals, extractTerms, getBoost, getSimilarity, hashCode, mergeBooleanQueries, setBoost, toString, weight |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
@Deprecated public MoreLikeThisQuery(String likeText, String[] moreLikeFields, Analyzer analyzer)
MoreLikeThisQuery(String, String[], Analyzer, String)
instead.
public MoreLikeThisQuery(String likeText, String[] moreLikeFields, Analyzer analyzer, String fieldName)
moreLikeFields
- Method Detail |
---|
public Query rewrite(IndexReader reader) throws IOException
Query
rewrite
in class Query
IOException
public String toString(String field)
Query
field
assumed to be the
default field and omitted.
The representation used is one that is supposed to be readable
by QueryParser
. However,
there are the following limitations:
toString
in class Query
public float getPercentTermsToMatch()
public void setPercentTermsToMatch(float percentTermsToMatch)
public Analyzer getAnalyzer()
public void setAnalyzer(Analyzer analyzer)
public String getLikeText()
public void setLikeText(String likeText)
public int getMaxQueryTerms()
public void setMaxQueryTerms(int maxQueryTerms)
public int getMinTermFrequency()
public void setMinTermFrequency(int minTermFrequency)
public String[] getMoreLikeFields()
public void setMoreLikeFields(String[] moreLikeFields)
public Set<?> getStopWords()
public void setStopWords(Set<?> stopWords)
public int getMinDocFreq()
public void setMinDocFreq(int minDocFreq)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |