mirror of https://github.com/apache/lucene.git
Added a few accessors.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150213 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3f3c0aa917
commit
de9099fb72
|
@ -69,6 +69,9 @@ public class PrefixQuery extends Query {
|
|||
this.prefix = prefix;
|
||||
}
|
||||
|
||||
/** Returns the prefix of this query. */
|
||||
public Term getPrefix() { return prefix; }
|
||||
|
||||
public Query rewrite(IndexReader reader) throws IOException {
|
||||
BooleanQuery query = new BooleanQuery();
|
||||
TermEnum enumerator = reader.terms(prefix);
|
||||
|
@ -113,4 +116,5 @@ public class PrefixQuery extends Query {
|
|||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -153,11 +153,21 @@ public class RangeQuery extends Query
|
|||
return Query.mergeBooleanQueries(queries);
|
||||
}
|
||||
|
||||
private String getField()
|
||||
{
|
||||
return (lowerTerm != null ? lowerTerm.field() : upperTerm.field());
|
||||
/** Returns the field name for this query */
|
||||
public String getField() {
|
||||
return (lowerTerm != null ? lowerTerm.field() : upperTerm.field());
|
||||
}
|
||||
|
||||
/** Returns the lower term of this range query */
|
||||
public Term getLowerTerm() { return lowerTerm; }
|
||||
|
||||
/** Returns the upper term of this range query */
|
||||
public Term getUpperTerm() { return upperTerm; }
|
||||
|
||||
/** Returns <code>true</code> if the range query is inclusive */
|
||||
public boolean isInclusive() { return inclusive; }
|
||||
|
||||
|
||||
/** Prints a user-readable version of this query. */
|
||||
public String toString(String field)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue