Couchbase C++ SDK 1.0.2 (rev. 51f4775)
Loading...
Searching...
No Matches
geo_polygon_query Class Reference

A search query which allows to match inside a geo polygon. More...

#include <couchbase/geo_polygon_query.hxx>

Inheritance diagram for geo_polygon_query:
Inheritance graph

Public Member Functions

 geo_polygon_query (std::vector< geo_point > points)
 Create a new geo polygon query.
 
auto field (std::string field_name) -> geo_polygon_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

A search query which allows to match inside a geo polygon.

If a target data-location falls within the box, its document is returned.

auto query =
couchbase::geo_point{ 37.79393211306212, -122.44234633404847 },
couchbase::geo_point{ 37.77995881733997, -122.43977141339417 },
couchbase::geo_point{ 37.788031092020155, -122.42925715405579 },
couchbase::geo_point{ 37.79026946582319, -122.41149020154114 },
couchbase::geo_point{ 37.79571192027403, -122.40735054016113 },
couchbase::geo_point{ 37.79393211306212, -122.44234633404847 },
})
.field("geo");
See also
https://docs.couchbase.com/server/current/fts/fts-supported-queries-geo-bounded-polygon.html server documentation
Since
1.0.0
Committed
Generally available API and should be preferred in production

Constructor & Destructor Documentation

◆ geo_polygon_query()

geo_polygon_query ( std::vector< geo_point > points)
inlineexplicit

Create a new geo polygon query.

Parameters
pointsthe points specifying corners of geo polygon.
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_polygon_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: