| 107 | } |
| 108 | |
| 109 | SIValue *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 | |
| 139 | ProcedureResult Proc_FulltextQueryNodeFree |
| 140 | ( |
nothing calls this directly
no test coverage detected