The date range query finds documents containing a date value in the specified field within the specified range.
More...
|
auto | start (std::chrono::system_clock::time_point value) -> date_range_query & |
| Set lower limit and automatically format so that default date_time parser will be able to parse it on the server.
|
|
auto | start (std::tm value) -> date_range_query & |
| Set lower limit and automatically format so that default date_time parser will be able to parse it on the server.
|
|
auto | start (std::chrono::system_clock::time_point value, bool inclusive) -> date_range_query & |
| Set lower limit and automatically format so that default date_time parser will be able to parse it on the server.
|
|
auto | start (std::tm value, bool inclusive) -> date_range_query & |
| Set lower limit and automatically format so that default date_time parser will be able to parse it on the server.
|
|
auto | start (std::string value) -> date_range_query & |
| Set preformatted date as lower limit.
|
|
auto | start (std::string value, bool inclusive) -> date_range_query & |
| Set preformatted date as lower limit.
|
|
auto | end (std::chrono::system_clock::time_point value) -> date_range_query & |
| Set upper limit and automatically format so that default date_time parser will be able to parse it on the server.
|
|
auto | end (std::tm value) -> date_range_query & |
| Set upper limit and automatically format so that default date_time parser will be able to parse it on the server.
|
|
auto | end (std::chrono::system_clock::time_point value, bool inclusive) -> date_range_query & |
| Set upper limit and automatically format so that default date_time parser will be able to parse it on the server.
|
|
auto | end (std::tm value, bool inclusive) -> date_range_query & |
| Set upper limit and automatically format so that default date_time parser will be able to parse it on the server.
|
|
auto | end (std::string value) |
| Set preformatted date as upper limit.
|
|
auto | end (std::string value, bool inclusive) -> date_range_query & |
| Set preformatted date as upper limit.
|
|
auto | date_time_parser (std::string parser_name) -> date_range_query & |
| Enable custom date parser.
|
|
auto | field (std::string field_name) -> date_range_query & |
| If a field is specified, only terms in that field will be matched.
|
|
auto | encode () const -> encoded_search_query override |
|
virtual | ~search_query ()=default |
|
template<typename derived_query = search_query, std::enable_if_t< std::is_base_of_v< search_query, derived_query >, bool > = true> |
auto | boost (double boost) -> derived_query & |
| The boost parameter is used to increase the relative weight of a clause (with a boost greater than 1) or decrease the relative weight (with a boost between 0 and 1).
|
|
The date range query finds documents containing a date value in the specified field within the specified range.
Either start or end can be omitted, but not both.
Match documents where field review_date
falls within the range ("2001-10-09T10:20:30-08:00", "2016-10-31")
.start("2001-10-09T10:20:30-08:00", false)
.end("2016-10-31", false);
It also works with std::tm
and std::chrono::system_clock::time_point
.
std::tm start_tm{};
start_tm.tm_year = 2001 - 1900;
start_tm.tm_mon = 9;
start_tm.tm_mday = 9;
start_tm.tm_hour = 10;
start_tm.tm_min = 20;
start_tm.tm_sec = 30;
std::tm end_tm{};
end_tm.tm_year = 2001 - 1900;
end_tm.tm_mon = 9;
end_tm.tm_mday = 31;
- See also
- https://docs.couchbase.com/server/current/fts/fts-supported-queries-date-range.html server documentation.
- Since
- 1.0.0
- Committed
- Generally available API and should be preferred in production