44 : term_{ std::move(term) }
82 return { term_, exclusive_ };
87 bool exclusive_{
false };
115 std::optional<scan_term::built>
from{};
116 std::optional<scan_term::built>
to{};
119 std::optional<std::uint64_t>
seed{};
150 : prefix_{ std::move(prefix) }
171 std::string prefix_{};
199 range_scan(std::optional<scan_term> from, std::optional<scan_term> to)
200 : from_{ std::move(from) }
201 , to_{ std::move(to) }
216 from_ = std::move(from);
246 scan_type::built::type::range_scan,
248 (from_) ? std::make_optional(from_->build()) : std::nullopt,
249 (to_) ? std::make_optional(to_->build()) : std::nullopt,
254 std::optional<scan_term> from_{};
255 std::optional<scan_term> to_{};
320 scan_type::built::type::sampling_scan, {}, {}, {}, limit_, seed_,
325 std::size_t limit_{};
326 std::optional<std::uint64_t> seed_{};
Represents a single item from the result of collection::scan()
Definition allow_querying_search_index_options.hxx:28
A prefix scan performs a scan that includes all documents whose keys start with the given prefix.
Definition scan_type.hxx:139
auto build() const -> built override
Returns the prefix scan type as an immutable value.
Definition scan_type.hxx:162
prefix_scan(std::string prefix)
Creates an instance of a prefix scan type.
Definition scan_type.hxx:149
A range scan performs a scan on a range of keys.
Definition scan_type.hxx:180
range_scan(std::optional< scan_term > from, std::optional< scan_term > to)
Creates an instance of a range scan type.
Definition scan_type.hxx:199
auto build() const -> built override
Returns the range scan type as an immutable value.
Definition scan_type.hxx:243
range_scan()=default
Creates an instance of a range scan type with no bounds.
auto to(scan_term to) -> range_scan &
Specifies the upper bound of the range.
Definition scan_type.hxx:229
auto from(scan_term from) -> range_scan &
Specifies the lower bound of the range.
Definition scan_type.hxx:214
A sampling scan performs a scan that randomly selects documents up to a configured limit.
Definition scan_type.hxx:264
auto build() const -> built override
Returns the sampling scan type as an immutable value.
Definition scan_type.hxx:317
sampling_scan(std::size_t limit)
Creates an instance of a sampling scan type.
Definition scan_type.hxx:274
sampling_scan(std::size_t limit, std::uint64_t seed)
Creates an instance of a sampling scan type with a seed.
Definition scan_type.hxx:288
auto seed(std::uint64_t seed) -> sampling_scan &
Sets the seed for the sampling scan.
Definition scan_type.hxx:303
Immutable value representing the scan term.
Definition scan_type.hxx:67
bool exclusive
Definition scan_type.hxx:69
std::string term
Definition scan_type.hxx:68
A scan term used to specify the bounds of a range scan operation.
Definition scan_type.hxx:33
auto exclusive(bool exclusive) -> scan_term &
Specifies whether this term is excluded from the scan results.
Definition scan_type.hxx:55
auto build() const -> built
Returns the scan term as an immutable value.
Definition scan_type.hxx:80
scan_term(std::string term)
Constructs an instance representing the scan term for the given term.
Definition scan_type.hxx:43
Immutable value representing the scan type.
Definition scan_type.hxx:105
type type
Definition scan_type.hxx:111
std::optional< scan_term::built > to
Definition scan_type.hxx:116
std::optional< scan_term::built > from
Definition scan_type.hxx:115
std::string prefix
Definition scan_type.hxx:113
type
Definition scan_type.hxx:106
@ range_scan
Definition scan_type.hxx:108
@ prefix_scan
Definition scan_type.hxx:107
std::optional< std::uint64_t > seed
Definition scan_type.hxx:119
std::size_t limit
Definition scan_type.hxx:118
The base class for the different scan types.
Definition scan_type.hxx:96
virtual ~scan_type()=default
virtual auto build() const -> built=0
Returns the scan type as an immutable value.