summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2003-11-27 16:08:41 +0000
committerTeodor Sigaev <teodor@sigaev.ru>2003-11-27 16:08:41 +0000
commitf77c90b3dedcaa4646d36c84665c276aab2f5467 (patch)
treeb30faff80293ae323a2c9d46a9d76d361b59dd74
parent2312e20fb9781cab27656a5543e0cff8651883b7 (diff)
Fixes about word with several infiniteve
-rw-r--r--contrib/tsearch2/query.c2
-rw-r--r--contrib/tsearch2/tsvector.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/contrib/tsearch2/query.c b/contrib/tsearch2/query.c
index 458c55de279..c812f48b0d6 100644
--- a/contrib/tsearch2/query.c
+++ b/contrib/tsearch2/query.c
@@ -278,7 +278,7 @@ pushval_morph(QPRS_STATE * state, int typeval, char *strval, int lenval, int2 we
pushval_asis(state, VAL, prs.words[count].word, prs.words[count].len, weight);
pfree(prs.words[count].word);
if (count)
- pushquery(state, OPR, (int4) '&', 0, 0, 0);
+ pushquery(state, OPR, (int4) '|', 0, 0, 0);
}
pfree(prs.words);
diff --git a/contrib/tsearch2/tsvector.c b/contrib/tsearch2/tsvector.c
index c8002c0ab3f..ea50421eb73 100644
--- a/contrib/tsearch2/tsvector.c
+++ b/contrib/tsearch2/tsvector.c
@@ -635,8 +635,10 @@ uniqueWORD(WORD * a, int4 l)
res->alen *= 2;
res->pos.apos = (uint16 *) repalloc(res->pos.apos, sizeof(uint16) * res->alen);
}
- res->pos.apos[res->pos.apos[0] + 1] = LIMITPOS(ptr->pos.pos);
- res->pos.apos[0]++;
+ if ( res->pos.apos[0]==0 || res->pos.apos[res->pos.apos[0]] != LIMITPOS(ptr->pos.pos) ) {
+ res->pos.apos[res->pos.apos[0] + 1] = LIMITPOS(ptr->pos.pos);
+ res->pos.apos[0]++;
+ }
}
}
ptr++;