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

Sorts by a field in the hits. More...

#include <couchbase/search_sort_field.hxx>

Inheritance diagram for search_sort_field:
Inheritance graph

Public Member Functions

 search_sort_field (std::string field)
 
 search_sort_field (std::string field, bool descending)
 
auto descending (bool desc) -> search_sort_field &
 Set the sorting direction.
 
auto type (search_sort_field_type value) -> search_sort_field &
 Specifies the type of the search-order field value.
 
auto mode (search_sort_field_mode value) -> search_sort_field &
 Specifies the search-order for index-fields that contain multiple values (in consequence of arrays or multi-token analyzer-output).
 
auto missing (search_sort_field_missing value) -> search_sort_field &
 Specifies the sort-procedure for documents with a missing value in a field specified for sorting.
 
auto encode () const -> encoded_search_sort override
 
- Public Member Functions inherited from search_sort
virtual ~search_sort ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from search_sort
 search_sort ()=default
 
 search_sort (bool descending)
 
- Protected Attributes inherited from search_sort
std::optional< bool > descending_ {}
 

Detailed Description

Constructor & Destructor Documentation

◆ search_sort_field() [1/2]

search_sort_field ( std::string field)
inlineexplicit

◆ search_sort_field() [2/2]

search_sort_field ( std::string field,
bool descending )
inline

Member Function Documentation

◆ descending()

auto descending ( bool desc) -> search_sort_field &

Set the sorting direction.

Parameters
desctrue for descending order, false for ascending
Returns
pointer to this
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ encode()

auto encode ( ) const -> encoded_search_sort
nodiscardoverridevirtual
Returns
encoded representation of the search facet.
Since
1.0.0
Internal
Internal interface

Implements search_sort.

◆ missing()

auto missing ( search_sort_field_missing value) -> search_sort_field &

Specifies the sort-procedure for documents with a missing value in a field specified for sorting.

The value of missing can be search_sort_field_missing::first, in which case results with missing values appear before other results; or search_sort_field_missing::last (the server default), in which case they appear after.

Parameters
valuestrategy for missing values
Returns
pointer to this
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ mode()

auto mode ( search_sort_field_mode value) -> search_sort_field &

Specifies the search-order for index-fields that contain multiple values (in consequence of arrays or multi-token analyzer-output).

The default order is undefined but deterministic, allowing the paging of results, with reliable ordering. To sort using the minimum or maximum value, the value of mode should be set to either search_sort_field_mode::min or search_sort_field_mode::max.

Parameters
valuestrategy for multi-value fields.
Returns
pointer to this
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ type()

auto type ( search_sort_field_type value) -> search_sort_field &

Specifies the type of the search-order field value.

For example, search_sort_field_type::string for text fields, search_sort_field_type::date for DateTime fields, or search_sort_field_type::number for numeric/geo fields.

Parameters
valuefield type
Returns
pointer to this
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: