98 |
if ( 0 == funcctx->max_calls ) |
if ( 0 == funcctx->max_calls ) |
99 |
elog(INFO, "pgest: no results for: %s", query ); |
elog(INFO, "pgest: no results for: %s", query ); |
100 |
|
|
101 |
elog(INFO, "pgest: found %d hits for %s", funcctx->max_calls, query); |
elog(DEBUG1, "pgest: found %d hits for %s", funcctx->max_calls, query); |
102 |
|
|
103 |
/* Build a tuple description for a __pgest tuple */ |
/* Build a tuple description for a __pgest tuple */ |
104 |
tupdesc = RelationNameGetTupleDesc("__pgest"); |
tupdesc = RelationNameGetTupleDesc("__pgest"); |
118 |
|
|
119 |
MemoryContextSwitchTo(oldcontext); |
MemoryContextSwitchTo(oldcontext); |
120 |
|
|
121 |
elog(INFO, "SRF_IS_FIRSTCALL done"); |
elog(DEBUG1, "SRF_IS_FIRSTCALL done"); |
122 |
} |
} |
123 |
|
|
124 |
/* stuff done on every call of the function */ |
/* stuff done on every call of the function */ |
134 |
HeapTuple tuple; |
HeapTuple tuple; |
135 |
Datum result; |
Datum result; |
136 |
|
|
137 |
elog(INFO, "pgest: loop count %d", call_cntr); |
elog(DEBUG1, "pgest: loop count %d", call_cntr); |
138 |
|
|
139 |
if (! est_result) { |
if (! est_result) { |
140 |
elog(ERROR, "pgest: no estraier results"); |
elog(ERROR, "pgest: no estraier results"); |
149 |
|
|
150 |
if (doc = est_db_get_doc(db, est_result[call_cntr], 0)) { |
if (doc = est_db_get_doc(db, est_result[call_cntr], 0)) { |
151 |
|
|
152 |
elog(INFO, "URI: %s\n Title: %s\n", |
elog(DEBUG1, "URI: %s\n Title: %s\n", |
153 |
est_doc_attr(doc, "@uri"), |
est_doc_attr(doc, "@uri"), |
154 |
est_doc_attr(doc, "@title") |
est_doc_attr(doc, "@title") |
155 |
); |
); |
197 |
|
|
198 |
SRF_RETURN_NEXT(funcctx, result); |
SRF_RETURN_NEXT(funcctx, result); |
199 |
} else { |
} else { |
200 |
elog(INFO, "loop over"); |
elog(DEBUG1, "loop over"); |
201 |
|
|
202 |
if(!est_db_close(db, &ecode)){ |
if(!est_db_close(db, &ecode)){ |
203 |
elog(INFO, "est_db_close error: %s", est_err_msg(ecode)); |
elog(INFO, "est_db_close error: %s", est_err_msg(ecode)); |
293 |
const char *attrval; |
const char *attrval; |
294 |
int len; |
int len; |
295 |
|
|
296 |
elog(INFO, "doc: %08x, attr: %s", doc, attr); |
elog(DEBUG1, "doc: %08x, attr: %s", doc, attr); |
297 |
|
|
298 |
if (attrval = est_doc_attr(doc, attr)) { |
if (attrval = est_doc_attr(doc, attr)) { |
299 |
val = (char *) palloc(strlen(attrval) * sizeof(char)); |
val = (char *) palloc(strlen(attrval) * sizeof(char)); |
302 |
} |
} |
303 |
|
|
304 |
len = strlen(attrval); |
len = strlen(attrval); |
305 |
elog(INFO, "attr2text(%s) = '%s' %d bytes", attr, attrval, len); |
elog(DEBUG1, "attr2text(%s) = '%s' %d bytes", attr, attrval, len); |
306 |
|
|
307 |
len++; |
len++; |
308 |
len *= sizeof(char); |
len *= sizeof(char); |