Updates a lazy index by setting the computed vectors for the documents returned from QueryIndex::beginUpdate.
More...
#include <cbl++/QueryIndex.hh>
|
| size_t | count () const |
| | The total number of vectors to compute and set for updating the index.
|
| fleece::Value | value (size_t index) const |
| | Get the value at the given index for computing the vector.
|
| void | setVector (unsigned index, const float *_Nullable vector, size_t dimension) |
| | Sets the vector for the value corresponding to the given index.
|
| void | skipVector (size_t index) |
| | Skip setting the vector for the value corresponding to the index.
|
| void | finish () |
| | Updates the index with the computed vectors and removes any index rows for which null vector was given.
|
| | IndexUpdater () noexcept |
| | Constructs a null reference (one that points to no object).
|
| IndexUpdater & | operator= (std::nullptr_t) |
| | Releases the underlying object and resets this to a null reference.
|
| bool | valid () const |
| | Returns true if this references an object, or false if it is a null reference.
|
| | operator bool () const |
| | Returns true if this references an object (same as valid).
|
| bool | operator== (const IndexUpdater &other) const |
| | Returns true if both sides reference the same object, or are both null references.
|
| bool | operator!= (const IndexUpdater &other) const |
| | Returns true if the two sides reference different objects.
|
| CBLIndexUpdater *_Nullable | ref () const |
| | Returns a pointer to the underlying C object (CBLIndexUpdater), or NULL if this is a null reference.
|
| | IndexUpdater (const IndexUpdater &other) noexcept |
| | Copy constructor: creates another reference to the same object as other.
|
| | IndexUpdater (IndexUpdater &&other) noexcept |
| | Move constructor: takes over the reference from other, leaving it a null reference.
|
| IndexUpdater & | operator= (const IndexUpdater &other) noexcept |
| | Copy assignment: replaces this reference with a reference to other's object.
|
| IndexUpdater & | operator= (IndexUpdater &&other) noexcept |
| | Move assignment: replaces this reference with other's, leaving other a null reference.
|
Updates a lazy index by setting the computed vectors for the documents returned from QueryIndex::beginUpdate.
Currently, the vector index is the only index type that can be updated lazily.
- Note
- ENTERPRISE EDITION ONLY
◆ IndexUpdater() [1/4]
| cbl::IndexUpdater::IndexUpdater |
( |
| ) |
|
|
inlinenoexcept |
Constructs a null reference (one that points to no object).
◆ IndexUpdater() [2/4]
(Internal) Constructs a reference wrapping, and retaining, a C object pointer.
◆ IndexUpdater() [3/4]
| cbl::IndexUpdater::IndexUpdater |
( |
const IndexUpdater & | other | ) |
|
|
inlinenoexcept |
Copy constructor: creates another reference to the same object as other.
◆ IndexUpdater() [4/4]
Move constructor: takes over the reference from other, leaving it a null reference.
◆ adopt()
◆ count()
| size_t cbl::IndexUpdater::count |
( |
| ) |
const |
|
inline |
The total number of vectors to compute and set for updating the index.
◆ finish()
| void cbl::IndexUpdater::finish |
( |
| ) |
|
|
inline |
Updates the index with the computed vectors and removes any index rows for which null vector was given.
If there are any indexes that do not have their vector value set or are skipped, a error will be returned.
- Note
- Before calling IndexUpdater::finish, the set vectors are kept in the memory.
- Warning
- The index updater cannot be used after calling IndexUpdater::finish.
◆ operator bool()
| cbl::IndexUpdater::operator bool |
( |
| ) |
const |
|
inlineexplicit |
Returns true if this references an object (same as valid).
◆ operator!=()
| bool cbl::IndexUpdater::operator!= |
( |
const IndexUpdater & | other | ) |
const |
|
inline |
Returns true if the two sides reference different objects.
◆ operator=() [1/3]
Copy assignment: replaces this reference with a reference to other's object.
◆ operator=() [2/3]
Move assignment: replaces this reference with other's, leaving other a null reference.
◆ operator=() [3/3]
| IndexUpdater & cbl::IndexUpdater::operator= |
( |
std::nullptr_t | | ) |
|
|
inline |
Releases the underlying object and resets this to a null reference.
◆ operator==()
| bool cbl::IndexUpdater::operator== |
( |
const IndexUpdater & | other | ) |
const |
|
inline |
Returns true if both sides reference the same object, or are both null references.
◆ ref()
Returns a pointer to the underlying C object (CBLIndexUpdater), or NULL if this is a null reference.
◆ setVector()
| void cbl::IndexUpdater::setVector |
( |
unsigned | index, |
|
|
const float *_Nullable | vector, |
|
|
size_t | dimension ) |
|
inline |
Sets the vector for the value corresponding to the given index.
Setting NULL vector means that there is no vector for the value, and any existing vector will be removed when the IndexUpdater::finish is called.
- Parameters
-
| index | The zero-based index. |
| vector | A pointer to the vector which is an array of floats, or NULL if there is no vector. |
| dimension | The dimension of vector. Must be equal to the dimension value set in the vector index config. |
◆ skipVector()
| void cbl::IndexUpdater::skipVector |
( |
size_t | index | ) |
|
|
inline |
Skip setting the vector for the value corresponding to the index.
The vector will be required to compute and set again when the QueryIndex::beginUpdate is later called.
- Parameters
-
| index | The zero-based index. |
◆ valid()
| bool cbl::IndexUpdater::valid |
( |
| ) |
const |
|
inline |
Returns true if this references an object, or false if it is a null reference.
◆ value()
| fleece::Value cbl::IndexUpdater::value |
( |
size_t | index | ) |
const |
|
inline |
Get the value at the given index for computing the vector.
- Parameters
-
| index | The zero-based index. |
- Returns
- The value.
◆ QueryIndex
The documentation for this class was generated from the following file: