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:'
This commit is contained in:
@ -40,6 +40,7 @@ class LooqsQuery
|
||||
/* Helper field to determine quertype as well as to quickly check what kind of filters etc.
|
||||
* are being used in this query*/
|
||||
int tokensMask = 0;
|
||||
int limit = -1;
|
||||
QVector<Token> tokens;
|
||||
QVector<SortCondition> sortConditions;
|
||||
void addToken(Token t);
|
||||
@ -52,6 +53,14 @@ class LooqsQuery
|
||||
{
|
||||
return tokensMask;
|
||||
}
|
||||
int getLimit() const
|
||||
{
|
||||
return limit;
|
||||
}
|
||||
void setLimit(int limit)
|
||||
{
|
||||
this->limit = limit;
|
||||
}
|
||||
bool hasContentSearch();
|
||||
bool hasPathSearch();
|
||||
|
||||
|
Reference in New Issue
Block a user