Fix search for non-existing term with filters turned on.
authorkh1 <karsten.heimrich@digia.com>
Wed, 19 Dec 2012 16:33:17 +0000 (17:33 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 9 Jan 2013 11:40:24 +0000 (12:40 +0100)
Task-number: QTBUG-26733

In case we search with attributes, all fields including the actual
search term needs to match. Otherwise we will find all pages with
matching indexed filter attributes, but ignoring the search term...

Change-Id: I691afb839a4175e800ab71a40ead7963f3c54c31
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
src/assistant/help/qhelpsearchindexreader_clucene.cpp

index 1221b38..6bfcfe9 100644 (file)
@@ -269,7 +269,7 @@ bool QHelpSearchIndexReaderClucene::buildTryHarderQuery(
         return false;
     if (isNegativeQuery(query))
         return false;
-    if (!addDefaultQuery(query, fieldName, false, booleanQuery, analyzer))
+    if (!addDefaultQuery(query, fieldName, !filterAttributes.isEmpty(), booleanQuery, analyzer))
         return false;
     if (filterAttributes.isEmpty())
         return true;