summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/tsgistidx.c
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2016-06-27 20:47:32 +0300
committerTeodor Sigaev <teodor@sigaev.ru>2016-06-27 20:47:32 +0300
commit3dbbd0f02a257d8d5c4cba14726371505f2e7266 (patch)
tree70a9fec2e68e357c361cb92f91367651b46f6bde /src/backend/utils/adt/tsgistidx.c
parent028350f619f7688e0453fcd2c4b25abe9ba30fa7 (diff)
downloadpostgresql-3dbbd0f02a257d8d5c4cba14726371505f2e7266.tar.gz
Do not fallback to AND for FTS phrase operator.
If there is no positional information of lexemes then phrase operator will not fallback to AND operator. This change makes needing to modify TS_execute() interface, because somewhere (in indexes, for example) positional information is unaccesible and in this cases we need to force fallback to AND. Per discussion c19fcfec308e6ccd952cdde9e648b505@mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/tsgistidx.c')
-rw-r--r--src/backend/utils/adt/tsgistidx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/utils/adt/tsgistidx.c b/src/backend/utils/adt/tsgistidx.c
index cdd5d43fce..6cdfb13f6d 100644
--- a/src/backend/utils/adt/tsgistidx.c
+++ b/src/backend/utils/adt/tsgistidx.c
@@ -361,7 +361,8 @@ gtsvector_consistent(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(TS_execute(
GETQUERY(query),
- (void *) GETSIGN(key), false,
+ (void *) GETSIGN(key),
+ TS_EXEC_PHRASE_AS_AND,
checkcondition_bit
));
}
@@ -373,7 +374,8 @@ gtsvector_consistent(PG_FUNCTION_ARGS)
chkval.arre = chkval.arrb + ARRNELEM(key);
PG_RETURN_BOOL(TS_execute(
GETQUERY(query),
- (void *) &chkval, true,
+ (void *) &chkval,
+ TS_EXEC_PHRASE_AS_AND | TS_EXEC_CALC_NOT,
checkcondition_arr
));
}