public class DateRangeQuery extends AbstractFieldQuery
Query
testing a date range.Query.LogicalOperator, Query.Operator
Modifier and Type | Field and Description |
---|---|
protected Date |
_from
The lower end of the date range.
|
protected boolean |
_includeFrom
True to include the lower end, false to exclude it.
|
protected boolean |
_includeTo
True to include the upper end, false to exclude it.
|
protected Date |
_to
The upper end of the date range.
|
_fieldPath
Constructor and Description |
---|
DateRangeQuery(String fieldPath,
Date from,
Date to)
Build a date range query.
|
DateRangeQuery(String fieldPath,
Date from,
Date to,
boolean includeFrom,
boolean includeTo)
Build a date range query.
|
Modifier and Type | Method and Description |
---|---|
String |
build()
Build the solr query string representing the Query object.
|
getFieldPath
protected boolean _includeFrom
protected boolean _includeTo
public DateRangeQuery(String fieldPath, Date from, Date to)
fieldPath
- The field path.from
- The lower end of the range.to
- The upper end of the range.public DateRangeQuery(String fieldPath, Date from, Date to, boolean includeFrom, boolean includeTo)
fieldPath
- The field path.from
- The lower end of the range.to
- The upper end of the range.includeFrom
- Whether to include the lower end or not.includeTo
- Whether to include the upper end or not.public String build() throws QuerySyntaxException
Query
QuerySyntaxException
- if the query can't be built because of a syntax error.