From: Adam Dickmeiss Date: Fri, 13 Oct 1995 16:01:49 +0000 (+0000) Subject: Work on relations. X-Git-Tag: ZEBRA.1.0~700 X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=commitdiff_plain;h=2c7c2ca460fee75f3bebc0479b9787f0c401db03 Work on relations. --- diff --git a/index/index.h b/index/index.h index ece96af..6ac14c2 100644 --- a/index/index.h +++ b/index/index.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: index.h,v $ - * Revision 1.16 1995-10-10 12:24:38 adam + * Revision 1.17 1995-10-13 16:01:49 adam + * Work on relations. + * + * Revision 1.16 1995/10/10 12:24:38 adam * Temporary sort files are compressed. * * Revision 1.15 1995/10/04 16:57:19 adam @@ -66,8 +69,8 @@ #define IT_KEY_HAVE_FIELD 0 struct it_key { - int sysno : 24; - int seqno : 16; + int sysno; + int seqno; }; struct dir_entry { diff --git a/index/zrpn.c b/index/zrpn.c index 5b50a4f..fb9ad2e 100644 --- a/index/zrpn.c +++ b/index/zrpn.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zrpn.c,v $ - * Revision 1.28 1995-10-13 12:26:43 adam + * Revision 1.29 1995-10-13 16:01:49 adam + * Work on relations. + * + * Revision 1.28 1995/10/13 12:26:43 adam * Optimization of truncation. * * Revision 1.27 1995/10/12 17:07:22 adam @@ -496,17 +499,60 @@ static int grep_handle (Dict_char *name, const char *info, void *p) return 0; } +static void gen_regular_ge (char *dst, int val) +{ + int dst_p = 0; + int w = 1; + int d; + int pos = 0; + int i; + + if (val < 0) + val = 0; + while ((d=(val % (w*10))/w)) + { + sprintf (dst + dst_p, "%d", val); + + dst_p = strlen(dst) - pos - 1; + + dst[dst_p++] = '['; + dst[dst_p++] = d +'1'; + dst[dst_p++] = '-'; + dst[dst_p++] = '9'; + dst[dst_p++] = ']'; + + for (i = 0; ierrCode = 114; return -1; } - + switch (relation_value) + { + case 1: + case 2: + break; + case 4: + logf (LOG_LOG, "Relation ge"); + gen_regular_ge (term_dict + strlen(term_dict), atoi(term_sub)); + logf (LOG_LOG, "dict_lookup_grep: %s", term_dict); + dict_lookup_grep (zi->wordDict, term_dict, 0, grep_info, grep_handle); + logf (LOG_LOG, "%d positions", grep_info->isam_p_indx); + return 0; + case 5: + logf (LOG_LOG, "Relation gt"); + gen_regular_ge (term_dict + strlen(term_dict), atoi(term_sub)+1); + logf (LOG_LOG, "dict_lookup_grep: %s", term_dict); + dict_lookup_grep (zi->wordDict, term_dict, 0, grep_info, grep_handle); + logf (LOG_LOG, "%d positions", grep_info->isam_p_indx); + return 0; + } switch (truncation_value) { case -1: /* not specified */ @@ -562,7 +630,7 @@ static int trunc_term (ZServerInfo *zi, Z_AttributesPlusTerm *zapt, dict_lookup_grep (zi->wordDict, term_dict, 0, grep_info, grep_handle); break; } - logf (LOG_DEBUG, "%d positions", grep_info->isam_p_indx); + logf (LOG_LOG, "%d positions", grep_info->isam_p_indx); return 0; } @@ -851,7 +919,6 @@ static RSET rpn_search_APT_local (ZServerInfo *zi, Z_AttributesPlusTerm *zapt, return result; } - static RSET rpn_search_APT (ZServerInfo *zi, Z_AttributesPlusTerm *zapt, oid_value attributeSet) {