-/* $Id: kinput.c,v 1.78 2006-11-21 14:32:38 adam Exp $
- Copyright (C) 1995-2006
+/* $Id: kinput.c,v 1.83 2007-02-06 09:32:50 adam Exp $
+ Copyright (C) 1995-2007
Index Data ApS
This file is part of the Zebra server.
struct zebra_register *reg;
ZebraHandle zh;
int raw_reading; /* 1=raw /mem read. 0=file reading */
- int no_diffs;
- int no_updates;
- int no_deletions;
- int no_insertions;
- int no_iterations;
+ zint no_diffs;
+ zint no_updates;
+ zint no_deletions;
+ zint no_insertions;
+ zint no_iterations;
};
static struct heap_info *key_heap_malloc(void)
#define PR_KEY_LOW 0
#define PR_KEY_TOP 0
-#if 0
/* for debugging only */
-static void print_dict_item(ZebraHandle zh, const char *s)
+void zebra_log_dict_entry(ZebraHandle zh, const char *s)
{
char dst[IT_MAX_WORD+1];
int ord;
int len = key_SU_decode(&ord, (const unsigned char *) s);
int index_type;
- const char *db = 0;
if (!zh)
yaz_log(YLOG_LOG, "ord=%d", ord);
else
{
- zebraExplain_lookup_ord (zh->reg->zei,
- ord, &index_type, &db, 0, 0, 0);
+ const char *string_index;
+ const char *db = 0;
+ zebraExplain_lookup_ord(zh->reg->zei,
+ ord, &index_type, &db, &string_index);
zebra_term_untrans(zh, index_type, dst, s + len);
- yaz_log(YLOG_LOG, "ord=%d term=%s", ord, dst);
+ yaz_log(YLOG_LOG, "ord=%d index_type=%c index=%s term=%s",
+ ord, index_type, string_index, dst);
}
}
-#endif
struct heap_cread_info {
char prev_name[INP_NAME_MAX];
*insertMode = p->key[0];
memcpy (*dst, p->key+1, sizeof(struct it_key));
#if PR_KEY_LOW
+ zebra_log_dict_entry(hi->zh, p->cur_name);
pkey(*dst, *insertMode);
#endif
(*dst) += sizeof(struct it_key);
*insertMode = p->key[0];
memcpy (*dst, p->key+1, sizeof(struct it_key));
#if PR_KEY_LOW
+ zebra_log_dict_entry(hi->zh, p->cur_name);
pkey(*dst, *insertMode);
#endif
(*dst) += sizeof(struct it_key);
#if 0
assert(hi->zh);
- print_dict_item(hi->zh, hci->cur_name);
+ zebra_log_dict_entry(hi->zh, hci->cur_name);
#endif
if ((dict_info = dict_lookup (hi->reg->dict, hci->cur_name)))
{
xfree (kf);
if (hi->no_iterations)
{ /* do not log if nothing happened */
- yaz_log(YLOG_LOG, "Iterations . . .%7d", hi->no_iterations);
- yaz_log(YLOG_LOG, "Distinct words .%7d", hi->no_diffs);
- yaz_log(YLOG_LOG, "Updates. . . . .%7d", hi->no_updates);
- yaz_log(YLOG_LOG, "Deletions. . . .%7d", hi->no_deletions);
- yaz_log(YLOG_LOG, "Insertions . . .%7d", hi->no_insertions);
+ yaz_log(YLOG_LOG, "Iterations: isam/dict "
+ ZINT_FORMAT "/" ZINT_FORMAT,
+ hi->no_iterations, hi->no_diffs);
+ yaz_log(YLOG_LOG, "Dict: inserts/updates/deletions: "
+ ZINT_FORMAT "/" ZINT_FORMAT "/" ZINT_FORMAT,
+ hi->no_insertions, hi->no_updates, hi->no_deletions);
}
key_block_destroy(&zh->reg->key_block);
key_heap_destroy(hi, nkeys);