Couchbase C++ SDK
1.4.0 (rev. 59aa900)
Toggle main menu visibility
Loading...
Searching...
No Matches
search_row.hxx
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2
/*
3
* Copyright 2020-Present Couchbase, Inc.
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*/
17
18
#pragma once
19
20
#include <
couchbase/codec/binary_noop_serializer.hxx
>
21
#include <
couchbase/codec/encoded_value.hxx
>
22
#include <
couchbase/search_row_locations.hxx
>
23
24
#include <memory>
25
26
namespace
couchbase
27
{
28
#ifndef COUCHBASE_CXX_CLIENT_DOXYGEN
29
class
internal_search_row;
30
#endif
31
38
class
search_row
39
{
40
public
:
45
explicit
search_row
(internal_search_row internal);
46
search_row
(
search_row
&& other)
noexcept
;
47
~search_row
();
48
auto
operator=
(
search_row
&& other)
noexcept
->
search_row
&;
49
54
[[nodiscard]]
auto
index
() const -> const std::
string
&;
55
60
[[nodiscard]] auto
id
() const -> const std::
string
&;
61
66
[[nodiscard]] auto
score
() const ->
double
;
67
72
[[nodiscard]] auto
fields
() const -> const
codec
::binary&;
73
74
template<typename Serializer,
75
typename Document = typename Serializer::document_type,
76
std::enable_if_t<
codec
::is_serializer_v<Serializer>,
bool
> = true>
77
[[nodiscard]] auto
fields_as
() const -> Document
78
{
79
if
(
fields
().empty()) {
80
return
Document{};
81
}
82
return
Serializer::template deserialize<Document>(
fields
());
83
}
84
89
[[nodiscard]]
auto
explanation
() const -> const
codec
::binary&;
90
95
[[nodiscard]] auto
locations
() const -> const std::optional<
search_row_locations
>&;
96
101
[[nodiscard]] auto
fragments
() const -> const std::map<std::
string
, std::vector<std::
string
>>&;
102
103
private:
104
std::unique_ptr<internal_search_row> internal_;
105
};
106
107
}
// namespace couchbase
binary_noop_serializer.hxx
couchbase::search_row_locations
Definition
search_row_locations.hxx:39
couchbase::search_row::~search_row
~search_row()
couchbase::search_row::search_row
search_row(internal_search_row internal)
couchbase::search_row::fields
auto fields() const -> const codec::binary &
couchbase::search_row::search_row
search_row(search_row &&other) noexcept
couchbase::search_row::locations
auto locations() const -> const std::optional< search_row_locations > &
couchbase::search_row::fragments
auto fragments() const -> const std::map< std::string, std::vector< std::string > > &
couchbase::search_row::fields_as
auto fields_as() const -> Document
Definition
search_row.hxx:77
couchbase::search_row::explanation
auto explanation() const -> const codec::binary &
couchbase::search_row::index
auto index() const -> const std::string &
couchbase::search_row::operator=
auto operator=(search_row &&other) noexcept -> search_row &
couchbase::search_row::score
auto score() const -> double
encoded_value.hxx
couchbase::codec
Definition
analytics_options.hxx:36
couchbase
Represents a single item from the result of scan().
Definition
allow_querying_search_index_options.hxx:28
search_row_locations.hxx
couchbase
search_row.hxx
Generated by
1.17.0