LiteCore
Couchbase Lite cross-platform core implementation
Loading...
Searching...
No Matches
c4Index.h
Go to the documentation of this file.
1//
2// c4Index.h
3//
4// Copyright 2019-Present Couchbase, Inc.
5//
6// Use of this software is governed by the Business Source License included
7// in the file licenses/BSL-Couchbase.txt. As of the Change Date specified
8// in that file, in accordance with the Business Source License, use of this
9// software will be governed by the Apache License, Version 2.0, included in
10// the file licenses/APL2.txt.
11//
12
13#pragma once
14#include "c4IndexTypes.h"
15
18
19//======== C4Collection Methods:
20
23
72 C4QueryLanguage queryLanguage, C4IndexType indexType,
73 const C4IndexOptions* C4NULLABLE indexOptions,
74 C4Error* C4NULLABLE outError) C4API;
75
79 C4Error* C4NULLABLE outError) C4API;
80
88 C4Error* C4NULLABLE outError) C4API;
89
98
99//======== C4Index Methods:
100
104
108
112
116
120
127
128
129#ifdef COUCHBASE_ENTERPRISE
130
136CBL_CORE_API bool c4index_isTrained(C4Index*, C4Error* C4NULLABLE outError) C4API;
137
138
139//======== UPDATING LAZY INDEXES:
140
141
162NODISCARD CBL_CORE_API C4IndexUpdater* C4NULLABLE c4index_beginUpdate(C4Index* index, size_t limit,
163 C4Error* outError) C4API;
164
167CBL_CORE_API size_t c4indexupdater_count(C4IndexUpdater* updater) C4API;
168
178NODISCARD CBL_CORE_API FLValue C4NULLABLE c4indexupdater_valueAt(C4IndexUpdater* updater, size_t i) C4API;
179
189NODISCARD CBL_CORE_API bool c4indexupdater_setVectorAt(C4IndexUpdater* updater, size_t i,
190 const float vector[C4NULLABLE], size_t dimension,
191 C4Error* outError) C4API;
192
201CBL_CORE_API bool c4indexupdater_skipVectorAt(C4IndexUpdater* updater, size_t i) C4API;
202
219CBL_CORE_API bool c4indexupdater_finish(C4IndexUpdater* updater, C4Error* outError) C4API;
220
221#endif
222
234
236
#define NODISCARD
Definition CompilerSupport.h:63
#define CBL_CORE_API
Definition c4Compat.h:131
#define C4NULLABLE
Definition c4Compat.h:38
#define C4API
Definition c4Compat.h:106
#define C4_ASSUME_NONNULL_BEGIN
Definition c4Compat.h:36
#define C4API_END_DECLS
Definition c4Compat.h:108
#define C4API_BEGIN_DECLS
Definition c4Compat.h:107
#define C4_ASSUME_NONNULL_END
Definition c4Compat.h:37
C4Slice C4String
Definition c4Base.h:51
struct C4Index C4Index
Represents an existing index.
Definition c4Base.h:147
FLSliceResult C4SliceResult
Definition c4Base.h:50
struct C4IndexUpdater C4IndexUpdater
Describes a set of index values that need to be computed by the application.
Definition c4Base.h:150
FLSlice C4Slice
Definition c4Base.h:48
struct C4Collection C4Collection
Opaque handle to a namespace of documents in an opened database.
Definition c4Base.h:125
CBL_CORE_API bool c4index_getOptions(C4Index *index, C4IndexOptions *outOpts)
Gets the index's FTS/vector options, if any.
CBL_CORE_API C4SliceResult c4coll_getIndexesInfo(C4Collection *collection, C4Error *outError)
Returns information about all indexes in the collection.
NODISCARD CBL_CORE_API bool c4coll_createIndex(C4Collection *collection, C4String name, C4String indexSpec, C4QueryLanguage queryLanguage, C4IndexType indexType, const C4IndexOptions *indexOptions, C4Error *outError)
Creates a collection index, of the values of specific expressions across all documents.
CBL_CORE_API C4Index * c4coll_getIndex(C4Collection *collection, C4String name, C4Error *outError)
Returns an object representing an existing index.
NODISCARD CBL_CORE_API bool c4coll_deleteIndex(C4Collection *collection, C4String name, C4Error *outError)
Deletes an index that was created by c4coll_createIndex.
CBL_CORE_API C4String c4index_getExpression(C4Index *)
Returns the indexed expression.
CBL_CORE_API C4IndexType c4index_getType(C4Index *)
Returns the index's type.
CBL_CORE_API C4Slice c4index_getName(C4Index *index)
Returns the name of this index.
CBL_CORE_API C4QueryLanguage c4index_getQueryLanguage(C4Index *)
Returns the index's query language (JSON or N1QL).
C4IndexType
Definition c4IndexTypes.h:25
CBL_CORE_API bool c4coll_isIndexTrained(C4Collection *collection, C4String name, C4Error *outError)
Returns whether a vector index has been trained yet or not.
CBL_CORE_API C4Collection * c4index_getCollection(C4Index *index)
Returns the collection this index belongs to.
C4QueryLanguage
Definition c4QueryTypes.h:26
const struct _FLValue * FLValue
A reference to a value of any type.
Definition FLBase.h:35
An error value.
Definition c4Error.h:133
Options for indexes; these each apply to specific types of indexes.
Definition c4IndexTypes.h:89