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

Function Proc_FulltextQueryNodeStep

src/procedures/proc_fulltext_query.c:109–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109SIValue *Proc_FulltextQueryNodeStep
110(
111 ProcedureCtx *ctx
112) {
113 if(!ctx->privateData) return NULL; // no index was attached to this procedure
114
115 QueryNodeContext *pdata = (QueryNodeContext *)ctx->privateData;
116 if(!pdata || !pdata->iter) return NULL;
117
118 // try to get a result out of the iterator
119 // NULL is returned if iterator id depleted
120 size_t len = 0;
121 NodeID *id = (NodeID *)RediSearch_ResultsIteratorNext(pdata->iter,
122 Index_RSIndex(pdata->idx), &len);
123
124 // depleted
125 if(!id) return NULL;
126
127 double score = RediSearch_ResultsIteratorGetScore(pdata->iter);
128
129 // get node
130 Node *n = &pdata->n;
131 Graph_GetNode(pdata->g, *id, n);
132
133 if(pdata->yield_node) *pdata->yield_node = SI_Node(n);
134 if(pdata->yield_score) *pdata->yield_score = SI_DoubleVal(score);
135
136 return pdata->output;
137}
138
139ProcedureResult Proc_FulltextQueryNodeFree
140(

Callers

nothing calls this directly

Calls 4

Index_RSIndexFunction · 0.85
Graph_GetNodeFunction · 0.85
SI_NodeFunction · 0.85
SI_DoubleValFunction · 0.85

Tested by

no test coverage detected