Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite25a6e1

Browse files
committed
Remove asymetrical word processing in query and text
1 parent613c684 commite25a6e1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎contrib/tsearch/query.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,18 @@ pushval_morph(QPRS_STATE * state, int typeval, char *strval, int lenval)
240240
lemm=lemmatize(token,&lenlemm,type);
241241
if (lemm)
242242
{
243+
if (lemm==token ) {
244+
char*ptrs=token,*ptrd;
245+
ptrd=lemm=palloc(lenlemm+1);
246+
while(ptrs-token<lenlemm) {
247+
*ptrd=tolower((unsignedchar)*ptrs);
248+
ptrs++;
249+
ptrd++;
250+
}
251+
*ptrd='\0';
252+
}
243253
pushval_asis(state,VAL,lemm,lenlemm);
244-
if (lemm!=token)
245-
pfree(lemm);
254+
pfree(lemm);
246255
}
247256
else
248257
pushval_asis(state,VALTRUE,0,0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp