aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2004-06-07 16:49:25 +0000
committerTeodor Sigaev <teodor@sigaev.ru>2004-06-07 16:49:25 +0000
commit144dc305541d031f0521eba8775216d35e973a5d (patch)
tree30ee466c2f3102e90930e21081d3a9f60ed12852
parent6122f38b0ad53ea4cf5ce42459b0149d639a03ae (diff)
downloadpostgresql-144dc305541d031f0521eba8775216d35e973a5d.tar.gz
postgresql-144dc305541d031f0521eba8775216d35e973a5d.zip
Remove asymetrical word processing in query and text
-rw-r--r--contrib/tsearch/query.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/contrib/tsearch/query.c b/contrib/tsearch/query.c
index 9d5e126c5bc..0e495eaaae1 100644
--- a/contrib/tsearch/query.c
+++ b/contrib/tsearch/query.c
@@ -232,9 +232,18 @@ pushval_morph(QPRS_STATE * state, int typeval, char *strval, int lenval)
lemm = lemmatize(token, &lenlemm, type);
if (lemm)
{
+ if ( lemm==token ) {
+ char *ptrs=token,*ptrd;
+ ptrd = lemm = palloc(lenlemm+1);
+ while(ptrs-token<lenlemm) {
+ *ptrd = tolower((unsigned char) *ptrs);
+ ptrs++;
+ ptrd++;
+ }
+ *ptrd='\0';
+ }
pushval_asis(state, VAL, lemm, lenlemm);
- if (lemm != token)
- pfree(lemm);
+ pfree(lemm);
}
else
pushval_asis(state, VALTRUE, 0, 0);