You are here: Foswiki>Tasks Web>Item999 (24 Jun 2010, CrawfordCurrie)Edit Attach

Item999: Nested search does not result nothing, resulting in displaying an unwanted header

pencil
Priority: Normal
Current State: No Action Required
Released In:
Target Release:
Applies To: Engine
Component: Search
Branches:
Reported By: ArthurClemens
Waiting For:
Last Change By: CrawfordCurrie
If a simple SEARCH has a header parameter, the header is only shown when there are results.

If a SEARCH contains a nested $percntSEARCH{}$percnt, and that search does not return any results, the header is still displayed.

For example from Support web (modified to return no results for sure):

%SEARCH{
"   *\s*.*?"
topic="QuestionSubjectCategory"
web="Support"
type="regex"
multiple="on"
casesensitive="on"
nonoise="on"
header="---++ Answered but needs refactoring"
format="$percntSEARCH{ $quotQuestionForm.Status='XXXAnswered but needs refactoring' AND QuestionForm.Subject='$pattern(.*   \*\s*([^\n]*).*)'$quot excludetopic=$quotQuestionTemplate$quot web=$quotSupport$quot type=$quotquery$quot format=$quot   * [[$dollarweb.$dollartopic][$dollarformfield(TopicTitle)]]$quot order=$quotmodified$quot reverse=$quoton$quot nonoise=$quoton$quot header=$quot---+++ $pattern(.*   \*\s*([^\n]*).*)$quot}$percnt"
}%

results in:

Answered but needs refactoring

-- ArthurClemens - 05 Feb 2009

Judging from what I see in http://trunk.foswiki.org/bin/view/Tasks/Item999, this is fixed. Arthur, can you close it if you agree.

-- CrawfordCurrie - 06 Jun 2010

I am still seeing the header while there is no search result.

-- ArthurClemens - 06 Jun 2010

Oh right, sorry, I misread the report. Sven, anything you can do, or are we stuck with this behaviour?

-- CrawfordCurrie - 07 Jun 2010

this cannot be a bug. the outer SEARCH has found a result, which is why the inner $percentSEARCH is triggered - which also means that the outer header should be displayed.

IMO, there is no (current or consistent) way that the outer SEARCH should modify its behavior based on what happens inside its format

its the same as
SEARCH{
   "..."
   header="got something.."
   format="$formfield(not_there)"

in which case the header is also displayed.

-- SvenDowideit - 22 Jun 2010

OK, then I guess we have to have confidence in your convictions and no-action it.

-- CrawfordCurrie - 24 Jun 2010

ItemTemplate edit

Summary Nested search does not result nothing, resulting in displaying an unwanted header
ReportedBy ArthurClemens
Codebase
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component Search
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
ReleasedIn
Topic revision: r6 - 24 Jun 2010, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy