CBLIndexUpdater
@interface CBLIndexUpdater : NSObject <CBLArray>
ENTERPRISE EDITION ONLY
CBLIndexUpdater is used for updating the index in lazy mode. Currently, the vector index is the only index type that can be updated lazily.
-
The total number of vectors to compute and set for updating the index.
Declaration
Objective-C
@property (readonly) NSUInteger count;
-
Sets the vector for the value corresponding to the index.
Setting nil value means that there is no vector for the value, and any existing vector will be removed when the -finishWithError: is called.
Declaration
Objective-C
- (BOOL)setVector:(nullable NSArray<NSNumber *> *)vector atIndex:(NSUInteger)index error:(NSError *_Nullable *_Nullable)error;
Parameters
vector
Array of float numbers.
index
The index.
error
On return, the error if any.
Return Value
True on success, false on failure.
-
Skip setting the vector for the value corresponding to the index. The vector will be required to compute and set again for the value when the CBLQueryIndex’s -beginUpdateWithLimit:error: is later called for updating the index.
Declaration
Objective-C
- (void)skipVectorAtIndex:(NSUInteger)index;
Parameters
index
The index.
-
Updates the index with the computed vectors and removes any index rows for which nil vector was given. If there are any indexes that do not have their vector value set or are skipped, a CBLErrorUnsupported error will be thrown.
Note
Before calling the finish() function, the set vectors are kept in the memory.
Declaration
Objective-C
- (BOOL)finishWithError:(NSError *_Nullable *_Nullable)error;
Parameters
error
On return, the error if any.
Return Value
True on success, false on failure.
-
Unavailable
Not available
Declaration
Objective-C
- (nonnull instancetype)init;