[Pmwiki-users] 0.6-beta -- possible change to search results

John Rankin john.rankin
Mon Jan 26 13:39:27 CST 2004


On Tuesday, 27 January 2004 3:49 AM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>On Mon, Jan 26, 2004 at 04:21:37PM +1300, John Rankin wrote:
>> 
>> One of the features of the previous version of [[$Search]] is that the
>> search results display as if from that page name and hence group name.
>> So adding a group-restricted search box to the search results page means
>> the search is restricted to the original search group. However, with the new
>> scheme, the first search will be restricted to the originating group, say
>> PmWiki/, whereas subsequent searches would be restricted to
>the Main/ group.
>
>Wouldn't have to be.  [[$Search]] (or some other tag such as [[$Searchgroup]])
>can now easily be defined to restrict the search to the group used in the 
>previous search:
>
>  $SearchTagFmt = "<form action='\$ScriptUrl/$SearchPageFmt' method='get'>
>    <input type='hidden' name='group' value='\$SearchGroup' />
>    <input type='text' name='text' value='\$Needle' size='40' />
>    <input type='submit' value='$[Search]' /></form>";
>
>The search.php code automatically sets $SearchGroup and $Needle based
>on the contents of the text= and group= parameters to the page.
>

Very nice. I like it.

...
>
>> Cool. But why is it [[$Searchresults text]] and not (say) [[search text]]?
>> It looks to me more like a directive (cf [[include:...]])
>than a variable.
>
>I was staying parallel with [[$Search]], but you're correct that a
>[[search:]] syntax might be more consistent.  Or are you suggesting there
>should be both a [[$Searchresults]] and a [[search:text]]?  I'll have to 
>think on this one... :-)

I think 2 separate [[...]] gives more flexibility.

If I understand your thinking correctly, [[$Search]] and [[$Searchresults]]
are effectively "paired". Following Scott's suggestion, I might write

   [[$Search:SomePage]]

and pressing 'Search' takes me to SomePage, which (we hope!) contains 

   [[$Searchresults]]

OTOH

   [[search:text]]

lets an author pre-specify a search to be carried out, as part of a page's 
normal content. Like:

   [[search:[[$Group]]/]]

to generate an index of all the pages in a group.

It seems to me that these are 2 distinct functions. Separating them also
makes it easier to use different output formats.

JR

>
>Pm
>
>-- 
>Pmwiki-users mailing list
>Pmwiki-users at pmichaud.com
>http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com
>


-- 
JR
--
John Rankin





More information about the pmwiki-users mailing list