version=pmwiki-2.2.1 ordered=1 urlencoded=1 agent=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8 author=simon charset=ISO-8859-1 csum=remove link ctime=1150411168 description=A page for advanced and customized search options host=202.37.32.2 name=PmWiki.Search rev=117 targets=PmWiki.WikiTrails,PmWiki.PageLists,Site.PageListTemplates,Site.LocalTemplates,PmWiki.Search,Site.AllRecentChanges,Cookbook.Cookbook,PITS.PITS,Group.Name text=(:description A page for advanced and customized search options:)%0a(:Summary:Targeting and customising search results:)%0a(:if !equal {$Action} "search":)%0a>>rframe width=300pcx font-size=smaller%3c%3c%0a-%3c '''This page uses [[#example|custom]] searches.'''%0aFor regular searches, view another page.%0a>>%3c%3c%0aPmWiki provides a basic search function. While it is not powered by a "search engine", it can be tweaked to produce results that are ''targeted'' and ''customized.'' %0a%0a!!!! Targeted searches%0aSearches can be targeted to restrict the search to certain pages. For example, a search can be restricted based on groups, where, for instance, "group=PmWiki" searches only the PmWiki group, and "group=-PmWiki" searches only pages that are not in the PmWiki group. In addition to groups, searches can be restricted based on page names ("name="), [[wiki trails]] ("trail="), backlinks ("link=") and other criteria (e.g. "list=normal") and capped at a maximum number ("count="). For documentation about each of these parameters, see [[page lists]]. %0a%0a!!!! Customized display%0aThe display of search results can be customized to control the format, content and order of the returned results. Format and content are selected by using "fmt=" to specify a pagelist template that determines layout, such as list styles, and page elements, such as title and description. The "order=" option allows results to be sorted according to different criteria, such as name and title. For documentation about each of these parameters, see [[page lists]]. For examples of pagelist template formats see [[Site.Page List Templates]], (:if exists Site.LocalTemplates:)[[Site.Local Templates]],(:ifend:) and [[Cookbook:Pagelist Template Samples]].%0a%0a!!!! Anyone, anywhere%0a'''Readers''' can create targeted and customized search results simply by typing the relevant parameters , e.g. "group=PmWiki", into search boxes together with their search string. '''Authors''' can predefine such targeted and customized searches by incorporating the parameters into pages using the [@(:searchbox:)@] and [@(:searchresults:)@] directives (documented at [[PageLists]]).%0a%0a[@(:searchresults:)@] can be customized by editing page [@Site.Search@].%0a%0aSee also%0a* $PageSearchForm %0a* $SearchBoxOpt%0a* $SearchPatterns%0a%0a%0a[[#example]]%0a!!!!Try it: this page generates custom searches%0aAny search that is run from this page will automatically generate pre-defined sets of search results that: '''''target''''' different clusters of pages (documentation, cookbook and PITS, if available); use '''''customized''''' formats, content and ordering; and '''''reveal''''' the specific parameters used to generate each search result. Whether you use the search box below, or the regular search box that appears at the top of this page, any search that you run from this page will provide the customized results. %0a(:searchbox size=20:)%0a%0a%0a%0a(:ifend:)%0a(:if equal {$Action} "search":)%0a[[{$Name}|back]]\%0a%0a(:table border=0 width=100%25:)\%0a%0a(:cell width=30%25:)\%0a%0a!!!! [[Site/AllRecentChanges?q=PmWiki/+order%253Dname&action=search|All Documentation]]%0a(:searchresults group=PmWiki fmt=#onegroupdesc order=name:)%0a(:if expr exists Cookbook.Cookbook and equal {$Action} "search":)%0a(:cell width=35%25:)\%0a%0a!!!! [[Cookbook.Cookbook|All Cookbook Recipes]]%0a(:searchresults group=Cookbook fmt=#summary order=name:)%0a(:if expr exists PITS.PITS and equal {$Action} "search":)%0a(:cell width=35%25:)\%0a%0a!!!! [[PITS.PITS|PITS (Issue Tracking)]]%0a(:searchresults group=PITS fmt=#summary name=0* order=-name:)%0a(:if equal {$Action} "search":)%0a(:tableend:)%0a%0aNote: The strings that were used to target and format each search result are shown above in '''italics'' and can be entered directly into a regular search box.%0a%0a%0a(:title Search:)%0a(:if false:)%0a%0a[[#onegroupdesc]]%0a[[{=$Group}/{=$Name}]] %25font-size=smaller font-style=italic%25{=$Description}%25%25\\%0a[[#onegroupend]]%0a%0a[[#summary]]%0a[[{=$Group}/{=$Name}]] %25font-size=smaller font-style=italic%25{=$:Summary}%25%25\\%0a[[#summaryend]]%0a(:ifend:) time=1238621785 title=Search