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

Function Index_IndexNode

src/index/index_node.c:17–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15 const void *key, size_t key_len, uint *doc_field_count);
16
17void Index_IndexNode
18(
19 Index idx,
20 const Node *n
21) {
22 ASSERT(n != NULL);
23 ASSERT(idx != NULL);
24
25 EntityID key = ENTITY_GET_ID(n);
26 RSDoc *doc = NULL;
27 RSIndex *rsIdx = Index_RSIndex(idx);
28 size_t key_len = sizeof(EntityID);
29 uint doc_field_count = 0;
30
31 // create RediSearch document representing node
32 doc = Index_IndexGraphEntity(idx, (const GraphEntity *)n,
33 (const void *)&key, key_len, &doc_field_count);
34
35 if(doc_field_count == 0) {
36 // entity doesn't poses any attributes which are indexed
37 // remove entity from index and delete document
38 Index_RemoveNode(idx, n);
39 RediSearch_FreeDocument(doc);
40 return;
41 }
42
43 // add document to RediSearch index
44 RediSearch_SpecAddDocument(rsIdx, doc);
45}
46
47void Index_RemoveNode
48(

Callers 6

RdbLoadNodes_v13Function · 0.85
RdbLoadNodes_v11Function · 0.85
RdbLoadNodes_v10Function · 0.85
RdbLoadNodes_v12Function · 0.85
_Index_PopulateNodeIndexFunction · 0.85
Schema_AddNodeToIndicesFunction · 0.85

Calls 3

Index_RSIndexFunction · 0.85
Index_IndexGraphEntityFunction · 0.85
Index_RemoveNodeFunction · 0.85

Tested by

no test coverage detected