LooqsQuery: Add hasContentSearch(),hasPathSearch() convenience functions
Esse commit está contido em:
pai
1f35e2120e
commit
c0657947b1
@ -23,6 +23,16 @@ QueryType LooqsQuery::getQueryType()
|
||||
return static_cast<QueryType>(tokensMask & COMBINED);
|
||||
}
|
||||
|
||||
bool LooqsQuery::hasContentSearch()
|
||||
{
|
||||
return (this->getTokensMask() & FILTER_CONTENT) == FILTER_CONTENT;
|
||||
}
|
||||
|
||||
bool LooqsQuery::hasPathSearch()
|
||||
{
|
||||
return (this->getTokensMask() & FILTER_PATH) == FILTER_PATH;
|
||||
}
|
||||
|
||||
void LooqsQuery::addSortCondition(SortCondition sc)
|
||||
{
|
||||
this->sortConditions.append(sc);
|
||||
@ -312,7 +322,7 @@ LooqsQuery LooqsQuery::build(QString expression, TokenType loneWordsTokenType, b
|
||||
}
|
||||
}
|
||||
|
||||
bool contentsearch = (result.getTokensMask() & FILTER_CONTENT) == FILTER_CONTENT;
|
||||
bool contentsearch = result.hasContentSearch();
|
||||
bool sortsForContent = std::any_of(result.sortConditions.begin(), result.sortConditions.end(),
|
||||
[](SortCondition c) { return c.field == CONTENT_TEXT; });
|
||||
|
||||
|
@ -52,6 +52,9 @@ class LooqsQuery
|
||||
{
|
||||
return tokensMask;
|
||||
}
|
||||
bool hasContentSearch();
|
||||
bool hasPathSearch();
|
||||
|
||||
void addSortCondition(SortCondition sc);
|
||||
static bool checkParanthesis(QString query);
|
||||
static LooqsQuery build(QString query, TokenType loneWordsTokenType, bool mergeLoneWords);
|
||||
|
Carregando…
Referência em uma nova issue
Block a user