aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2009-08-18 10:30:41 +0000
committerTeodor Sigaev <teodor@sigaev.ru>2009-08-18 10:30:41 +0000
commita88a48011c00b6daa12e170f70b0b34cf9247113 (patch)
treec7ad23782b3c2aa3ce19bc04a81c97f394ab58de /src/backend
parent77dfb64df4c1e7f2662b0199971ff4af289cb00e (diff)
downloadpostgresql-a88a48011c00b6daa12e170f70b0b34cf9247113.tar.gz
postgresql-a88a48011c00b6daa12e170f70b0b34cf9247113.zip
Introduce filtering dictionary support to tsearch. Propagate --nolocale option
to CREATE DATABASE command in pg_regress to allow correct checking of locale-sensitive contrib modules.
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/tsearch/ts_parse.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/backend/tsearch/ts_parse.c b/src/backend/tsearch/ts_parse.c
index f503306aa00..e895761836b 100644
--- a/src/backend/tsearch/ts_parse.c
+++ b/src/backend/tsearch/ts_parse.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tsearch/ts_parse.c,v 1.13 2009/07/16 06:33:44 petere Exp $
+ * $PostgreSQL: pgsql/src/backend/tsearch/ts_parse.c,v 1.14 2009/08/18 10:30:41 teodor Exp $
*
*-------------------------------------------------------------------------
*/
@@ -29,7 +29,6 @@ typedef struct ParsedLex
int type;
char *lemm;
int lenlemm;
- bool resfollow;
struct ParsedLex *next;
} ParsedLex;
@@ -189,6 +188,8 @@ LexizeExec(LexizeData *ld, ParsedLex **correspondLexem)
while (ld->towork.head)
{
ParsedLex *curVal = ld->towork.head;
+ char *curValLemm = curVal->lemm;
+ int curValLenLemm = curVal->lenlemm;
map = ld->cfg->map + curVal->type;
@@ -208,8 +209,8 @@ LexizeExec(LexizeData *ld, ParsedLex **correspondLexem)
res = (TSLexeme *) DatumGetPointer(FunctionCall4(
&(dict->lexize),
PointerGetDatum(dict->dictData),
- PointerGetDatum(curVal->lemm),
- Int32GetDatum(curVal->lenlemm),
+ PointerGetDatum(curValLemm),
+ Int32GetDatum(curValLenLemm),
PointerGetDatum(&ld->dictState)
));
@@ -231,6 +232,13 @@ LexizeExec(LexizeData *ld, ParsedLex **correspondLexem)
if (!res) /* dictionary doesn't know this lexeme */
continue;
+ if ( res->flags & TSL_FILTER )
+ {
+ curValLemm = res->lexeme;
+ curValLenLemm = strlen(res->lexeme);
+ continue;
+ }
+
RemoveHead(ld);
setCorrLex(ld, correspondLexem);
return res;