From f3f94568869a1ae0402bfa4f0dea4d80b09695df Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 5 Dec 2008 16:03:23 +0100 Subject: [PATCH] Prelimiary work on bug 2338. --- index/records.c | 1 + index/zebraapi.c | 17 +++++++++++++++-- index/zinfo.c | 9 +++++++-- index/zinfo.h | 5 ++++- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/index/records.c b/index/records.c index c38091e..e52368f 100644 --- a/index/records.c +++ b/index/records.c @@ -206,6 +206,7 @@ static ZEBRA_RES rec_delete_single(Records p, Record rec) if (rec_release_blocks(p, rec_sysno_to_int(rec->sysno)) != ZEBRA_OK) return ZEBRA_FAIL; + yaz_log(YLOG_LOG, "rec_delete_single sysno=" ZINT_FORMAT, rec->sysno); entry.next = p->head.index_free; entry.size = 0; p->head.index_free = rec_sysno_to_int(rec->sysno); diff --git a/index/zebraapi.c b/index/zebraapi.c index 202f7bb..adc9b6a 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1437,12 +1437,25 @@ int delete_w_handle(const char *info, void *handle) return 0; } -static int delete_SU_handle(void *handle, int ord) +static int delete_SU_handle(void *handle, int ord, + const char *index_type, const char *string_index, + zinfo_index_category_t cat) { ZebraHandle zh = (ZebraHandle) handle; char ord_buf[20]; int ord_len; - +#if 0 + const char *index_type = 0; + const char *db = 0; + const char *string_index = 0; + zebraExplain_lookup_ord(zh->reg->zei, ord, + &index_type, &db, &string_index); + yaz_log(YLOG_LOG, + "delete_SU_handle:: ord=%d index_type=%s db=%s string_index=%s", + ord, index_type, db, string_index); +#endif + yaz_log(YLOG_LOG, "ord=%d index_type=%s index=%s cat=%d", ord, + index_type, string_index, (int) cat); ord_len = key_SU_encode(ord, ord_buf); ord_buf[ord_len] = '\0'; diff --git a/index/zinfo.c b/index/zinfo.c index 9f893e9..cd8bb3f 100644 --- a/index/zinfo.c +++ b/index/zinfo.c @@ -1376,14 +1376,19 @@ int zebraExplain_lookup_attr_str(ZebraExplainInfo zei, } int zebraExplain_trav_ord(ZebraExplainInfo zei, void *handle, - int (*f)(void *handle, int ord)) + int (*f)(void *handle, int ord, + const char *index_type, + const char *string_index, + zinfo_index_category_t cat)) { struct zebDatabaseInfoB *zdb = zei->curDatabaseInfo; if (zdb) { struct zebSUInfoB *zsui = zdb->attributeDetails->SUInfo; for ( ;zsui; zsui = zsui->next) - (*f)(handle, zsui->info.ordinal); + (*f)(handle, zsui->info.ordinal, + zsui->info.index_type, zsui->info.str, + zsui->info.cat); } return 0; } diff --git a/index/zinfo.h b/index/zinfo.h index 6f63d4c..95b1f01 100644 --- a/index/zinfo.h +++ b/index/zinfo.h @@ -94,7 +94,10 @@ zint zebraExplain_ord_get_term_occurrences(ZebraExplainInfo zei, int ord); zint zebraExplain_ord_get_doc_occurrences(ZebraExplainInfo zei, int ord); int zebraExplain_trav_ord(ZebraExplainInfo zei, void *handle, - int (*f)(void *handle, int ord)); + int (*f)(void *handle, int ord, + const char *index_type, + const char *string_index, + zinfo_index_category_t cat)); int zebraExplain_get_database_ord(ZebraExplainInfo zei); int zebraExplain_removeDatabase(ZebraExplainInfo zei, void *updateHandle); -- 1.7.10.4