com.lucene.search
Class PrefixQuery
java.lang.Object
|
+--com.lucene.search.Query
|
+--com.lucene.search.PrefixQuery
- public final class PrefixQuery
- extends Query
A Query that matches documents containing terms with a specified prefix.
Constructor Summary |
PrefixQuery(Term prefix)
Constructs a query for terms starting with prefix . |
Method Summary |
float |
getBoost()
Returns the boost for this term. |
void |
setBoost(float boost)
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 |
PrefixQuery
public PrefixQuery(Term prefix)
- Constructs a query for terms starting with
prefix
.
setBoost
public void setBoost(float boost)
- Sets the boost for this term to
b
. Documents containing
this term will (in addition to the normal weightings) have their score
multiplied by boost
.
getBoost
public float getBoost()
- Returns the boost for this term.
toString
public String toString(String field)
- Prints a user-readable version of this query.
- Overrides:
toString
in class Query