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

Function Index_New

src/index/index.c:280–302  ·  view source on GitHub ↗

create a new index

Source from the content-addressed store, hash-verified

278
279// create a new index
280Index Index_New
281(
282 const char *label, // indexed label
283 int label_id, // indexed label id
284 IndexType type, // exact match or full text
285 GraphEntityType entity_type // entity type been indexed
286) {
287 ASSERT(label != NULL);
288
289 Index idx = rm_malloc(sizeof(_Index));
290
291 idx->type = type;
292 idx->label = rm_strdup(label);
293 idx->rsIdx = NULL;
294 idx->fields = array_new(IndexField, 1);
295 idx->label_id = label_id;
296 idx->language = NULL;
297 idx->stopwords = NULL;
298 idx->entity_type = entity_type;
299 idx->pending_changes = ATOMIC_VAR_INIT(0);
300
301 return idx;
302}
303
304// clone index
305Index Index_Clone

Callers 2

Schema_AddFullTextIndexFunction · 0.85

Calls 2

rm_mallocFunction · 0.85
rm_strdupFunction · 0.85

Tested by

no test coverage detected