Class DateRangeQuery
- java.lang.Object
-
- com.couchbase.client.java.search.queries.AbstractFtsQuery
-
- com.couchbase.client.java.search.queries.DateRangeQuery
-
@Uncommitted @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 (inString
form) can be customized (seedateTimeParser(String)
).- Since:
- 2.3.0
- Author:
- Simon Baslé, Michael Nitschinger
-
-
Constructor Summary
Constructors Constructor Description DateRangeQuery()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DateRangeQuery
boost(double boost)
DateRangeQuery
dateTimeParser(String dateTimeParser)
The name of the date/time parser to use to interpretstart(String)
andend(String)
.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
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
field(String field)
protected void
injectParams(JsonObject input)
Override to inject query-specific parameters when doing theSearchQuery.export()
.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.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.-
Methods inherited from class com.couchbase.client.java.search.queries.AbstractFtsQuery
injectParamsAndBoost, toString
-
-
-
-
Method Detail
-
start
public DateRangeQuery start(String start, boolean inclusive)
Sets the lower boundary of the range, inclusive or not depending on the second parameter.
-
start
public DateRangeQuery start(String start)
Sets the lower boundary of the range. The lower boundary is considered inclusive by default on the server side.- See Also:
start(String, boolean)
-
end
public DateRangeQuery end(String end, boolean inclusive)
Sets the upper boundary of the range, inclusive or not depending on the second parameter.
-
end
public DateRangeQuery end(String end)
Sets the upper boundary of the range. The upper boundary is considered exclusive by default on the server side.- See Also:
end(String, boolean)
-
start
public DateRangeQuery start(Date start, boolean inclusive)
Sets the lower boundary of the range, inclusive or not depending on the second parameter. Works with aDate
object, which is converted to RFC 3339 format usingSearchUtils.toFtsUtcString(Date)
, so you shouldn't use a non-defaultdateTimeParser(String)
after that.
-
start
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 aDate
object, which is converted to RFC 3339 format usingSearchUtils.toFtsUtcString(Date)
, so you shouldn't use a non-defaultdateTimeParser(String)
after that.- See Also:
start(Date, boolean)
-
end
public DateRangeQuery end(Date end, boolean inclusive)
Sets the upper boundary of the range, inclusive or not depending on the second parameter. Works with aDate
object, which is converted to RFC 3339 format usingSearchUtils.toFtsUtcString(Date)
, so you shouldn't use a non-defaultdateTimeParser(String)
after that.
-
end
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 aDate
object, which is converted to RFC 3339 format usingSearchUtils.toFtsUtcString(Date)
, so you shouldn't use a non-defaultdateTimeParser(String)
after that.- See Also:
end(Date, boolean)
-
dateTimeParser
public DateRangeQuery dateTimeParser(String dateTimeParser)
The name of the date/time parser to use to interpretstart(String)
andend(String)
. Should not be modified when passing inDate
.
-
field
public DateRangeQuery field(String field)
-
boost
public DateRangeQuery boost(double boost)
- Overrides:
boost
in classAbstractFtsQuery
-
injectParams
protected void injectParams(JsonObject input)
Description copied from class:AbstractFtsQuery
Override to inject query-specific parameters when doing theSearchQuery.export()
.- Specified by:
injectParams
in classAbstractFtsQuery
- Parameters:
input
- the preparedJsonObject
that will represent the query.
-
-