MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _Schema_RemoveFullTextIndex

Function _Schema_RemoveFullTextIndex

src/schema/schema.c:191–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191static int _Schema_RemoveFullTextIndex
192(
193 Schema *s
194) {
195 // removing a fulltext index is performed in one go
196 // the entire index is dropped, even if it contains multiple fields
197 // unlike an exact-match index where individual fields can be removed
198 ASSERT(s != NULL);
199
200 Index idx = NULL;
201 Index active = ACTIVE_FULLTEXT_IDX(s);
202 Index pending = PENDING_FULLTEXT_IDX(s);
203
204 // both active and pending do not exists, nothing to drop
205 if(pending == NULL && active == NULL) {
206 return INDEX_FAIL;
207 }
208
209 // disconnect both active and pending indicies from schema
210 ACTIVE_FULLTEXT_IDX(s) = NULL;
211 PENDING_FULLTEXT_IDX(s) = NULL;
212
213 GraphContext *gc = QueryCtx_GetGraphCtx();
214
215 //--------------------------------------------------------------------------
216 // disable and async drop
217 //--------------------------------------------------------------------------
218
219 if(active != NULL) {
220 Index_Disable(active);
221 Indexer_DropIndex(active, gc);
222 }
223
224 if(pending != NULL) {
225 Index_Disable(pending);
226 Indexer_DropIndex(pending, gc);
227 }
228
229 return INDEX_OK;
230}
231
232static void Schema_ActivateExactMatchIndex
233(

Callers 1

Schema_RemoveIndexFunction · 0.85

Calls 3

QueryCtx_GetGraphCtxFunction · 0.85
Index_DisableFunction · 0.85
Indexer_DropIndexFunction · 0.85

Tested by

no test coverage detected