shared: LooqsQuery: Fix logic of implicit AND booleans. Add 'limit:' support

Add implicit AND booleans at the end.

This fixes a number of issues in LooqsQuery:

(1) A query like a b c p:(something) would fail, because
a b c get merged into one word. This happens at the end.

lonewords are special and do not become a token immediatly. So previous
logic to add implicit ANDs does not apply.

(2) Negations were also broken with lonewords.

(3) The TokenType enum fields were too narrow to be useful for the bitmask

Independent of that, add support for 'limit:'
此提交包含在:
2022-06-04 23:12:58 +02:00
父節點 821bed6706
當前提交 a6ddcef0c0
共有 3 個檔案被更改,包括 45 行新增26 行删除

查看文件

@@ -4,24 +4,25 @@
enum TokenType
{
WORD,
NEGATION = 2,
BOOL = 4,
WORD = 8,
NEGATION = 16,
BOOL = 32,
BOOL_AND,
BOOL_OR,
GROUP = 8,
GROUP = 64,
BRACKET_OPEN,
BRACKET_CLOSE,
SORT = 16,
FILTER_PATH = 32,
SORT = 128,
FILTER_PATH = 256,
FILTER_PATH_MTIME,
FILTER_PATH_CONTAINS,
FILTER_PATH_SIZE,
FILTER_PATH_ENDS,
FILTER_PATH_STARTS,
FILTER_CONTENT = 64,
FILTER_CONTENT = 512,
FILTER_CONTENT_CONTAINS,
FILTER_CONTENT_PAGE,
LIMIT = 1024
};
class Token