Couchbase C++ SDK 1.0.4 (rev. 5355b0f)
Loading...
Searching...
No Matches
geo_bounding_box_query Class Reference

This query finds all geo_point indexed matches within a given area (identified by the list of geo_point coordinates). More...

#include <couchbase/geo_bounding_box_query.hxx>

Inheritance diagram for geo_bounding_box_query:
Inheritance graph

Public Member Functions

 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
 
- Public Member Functions inherited from search_query
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).
 

Additional Inherited Members

- Protected Member Functions inherited from search_query
 search_query ()=default
 
- Protected Attributes inherited from search_query
std::optional< double > boost_ {}
 

Detailed Description

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.

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

Constructor & Destructor Documentation

◆ geo_bounding_box_query() [1/2]

geo_bounding_box_query ( geo_point top_left,
geo_point bottom_right )
inline

Create a new geo bounding box query.

Parameters
top_leftthe top left coordinates signify the bounding box area
bottom_rightthe bottom right coordinates signify the bounding box area
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ geo_bounding_box_query() [2/2]

geo_bounding_box_query ( double top_left_latitude,
double top_left_longitude,
double bottom_right_latitude,
double bottom_right_longitude )
inline

Create a new geo distance query.

Parameters
top_left_latitudelatitude of the top left coordinate
top_left_longitudelongitude of the top left coordinate
bottom_right_latitudelatitude of the bottom right coordinate
bottom_right_longitudelatitude of the bottom right coordinate
Since
1.0.0
Committed
Generally available API and should be preferred in production

Member Function Documentation

◆ encode()

auto encode ( ) const -> encoded_search_query
nodiscardoverridevirtual
Returns
encoded representation of the query.
Since
1.0.0
Internal
Internal interface

Implements search_query.

◆ field()

auto field ( std::string field_name) -> geo_bounding_box_query&
inline

If a field is specified, only terms in that field will be matched.

Parameters
field_namename of the field to be matched
Returns
this query for chaining purposes.
Since
1.0.0
Committed
Generally available API and should be preferred in production

The documentation for this class was generated from the following file: