X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=index%2Fzrpn.c;h=6950fa96cf60b4e88db2a33eb683945851c8554e;hb=9289fb373f6404bb9d795c3a9eef42b4ce5d50d7;hp=4c6641ee6863bb5bd3767589bb581da0c7182354;hpb=85a2a0b28cb516d28ac70b7824f2b7d4b07e56ae;p=idzebra-moved-to-github.git diff --git a/index/zrpn.c b/index/zrpn.c index 4c6641e..6950fa9 100644 --- a/index/zrpn.c +++ b/index/zrpn.c @@ -4,7 +4,15 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zrpn.c,v $ - * Revision 1.77 1998-05-20 10:12:22 adam + * Revision 1.79 1998-06-22 11:35:09 adam + * Minor changes. + * + * Revision 1.78 1998/06/08 14:43:17 adam + * Added suport for EXPLAIN Proxy servers - added settings databasePath + * and explainDatabase to facilitate this. Increased maximum number + * of databases and attributes in one register. + * + * Revision 1.77 1998/05/20 10:12:22 adam * Implemented automatic EXPLAIN database maintenance. * Modified Zebra to work with ASN.1 compiled version of YAZ. * @@ -435,9 +443,10 @@ static void add_isam_p (const char *name, const char *info, assert (*info == sizeof(*p->isam_p_buf)); memcpy (p->isam_p_buf + p->isam_p_indx, info+1, sizeof(*p->isam_p_buf)); +#if 0 term_untrans (p->zh, p->reg_type, term_tmp, name+2); logf (LOG_DEBUG, "grep: %s", term_tmp); - +#endif (p->isam_p_indx)++; } @@ -829,6 +838,8 @@ static int field_term (ZebraHandle zh, Z_AttributesPlusTerm *zapt, local_attr = local_attr->next) { int ord; + char ord_buf[32]; + int i, ord_len; ord = zebraExplain_lookupSU (zh->zei, attp.attset_ordinal, local_attr->local); @@ -838,8 +849,13 @@ static int field_term (ZebraHandle zh, Z_AttributesPlusTerm *zapt, term_dict[prefix_len++] = '|'; else term_dict[prefix_len++] = '('; - term_dict[prefix_len++] = 1; - term_dict[prefix_len++] = ord; + + ord_len = key_SU_code (ord, ord_buf); + for (i = 0; ierrCode = 113; return; } + /* prepare dictionary scanning */ before = pos-1; after = 1+num-pos; scan_info_array = odr_malloc (stream, ord_no * sizeof(*scan_info_array)); @@ -1752,7 +1769,8 @@ void rpn_scan (ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, sizeof(*scan_info->list)); for (j = 0; jlist[j].term = NULL; - termz[prefix_len++] = ords[i]; + + prefix_len += key_SU_code (ords[i], termz + prefix_len); termz[prefix_len++] = reg_id; termz[prefix_len] = 0; strcpy (scan_info->prefix, termz); @@ -1763,6 +1781,8 @@ void rpn_scan (ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, scan_handle); } glist = odr_malloc (stream, (before+after)*sizeof(*glist)); + + /* consider terms after main term */ for (i = 0; i < ord_no; i++) ptr[i] = before; @@ -1826,6 +1846,7 @@ void rpn_scan (ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, *is_partial = 1; } + /* consider terms before main term */ for (i = 0; i