diff options
Diffstat (limited to 'src/backend/utils/adt/tsquery.c')
-rw-r--r-- | src/backend/utils/adt/tsquery.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/backend/utils/adt/tsquery.c b/src/backend/utils/adt/tsquery.c index 257b5d33456..eea6e0eae17 100644 --- a/src/backend/utils/adt/tsquery.c +++ b/src/backend/utils/adt/tsquery.c @@ -16,12 +16,21 @@ #include "libpq/pqformat.h" #include "miscadmin.h" +#include "tsearch/ts_type.h" #include "tsearch/ts_locale.h" #include "tsearch/ts_utils.h" #include "utils/builtins.h" #include "utils/memutils.h" #include "utils/pg_crc.h" +/* FTS operator priorities, see ts_type.h */ +const int tsearch_op_priority[OP_COUNT] = +{ + 3, /* OP_NOT */ + 2, /* OP_AND */ + 1, /* OP_OR */ + 4 /* OP_PHRASE */ +}; struct TSQueryParserStateData { @@ -736,9 +745,6 @@ while( ( (inf)->cur - (inf)->buf ) + (addsize) + 1 >= (inf)->buflen ) \ (inf)->cur = (inf)->buf + len; \ } -#define PRINT_PRIORITY(x) \ - ( (QO_PRIORITY(x) == OP_NOT) ? OP_NOT_PHRASE : QO_PRIORITY(x) ) - /* * recursively traverse the tree and * print it in infix (human-readable) form |