X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzebraapi.c;h=a87ee4a9dad6d53c049193c2ee656b278ad1fb7f;hb=bbc5017bf20ab7e410b4913acd70816812b5059f;hp=ce2a017b1f2922997a1becef527480a525adb8d9;hpb=ce3907338568fce46c5751e7e1091a5ad1c8e291;p=idzebra-moved-to-github.git diff --git a/index/zebraapi.c b/index/zebraapi.c index ce2a017..a87ee4a 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -4,7 +4,15 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zebraapi.c,v $ - * Revision 1.1 1998-03-05 08:45:13 adam + * Revision 1.3 1998-05-27 16:57:44 adam + * Zebra returns surrogate diagnostic for single records when + * appropriate. + * + * Revision 1.2 1998/05/20 10:12:19 adam + * Implemented automatic EXPLAIN database maintenance. + * Modified Zebra to work with ASN.1 compiled version of YAZ. + * + * Revision 1.1 1998/03/05 08:45:13 adam * New result set model and modular ranking system. Moved towards * descent server API. System information stored as "SGML" records. * @@ -52,7 +60,7 @@ static int zebra_register_lock (ZebraHandle zh) zh->registerChange = lastChange; if (zh->records) { - zebraExplain_close (zh->zei, 0); + zebraExplain_close (zh->zei, 0, 0); dict_close (zh->dict); sortIdx_close (zh->sortIdx); if (zh->isam) @@ -83,7 +91,7 @@ static int zebra_register_lock (ZebraHandle zh) sizeof (struct it_key), zh->res))) return -1; } - zh->zei = zebraExplain_open (zh->records, zh->dh, 0); + zh->zei = zebraExplain_open (zh->records, zh->dh, zh->res, 0, 0, 0); return 0; } @@ -134,7 +142,6 @@ ZebraHandle zebra_open (const char *host, const char *configName) zh->registerChange = 0; zh->records = NULL; - zh->registered_sets = NULL; zh->zebra_maps = zebra_maps_open (zh->res); zh->rank_classes = NULL; @@ -147,7 +154,7 @@ void zebra_close (ZebraHandle zh) if (zh->records) { resultSetDestroy (zh); - zebraExplain_close (zh->zei, 0); + zebraExplain_close (zh->zei, 0, 0); dict_close (zh->dict); sortIdx_close (zh->sortIdx); if (zh->isam) @@ -187,6 +194,7 @@ void zebra_records_retrieve (ZebraHandle zh, ODR stream, ZebraPosSet poset; int i, *pos_array; + zh->errCode = 0; pos_array = xmalloc (sizeof(*pos_array)); for (i = 0; ierrCode = + recs[i].errCode = zebra_record_fetch (zh, poset[i].sysno, poset[i].score, stream, input_format, comp, &recs[i].format, &recs[i].buf, &recs[i].len, &recs[i].base); + recs[i].errString = NULL; } } zebraPosSetDestroy (zh, poset, num_recs); @@ -230,6 +239,7 @@ void zebra_scan (ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, int *position, int *num_entries, ZebraScanEntry **entries, int *is_partial) { + zh->errCode = 0; zebra_register_lock (zh); rpn_scan (zh, stream, zapt, attributeset, num_bases, basenames, position,