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

Function Index_Free

src/index/index.c:587–617  ·  view source on GitHub ↗

free index

Source from the content-addressed store, hash-verified

585
586// free index
587void Index_Free
588(
589 Index idx
590) {
591 ASSERT(idx != NULL);
592
593 if(idx->rsIdx) {
594 RediSearch_DropIndex(idx->rsIdx);
595 }
596
597 if(idx->language) {
598 rm_free(idx->language);
599 }
600
601 uint fields_count = array_len(idx->fields);
602 for(uint i = 0; i < fields_count; i++) {
603 IndexField_Free(idx->fields + i);
604 }
605 array_free(idx->fields);
606
607 if(idx->stopwords) {
608 uint stopwords_count = array_len(idx->stopwords);
609 for(uint i = 0; i < stopwords_count; i++) {
610 rm_free(idx->stopwords[i]);
611 }
612 array_free(idx->stopwords);
613 }
614
615 rm_free(idx->label);
616 rm_free(idx);
617}
618

Callers 4

_indexer_idx_dropFunction · 0.85
Schema_FreeFunction · 0.85

Calls 4

rm_freeFunction · 0.85
array_lenFunction · 0.85
IndexField_FreeFunction · 0.85
array_freeFunction · 0.85

Tested by

no test coverage detected