246 |
|
|
247 |
elog(DEBUG1, "pgest_attr: found %d hits for %s", resnum, query); |
elog(DEBUG1, "pgest_attr: found %d hits for %s", resnum, query); |
248 |
|
|
|
|
|
249 |
values = (char **) palloc(ncols * sizeof(char *)); |
values = (char **) palloc(ncols * sizeof(char *)); |
250 |
|
|
251 |
for (i = 0; i < nrows; i++) |
for (i = 0; i < nrows; i++) |
253 |
|
|
254 |
/* get result from estraier */ |
/* get result from estraier */ |
255 |
if (! ( doc = est_db_get_doc(db, est_result[i + offset], 0)) ) { |
if (! ( doc = est_db_get_doc(db, est_result[i + offset], 0)) ) { |
256 |
elog(INFO, "can't find result %d", i + offset); |
elog(INFO, "pgest_attr: can't find result %d", i + offset); |
257 |
} else { |
} else { |
258 |
elog(DEBUG1, "URI: %s\n Title: %s\n", |
elog(DEBUG1, "URI: %s\n Title: %s\n", |
259 |
est_doc_attr(doc, "@uri"), |
est_doc_attr(doc, "@uri"), |
285 |
/* now store it */ |
/* now store it */ |
286 |
tuplestore_puttuple(tupstore, tuple); |
tuplestore_puttuple(tupstore, tuple); |
287 |
|
|
|
|
|
288 |
/* delete estraier document object */ |
/* delete estraier document object */ |
289 |
est_doc_delete(doc); |
if (doc) est_doc_delete(doc); |
290 |
} |
} |
291 |
|
|
292 |
tuplestore_donestoring(tupstore); |
tuplestore_donestoring(tupstore); |
321 |
int len; |
int len; |
322 |
int attrlen; |
int attrlen; |
323 |
|
|
324 |
|
if (! doc) return (Datum) NULL; |
325 |
|
|
326 |
elog(DEBUG1, "doc: %08x, attr: %s", doc, attr); |
elog(DEBUG1, "doc: %08x, attr: %s", doc, attr); |
327 |
|
|
328 |
if ( (attrval = est_doc_attr(doc, attr)) && (attrlen = strlen(attrval)) ) { |
if ( (attrval = est_doc_attr(doc, attr)) && (attrlen = strlen(attrval)) ) { |
552 |
/* FIXME: allow user to specify depath of search */ |
/* FIXME: allow user to specify depath of search */ |
553 |
nres = est_node_search(node, cond, 0); |
nres = est_node_search(node, cond, 0); |
554 |
|
|
555 |
|
if (! nres) { |
556 |
|
int status = est_node_status(node); |
557 |
|
est_cond_delete(cond); |
558 |
|
est_node_delete(node); |
559 |
|
est_free_net_env(); |
560 |
|
ereport(ERROR, (errcode(ERRCODE_QUERY_CANCELED), |
561 |
|
errmsg("pgest_node: search failed, node status %d", status))); |
562 |
|
} |
563 |
|
|
564 |
/* get number of results */ |
/* get number of results */ |
565 |
resnum = est_noderes_doc_num(nres); |
resnum = est_noderes_doc_num(nres); |
566 |
|
|
587 |
|
|
588 |
/* get result from estraier */ |
/* get result from estraier */ |
589 |
if (! ( rdoc = est_noderes_get_doc(nres, i + offset) )) { |
if (! ( rdoc = est_noderes_get_doc(nres, i + offset) )) { |
590 |
elog(INFO, "can't find result %d", i + offset); |
elog(INFO, "pgest_node: can't find result %d", i + offset); |
591 |
} else { |
} else { |
592 |
elog(DEBUG1, "URI: %s\n Title: %s\n", |
elog(DEBUG1, "URI: %s\n Title: %s\n", |
593 |
est_resdoc_attr(rdoc, "@uri"), |
est_resdoc_attr(rdoc, "@uri"), |
656 |
int len; |
int len; |
657 |
int attrlen; |
int attrlen; |
658 |
|
|
659 |
|
if (! rdoc) return (Datum) NULL; |
660 |
|
|
661 |
elog(DEBUG1, "doc: %08x, attr: %s", rdoc, attr); |
elog(DEBUG1, "doc: %08x, attr: %s", rdoc, attr); |
662 |
|
|
663 |
if ( (attrval = est_resdoc_attr(rdoc, attr)) && (attrlen = strlen(attrval)) ) { |
if ( (attrval = est_resdoc_attr(rdoc, attr)) && (attrlen = strlen(attrval)) ) { |