From 3dbbd0f02a257d8d5c4cba14726371505f2e7266 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Mon, 27 Jun 2016 20:47:32 +0300 Subject: 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 --- src/backend/utils/adt/tsgistidx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/tsgistidx.c') diff --git a/src/backend/utils/adt/tsgistidx.c b/src/backend/utils/adt/tsgistidx.c index cdd5d43fce5..6cdfb13f6d1 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 )); } -- cgit v1.2.3