projects
/
idzebra-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
051d21b
)
Fixed bug #169: Phrase term counts does not work. The bug exists in
author
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 5 Oct 2004 13:31:42 +0000
(13:31 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 5 Oct 2004 13:31:42 +0000
(13:31 +0000)
Zebra 1.3.16-1.3.18.
NEWS
patch
|
blob
|
history
rset/rsprox.c
patch
|
blob
|
history
diff --git
a/NEWS
b/NEWS
index
a3fca7d
..
99dbae7
100644
(file)
--- a/
NEWS
+++ b/
NEWS
@@
-1,4
+1,9
@@
+--- 1.3.19 2004/XX/YY
+
+Fixed bug #169: Phrase term counts does not work. The bug exists in
+Zebra 1.3.16-1.3.18.
+
Added mechanism to ignore leading articles when doing full-field indexing,
based on the character map files. See the manual for further discussion.
Added mechanism to ignore leading articles when doing full-field indexing,
based on the character map files. See the manual for further discussion.
diff --git
a/rset/rsprox.c
b/rset/rsprox.c
index
60f80ab
..
9876029
100644
(file)
--- a/
rset/rsprox.c
+++ b/
rset/rsprox.c
@@
-1,4
+1,4
@@
-/* $Id: rsprox.c,v 1.6 2004-08-04 09:59:03 heikki Exp $
+/* $Id: rsprox.c,v 1.5.2.1 2004-10-05 13:31:42 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
@@
-25,8
+25,8
@@
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include <string.h>
#include <assert.h>
#include <string.h>
#include <assert.h>
-#include <zebrautl.h>
#include <rsprox.h>
#include <rsprox.h>
+#include <zebrautl.h>
#ifndef RSET_DEBUG
#define RSET_DEBUG 0
#ifndef RSET_DEBUG
#define RSET_DEBUG 0
@@
-71,6
+71,8
@@
struct rset_prox_rfd {
char *more; /* more in each lookahead? */
struct rset_prox_rfd *next;
struct rset_prox_info *info;
char *more; /* more in each lookahead? */
struct rset_prox_rfd *next;
struct rset_prox_info *info;
+ int *countp;
+ char *pbuf;
};
static void *r_create (RSET ct, const struct rset_control *sel, void *parms)
};
static void *r_create (RSET ct, const struct rset_control *sel, void *parms)
@@
-126,6
+128,7
@@
static void *r_create (RSET ct, const struct rset_control *sel, void *parms)
ct->rset_terms[0] = rset_term_create (prox_term, length_prox_term,
flags, term_type);
ct->rset_terms[0] = rset_term_create (prox_term, length_prox_term,
flags, term_type);
+
return info;
}
return info;
}
@@
-159,6
+162,9
@@
static RSFD r_open (RSET ct, int flag)
for (i = 0; i < info->p.rset_no; i++)
rfd->more[i] = rset_read (info->p.rset[i], rfd->rfd[i],
rfd->buf[i], &dummy);
for (i = 0; i < info->p.rset_no; i++)
rfd->more[i] = rset_read (info->p.rset[i], rfd->rfd[i],
rfd->buf[i], &dummy);
+
+ rfd->countp = &ct->rset_terms[0]->count;
+ rfd->pbuf = xmalloc (info->p.key_size);
return rfd;
}
return rfd;
}
@@
-176,6
+182,8
@@
static void r_close (RSFD rfd)
xfree ((*rfdp)->buf);
xfree ((*rfdp)->more);
xfree ((*rfdp)->buf);
xfree ((*rfdp)->more);
+ xfree ((*rfdp)->pbuf);
+
for (i = 0; i<info->p.rset_no; i++)
rset_close (info->p.rset[i], (*rfdp)->rfd[i]);
xfree ((*rfdp)->rfd);
for (i = 0; i<info->p.rset_no; i++)
rset_close (info->p.rset[i], (*rfdp)->rfd[i]);
xfree ((*rfdp)->rfd);
@@
-286,6
+294,13
@@
static int r_forward (RSET ct, RSFD rfd, void *buf, int *term_index,
p->more[0] = rset_read (info->p.rset[0], p->rfd[0],
p->buf[0], &dummy);
p->more[0] = rset_read (info->p.rset[0], p->rfd[0],
p->buf[0], &dummy);
+
+ if (p->countp && (
+ *p->countp == 0 || (*info->p.cmp)(buf, p->pbuf) > 1))
+ {
+ memcpy (p->pbuf, buf, info->p.key_size);
+ (*p->countp)++;
+ }
return 1;
}
}
return 1;
}
}