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)) ) { |
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)) ) { |