diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2003-11-27 16:04:40 +0000 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2003-11-27 16:04:40 +0000 |
commit | baeab89de63ab0f74266481954ee3c0825714ff3 (patch) | |
tree | a2b7c2e9fc7d995cc17344c86762c513e76e88d0 | |
parent | 9ea738827c142f0a8400ab962a285c1961822c7b (diff) | |
download | postgresql-baeab89de63ab0f74266481954ee3c0825714ff3.tar.gz postgresql-baeab89de63ab0f74266481954ee3c0825714ff3.zip |
Fixes about word with several infiniteve
-rw-r--r-- | contrib/tsearch2/query.c | 2 | ||||
-rw-r--r-- | contrib/tsearch2/tsvector.c | 6 |
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++; |