/[pgestraier]/trunk/pgest.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/pgest.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 44 by dpavlin, Sat Sep 10 22:51:03 2005 UTC revision 47 by dpavlin, Sun Sep 11 21:44:56 2005 UTC
# Line 246  Datum pgest_attr(PG_FUNCTION_ARGS) Line 246  Datum pgest_attr(PG_FUNCTION_ARGS)
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++)
# Line 254  Datum pgest_attr(PG_FUNCTION_ARGS) Line 253  Datum pgest_attr(PG_FUNCTION_ARGS)
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"),
# Line 286  Datum pgest_attr(PG_FUNCTION_ARGS) Line 285  Datum pgest_attr(PG_FUNCTION_ARGS)
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);
# Line 323  char *attr2text(ESTDOC *doc, char *attr) Line 321  char *attr2text(ESTDOC *doc, char *attr)
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)) ) {
# Line 587  Datum pgest_node(PG_FUNCTION_ARGS) Line 587  Datum pgest_node(PG_FUNCTION_ARGS)
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"),
# Line 656  char *node_attr2text(ESTRESDOC *rdoc, ch Line 656  char *node_attr2text(ESTRESDOC *rdoc, ch
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)) ) {

Legend:
Removed from v.44  
changed lines
  Added in v.47

  ViewVC Help
Powered by ViewVC 1.1.26