diff options
| author | Teodor Sigaev | 2016-06-27 17:47:32 +0000 |
|---|---|---|
| committer | Teodor Sigaev | 2016-06-27 17:47:32 +0000 |
| commit | 3dbbd0f02a257d8d5c4cba14726371505f2e7266 (patch) | |
| tree | 70a9fec2e68e357c361cb92f91367651b46f6bde /src/include | |
| parent | 028350f619f7688e0453fcd2c4b25abe9ba30fa7 (diff) | |
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/include')
| -rw-r--r-- | src/include/tsearch/ts_utils.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/include/tsearch/ts_utils.h b/src/include/tsearch/ts_utils.h index e16ddaf72f4..e09a9c636f9 100644 --- a/src/include/tsearch/ts_utils.h +++ b/src/include/tsearch/ts_utils.h @@ -111,8 +111,25 @@ typedef struct ExecPhraseData WordEntryPos *pos; } ExecPhraseData; -extern bool TS_execute(QueryItem *curitem, void *checkval, bool calcnot, +/* + * Evaluates tsquery, flags are followe below + */ +extern bool TS_execute(QueryItem *curitem, void *checkval, uint32 flags, bool (*chkcond) (void *, QueryOperand *, ExecPhraseData *)); + +#define TS_EXEC_EMPTY (0x00) +/* + * if TS_EXEC_CALC_NOT is not set then NOT expression evaluated to be true, + * used in cases where NOT cannot be accurately computed (GiST) or + * it isn't important (ranking) + */ +#define TS_EXEC_CALC_NOT (0x01) +/* + * Treat OP_PHRASE as OP_AND. Used when posiotional information is not + * accessible, like in consistent methods of GIN/GiST indexes + */ +#define TS_EXEC_PHRASE_AS_AND (0x02) + extern bool tsquery_requires_match(QueryItem *curitem); /* |
