| 189 | } |
| 190 | |
| 191 | static 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 | |
| 232 | static void Schema_ActivateExactMatchIndex |
| 233 | ( |
no test coverage detected