com.lucene.search
Class TermQuery
java.lang.Object
|
+--com.lucene.search.Query
|
+--com.lucene.search.TermQuery
- public final class TermQuery
- extends Query
A Query that matches documents containing a term.
This may be combined with other terms with a BooleanQuery
.
Constructor Summary |
TermQuery(Term t)
Constructs a query for the term t . |
Method Summary |
float |
getBoost()
Gets the boost for this term. |
void |
setBoost(float b)
Sets the boost for this term to b . |
String |
toString(String field)
Prints a user-readable version of this query. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TermQuery
public TermQuery(Term t)
- Constructs a query for the term
t
.
setBoost
public void setBoost(float b)
- Sets the boost for this term to
b
. Documents containing
this term will (in addition to the normal weightings) have their score
multiplied by b
.
getBoost
public float getBoost()
- Gets the boost for this term. Documents containing
this term will (in addition to the normal weightings) have their score
multiplied by
b
. The boost is 1.0 by default.
toString
public String toString(String field)
- Prints a user-readable version of this query.
- Overrides:
toString
in class Query