X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fkinput.c;h=b263fc76b7806a19fef60f3bcc0ade1a3dc97c8e;hb=f19620ab15ecd101aa2522500d9a3dafd3b34773;hp=e9d467a8a35736eb7e7cb46db208ee24b5203de9;hpb=fc7107844c9ec8ea23e680ca4f3231923db4e9c5;p=idzebra-moved-to-github.git diff --git a/index/kinput.c b/index/kinput.c index e9d467a..b263fc7 100644 --- a/index/kinput.c +++ b/index/kinput.c @@ -4,7 +4,19 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: kinput.c,v $ - * Revision 1.9 1995-10-10 12:24:39 adam + * Revision 1.12 1995-12-06 17:49:19 adam + * Uses dict_delete now. + * + * Revision 1.11 1995/12/06 16:06:43 adam + * Better diagnostics. Work on 'real' dictionary deletion. + * + * Revision 1.10 1995/12/06 12:41:22 adam + * New command 'stat' for the index program. + * Filenames can be read from stdin by specifying '-'. + * Bug fix/enhancement of the transformation from terms to regular + * expressons in the search engine. + * + * Revision 1.9 1995/10/10 12:24:39 adam * Temporary sort files are compressed. * * Revision 1.8 1995/10/04 16:57:19 adam @@ -52,6 +64,7 @@ static int no_diffs = 0; static int no_updates = 0; +static int no_deletions = 0; static int no_insertions = 0; static int no_iterations = 0; @@ -343,11 +356,20 @@ int heap_inp (Dict dict, ISAM isam, struct heap_info *hi) { ISAM_P isam_p, isam_p2; logf (LOG_DEBUG, "updating %s", cur_name); - no_updates++; memcpy (&isam_p, info+1, sizeof(ISAM_P)); isam_p2 = is_merge (isam, isam_p, nmemb, key_buf); - if (isam_p2 != isam_p) - dict_insert (dict, cur_name, sizeof(ISAM_P), &isam_p2); + if (!isam_p2) + { + no_deletions++; + if (!dict_delete (dict, cur_name)) + abort (); + } + else + { + no_updates++; + if (isam_p2 != isam_p) + dict_insert (dict, cur_name, sizeof(ISAM_P), &isam_p2); + } } else { @@ -364,7 +386,8 @@ int heap_inp (Dict dict, ISAM isam, struct heap_info *hi) } void key_input (const char *dict_fname, const char *isam_fname, - int nkeys, int cache) + int nkeys, int cache) + { Dict dict; ISAM isam; @@ -402,6 +425,7 @@ void key_input (const char *dict_fname, const char *isam_fname, logf (LOG_LOG, "Iterations . . .%7d", no_iterations); logf (LOG_LOG, "Distinct words .%7d", no_diffs); logf (LOG_LOG, "Updates. . . . .%7d", no_updates); + logf (LOG_LOG, "Deletions. . . .%7d", no_deletions); logf (LOG_LOG, "Insertions . . .%7d", no_insertions); }