@InterfaceStability.Experimental @InterfaceAudience.Public public class DateRangeQuery extends AbstractFtsQuery
A FTS query that matches documents on a range of dates. At least one bound is required, and the parser to use for the date (in String
form) can be customized (see dateTimeParser(String)
).
Constructor and Description |
---|
DateRangeQuery() |
Modifier and Type | Method and Description |
---|---|
DateRangeQuery |
boost(double boost) |
DateRangeQuery |
dateTimeParser(String dateTimeParser)
The name of the date/time parser to use to interpret
start(String) and end(String) . |
DateRangeQuery |
end(Date end)
Sets the upper boundary of the range.
|
DateRangeQuery |
end(Date end,
boolean inclusive)
Sets the upper boundary of the range, inclusive or not depending on the second parameter.
|
DateRangeQuery |
end(String end)
Sets the upper boundary of the range.
|
DateRangeQuery |
end(String end,
boolean inclusive)
Sets the upper boundary of the range, inclusive or not depending on the second parameter.
|
DateRangeQuery |
field(String field) |
protected void |
injectParams(JsonObject input)
Override to inject query-specific parameters when doing the
SearchQuery.export() . |
DateRangeQuery |
start(Date start)
Sets the lower boundary of the range.
|
DateRangeQuery |
start(Date start,
boolean inclusive)
Sets the lower boundary of the range, inclusive or not depending on the second parameter.
|
DateRangeQuery |
start(String start)
Sets the lower boundary of the range.
|
DateRangeQuery |
start(String start,
boolean inclusive)
Sets the lower boundary of the range, inclusive or not depending on the second parameter.
|
injectParamsAndBoost, toString
public DateRangeQuery start(String start, boolean inclusive)
Sets the lower boundary of the range, inclusive or not depending on the second parameter.
public DateRangeQuery start(String start)
Sets the lower boundary of the range. The lower boundary is considered inclusive by default on the server side.
start(String, boolean)
public DateRangeQuery end(String end, boolean inclusive)
Sets the upper boundary of the range, inclusive or not depending on the second parameter.
public DateRangeQuery end(String end)
Sets the upper boundary of the range. The upper boundary is considered exclusive by default on the server side.
end(String, boolean)
public DateRangeQuery start(Date start, boolean inclusive)
Sets the lower boundary of the range, inclusive or not depending on the second parameter.
Works with a Date
object, which is converted to RFC 3339 format using SearchUtils.toFtsUtcString(Date)
, so you shouldn’t use a non-default dateTimeParser(String)
after that.
public DateRangeQuery start(Date start)
Sets the lower boundary of the range. The lower boundary is considered inclusive by default on the server side.
Works with a Date
object, which is converted to RFC 3339 format using SearchUtils.toFtsUtcString(Date)
, so you shouldn’t use a non-default dateTimeParser(String)
after that.
start(Date, boolean)
public DateRangeQuery end(Date end, boolean inclusive)
Sets the upper boundary of the range, inclusive or not depending on the second parameter.
Works with a Date
object, which is converted to RFC 3339 format using SearchUtils.toFtsUtcString(Date)
, so you shouldn’t use a non-default dateTimeParser(String)
after that.
public DateRangeQuery end(Date end)
Sets the upper boundary of the range. The upper boundary is considered exclusive by default on the server side.
Works with a Date
object, which is converted to RFC 3339 format using SearchUtils.toFtsUtcString(Date)
, so you shouldn’t use a non-default dateTimeParser(String)
after that.
end(Date, boolean)
public DateRangeQuery dateTimeParser(String dateTimeParser)
The name of the date/time parser to use to interpret start(String)
and end(String)
. Should not be modified when passing in Date
.
public DateRangeQuery field(String field)
public DateRangeQuery boost(double boost)
boost
in class AbstractFtsQuery
protected void injectParams(JsonObject input)
AbstractFtsQuery
Override to inject query-specific parameters when doing the SearchQuery.export()
.
injectParams
in class AbstractFtsQuery
input
- the prepared JsonObject
that will represent the query.Copyright © 2015 Couchbase, Inc.