From 4b9677b925750d09eafd35ed02f3d36786718750 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 12 Oct 2006 12:28:42 +0000 Subject: [PATCH] Fixed bug #696: Less than Date searches returns unexpected hit count. --- index/index.h | 3 ++- index/rpnsearch.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/index/index.h b/index/index.h index 985e1b5..4997cfd 100644 --- a/index/index.h +++ b/index/index.h @@ -1,4 +1,4 @@ -/* $Id: index.h,v 1.178 2006-09-21 20:22:34 adam Exp $ +/* $Id: index.h,v 1.179 2006-10-12 12:28:42 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -469,6 +469,7 @@ ZEBRA_RES zapt_term_to_utf8(ZebraHandle zh, Z_AttributesPlusTerm *zapt, #define FIRST_IN_FIELD_STR "\001^" +#define FIRST_IN_FIELD_CHAR 1 #define FIRST_IN_FIELD_LEN 2 YAZ_END_CDECL diff --git a/index/rpnsearch.c b/index/rpnsearch.c index 909e9cc..3057580 100644 --- a/index/rpnsearch.c +++ b/index/rpnsearch.c @@ -1,4 +1,4 @@ -/* $Id: rpnsearch.c,v 1.1 2006-09-21 08:56:52 adam Exp $ +/* $Id: rpnsearch.c,v 1.2 2006-10-12 12:28:42 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -734,6 +734,10 @@ static int string_relation(ZebraHandle zh, Z_AttributesPlusTerm *zapt, *term_tmp++ = '['; *term_tmp++ = '^'; + + *term_tmp++ = 1; + *term_tmp++ = FIRST_IN_FIELD_CHAR; + string_rel_add_char(&term_tmp, term_component, &i); *term_tmp++ = '-'; @@ -746,6 +750,7 @@ static int string_relation(ZebraHandle zh, Z_AttributesPlusTerm *zapt, } *term_tmp++ = ')'; *term_tmp = '\0'; + yaz_log(YLOG_LOG, "term_dict=%s", term_dict); break; case 2: if (!term_100(zh->reg->zebra_maps, reg_type, @@ -764,6 +769,10 @@ static int string_relation(ZebraHandle zh, Z_AttributesPlusTerm *zapt, *term_tmp++ = '['; *term_tmp++ = '^'; + + *term_tmp++ = 1; + *term_tmp++ = FIRST_IN_FIELD_CHAR; + string_rel_add_char(&term_tmp, term_component, &i); *term_tmp++ = '-'; -- 1.7.10.4