|
| | geo_bounding_box_query (geo_point top_left, geo_point bottom_right) |
| | Create a new geo bounding box query.
|
| | geo_bounding_box_query (double top_left_latitude, double top_left_longitude, double bottom_right_latitude, double bottom_right_longitude) |
| | Create a new geo distance query.
|
| auto | field (std::string field_name) -> geo_bounding_box_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).
|
This query finds all geo_point indexed matches within a given area (identified by the list of geo_point coordinates).
Each of the pairs is taken to indicate one corner of a polygon. Documents are returned if they reference a location within the area of the polygon.
The following query-body uses an array of geo_point to specify the latitude and longitude of each of the corners of a polygon, known as polygon points. Here, the last-specified entry is identical to the initial, thus explicitly closing the box. However, specifying an explicit closure in this way is optional: the closure will be inferred by the Couchbase Server if not explicitly specified.
auto query = couchbase::geo_bounding_box_query(couchbase::geo_point{ 53.482358, -2.235143 },
couchbase::geo_point{ 40.991862, 28.955043 })
.field("geo");
- See also
- https://docs.couchbase.com/server/current/fts/fts-supported-queries-geo-bounded-rectangle.html server documentation
- Since
- 1.0.0
- Committed
- Generally available API and should be preferred in production