disable index by increasing the number of pending changes and re-creating the internal RediSearch index
| 353 | // disable index by increasing the number of pending changes |
| 354 | // and re-creating the internal RediSearch index |
| 355 | void Index_Disable |
| 356 | ( |
| 357 | Index idx // index to disable |
| 358 | ) { |
| 359 | ASSERT(idx != NULL); |
| 360 | |
| 361 | idx->pending_changes++; |
| 362 | |
| 363 | // drop index if exists |
| 364 | if(idx->rsIdx != NULL) { |
| 365 | RediSearch_DropIndex(idx->rsIdx); |
| 366 | idx->rsIdx = NULL; |
| 367 | } |
| 368 | |
| 369 | // construct index structure |
| 370 | Index_ConstructStructure(idx); |
| 371 | } |
| 372 | |
| 373 | // try to enable index by dropping number of pending changes by 1 |
| 374 | // the index is enabled once there are no pending changes |
no test coverage detected