X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzrpn.c;h=46d7afd461ee8a3ace7ee9915f924c634fef151d;hb=e5652ee69c5a71f19ea16455b48d22a78fb5fcdd;hp=17c0dbc3931d544c5e2ec3b39623627649a2fa7c;hpb=3039267ce9021611b94e5ddec8a7b1ecbacdd2fe;p=idzebra-moved-to-github.git diff --git a/index/zrpn.c b/index/zrpn.c index 17c0dbc..46d7afd 100644 --- a/index/zrpn.c +++ b/index/zrpn.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zrpn.c,v $ - * Revision 1.4 1995-09-05 15:28:40 adam + * Revision 1.5 1995-09-06 10:33:04 adam + * More work on present. Some log messages removed. + * + * Revision 1.4 1995/09/05 15:28:40 adam * More work on search engine. * * Revision 1.3 1995/09/04 15:20:22 adam @@ -27,23 +30,26 @@ #include #include +#include static RSET rpn_search_APT (ZServerInfo *zi, Z_AttributesPlusTerm *zapt) { + char termz[256]; + size_t sizez; struct rset_isam_parms parms; const char *info; Z_Term *term = zapt->term; if (term->which != Z_Term_general) return NULL; - logf (LOG_DEBUG, "dict_lookup: %s", term->u.general->buf); - if (!(info = dict_lookup (zi->wordDict, term->u.general->buf))) - { - rset_temp_parms parms; - - parms.key_size = sizeof(struct it_key); - return rset_create (rset_kind_temp, &parms); - } + sizez = term->u.general->len; + if (sizez > 255) + sizez = 255; + memcpy (termz, term->u.general->buf, sizez); + termz[sizez] = '\0'; + logf (LOG_DEBUG, "dict_lookup: %s", termz); + if (!(info = dict_lookup (zi->wordDict, termz))) + return rset_create (rset_kind_null, NULL); assert (*info == sizeof(parms.pos)); memcpy (&parms.pos, info+1, sizeof(parms.pos)); parms.is = zi->wordIsam; @@ -180,7 +186,6 @@ static RSET rpn_save_set (RSET r, int *count) psysno = key.sysno; (*count)++; } - logf (LOG_DEBUG, "lllllllllllllllll"); #if 0 rset_write (d, &key); #endif