projects
/
postgresql
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
613c684
)
Remove asymetrical word processing in query and text
author
Teodor Sigaev
<teodor@sigaev.ru>
Mon, 7 Jun 2004 16:48:18 +0000
(16:48 +0000)
committer
Teodor Sigaev
<teodor@sigaev.ru>
Mon, 7 Jun 2004 16:48:18 +0000
(16:48 +0000)
contrib/tsearch/query.c
patch
|
blob
|
history
diff --git
a/contrib/tsearch/query.c
b/contrib/tsearch/query.c
index bcf2e0d83c47e95974d9a2e8d6dbe3188e74e538..88b7f7e4cb236f372ab6ac48a37889624f8daeb5 100644
(file)
--- a/
contrib/tsearch/query.c
+++ b/
contrib/tsearch/query.c
@@
-240,9
+240,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);