activate pending exact-match index asserts that pending exact-match index is enabled drops current active exact-exact index if exists
| 509 | // asserts that pending exact-match index is enabled |
| 510 | // drops current active exact-exact index if exists |
| 511 | void Schema_ActivateIndex |
| 512 | ( |
| 513 | Schema *s, // schema to activate index on |
| 514 | Index idx // index to activate |
| 515 | ) { |
| 516 | ASSERT(s != NULL); |
| 517 | // make sure pending index is enabled |
| 518 | ASSERT(Index_Enabled(idx) == true); |
| 519 | |
| 520 | Index pending_full_text = PENDING_FULLTEXT_IDX(s); |
| 521 | Index pending_exact_match = PENDING_EXACTMATCH_IDX(s); |
| 522 | |
| 523 | // index to activate must be a pending index |
| 524 | ASSERT(idx == pending_exact_match || idx == pending_full_text); |
| 525 | |
| 526 | if(idx == pending_exact_match) { |
| 527 | Schema_ActivateExactMatchIndex(s); |
| 528 | } else { |
| 529 | Schema_ActivateFullTextIdx(s); |
| 530 | } |
| 531 | } |
| 532 | |
| 533 | // index node under all schema indices |
| 534 | void Schema_AddNodeToIndices |
no test coverage detected