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

Commitf9c50e9

Browse files
committed
Fix triconsistent method support for phrase search
1 parent6967b76 commitf9c50e9

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

‎src/backend/utils/adt/tsginidx.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ checkcondition_gin(void *checkval, QueryOperand *val, ExecPhraseData *data)
207207
*/
208208
staticGinTernaryValue
209209
TS_execute_ternary(QueryItem*curitem,void*checkval,
210-
GinTernaryValue (*chkcond) (void*checkval,QueryOperand*val))
210+
GinTernaryValue (*chkcond) (void*,QueryOperand*,ExecPhraseData*))
211211
{
212212
GinTernaryValueval1,
213213
val2,
@@ -217,7 +217,8 @@ TS_execute_ternary(QueryItem *curitem, void *checkval,
217217
check_stack_depth();
218218

219219
if (curitem->type==QI_VAL)
220-
returnchkcond(checkval, (QueryOperand*)curitem);
220+
returnchkcond(checkval, (QueryOperand*)curitem,
221+
NULL/* we don't need a position infos */);
221222

222223
switch (curitem->qoperator.oper)
223224
{
@@ -227,6 +228,13 @@ TS_execute_ternary(QueryItem *curitem, void *checkval,
227228
returnresult;
228229
return !result;
229230

231+
caseOP_PHRASE:
232+
/*
233+
* GIN doesn't contain any information about postions,
234+
* treat OP_PHRASE as OP_AND with recheck requirement
235+
*/
236+
*((GinChkVal*)checkval)->need_recheck= true;
237+
230238
caseOP_AND:
231239
val1=TS_execute_ternary(curitem+curitem->qoperator.left,
232240
checkval,chkcond);

‎src/backend/utils/adt/tsvector_op.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ checkcondition_str(void *checkval, QueryOperand *val, ExecPhraseData *data)
795795
*/
796796
staticbool
797797
TS_phrase_execute(QueryItem*curitem,void*checkval,boolcalcnot,ExecPhraseData*data,
798-
bool (*chkcond) (void*checkval,QueryOperand*val,ExecPhraseData*data))
798+
bool (*chkcond) (void*,QueryOperand*,ExecPhraseData*))
799799
{
800800
/* since this function recurses, it could be driven to stack overflow */
801801
check_stack_depth();
@@ -806,8 +806,8 @@ TS_phrase_execute(QueryItem *curitem, void *checkval, bool calcnot, ExecPhraseDa
806806
}
807807
else
808808
{
809-
ExecPhraseDataLdata= {0,NULL, false},
810-
Rdata= {0,NULL, false};
809+
ExecPhraseDataLdata= {0,false,NULL},
810+
Rdata= {0,false,NULL};
811811
WordEntryPos*Lpos,
812812
*Rpos,
813813
*pos=NULL;
@@ -933,7 +933,7 @@ TS_execute(QueryItem *curitem, void *checkval, bool calcnot,
933933
check_stack_depth();
934934

935935
if (curitem->type==QI_VAL)
936-
returnchkcond(checkval, (QueryOperand*)curitem,
936+
returnchkcond(checkval, (QueryOperand*)curitem,
937937
NULL/* we don't need a position infos */);
938938

939939
switch (curitem->qoperator.oper)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp