From: kh1 Date: Wed, 19 Dec 2012 16:33:17 +0000 (+0100) Subject: Fix search for non-existing term with filters turned on. X-Git-Tag: accepted/tizen/20131212.181521~128^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fcfebaad4aa8ee1f2ce05a48005cb2b0b33a6ae2;p=platform%2Fupstream%2Fqttools.git Fix search for non-existing term with filters turned on. 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 --- diff --git a/src/assistant/help/qhelpsearchindexreader_clucene.cpp b/src/assistant/help/qhelpsearchindexreader_clucene.cpp index 1221b38..6bfcfe9 100644 --- a/src/assistant/help/qhelpsearchindexreader_clucene.cpp +++ b/src/assistant/help/qhelpsearchindexreader_clucene.cpp @@ -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;