LooqsQuery::build(): Ensure values are non-empty and ignore empty lone words
This commit is contained in:
parent
404ce22ce6
commit
1f35e2120e
@ -251,6 +251,10 @@ LooqsQuery LooqsQuery::build(QString expression, TokenType loneWordsTokenType, b
|
|||||||
{
|
{
|
||||||
value = m.captured("args");
|
value = m.captured("args");
|
||||||
}
|
}
|
||||||
|
if(value == "")
|
||||||
|
{
|
||||||
|
throw LooqsGeneralException("value cannot be empty for filters");
|
||||||
|
}
|
||||||
|
|
||||||
if(filtername == "path.contains")
|
if(filtername == "path.contains")
|
||||||
{
|
{
|
||||||
@ -301,7 +305,11 @@ LooqsQuery LooqsQuery::build(QString expression, TokenType loneWordsTokenType, b
|
|||||||
|
|
||||||
if(mergeLoneWords)
|
if(mergeLoneWords)
|
||||||
{
|
{
|
||||||
result.addToken(Token(loneWordsTokenType, loneWords.join(' ')));
|
QString mergedLoneWords = loneWords.join(' ');
|
||||||
|
if(!mergedLoneWords.isEmpty())
|
||||||
|
{
|
||||||
|
result.addToken(Token(loneWordsTokenType, mergedLoneWords));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool contentsearch = (result.getTokensMask() & FILTER_CONTENT) == FILTER_CONTENT;
|
bool contentsearch = (result.getTokensMask() & FILTER_CONTENT) == FILTER_CONTENT;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user