LooqsQuery: Add hasContentSearch(),hasPathSearch() convenience functions
Dieser Commit ist enthalten in:
Ursprung
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);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren