Recent Changes - Search:

PmWiki

pmwiki.org

Search-Talk

This is a talk page for improving Search.


The documentation says "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."

I want searches entered in the top search box to produce the normal results, while searches entered in the custom search box to produce the customized results. But how? - RandyB November 13, 2013, at 08:59 AM

The customized results at Search are not done via (:searchbox :) directives, but by markup that handles the ?action=search directive.

Both searchboxes are "vanilla" searchboxes -- the customization comes in the page-markup.

To build a searchbox that provides custom twiddling, see the (:searchbox:) section at PageLists

MichaelPaulukonis November 13, 2013, at 02:47 PM

Thanks. This helped. I was looking for an unusual amount of control over the page body's searchbox results, with page formatting beyond the formatting of results dependent on whether the user entered the query into the normal searchbox in the page's header, or into the special searchbox in the page's body. In case this helps others: The solution I'm using for now is to specify in the special searchbox a parameter such as count=9999, which is unlikely to be entered by the user into the page header's search box query. Then before reaching the searchresults on the page I check the value of the count query in the URL, using the Request recipe. If it's the default value that I specified in the page body's searchbox, I know the user probably entered the query in the special search box, and can process the page accordingly. RandyB November 13, 2013, at 10:47 PM

Randy - it might be useful for others if you write that up as a recipe. MichaelPaulukonis November 14, 2013, at 03:40 PM

Done. See Cookbook:SearchboxRecognition - RandyB November 14, 2013, at 10:01 PM


Is there any way to search for A or B or C?

simon July 02, 2012, at 04:07 AM

No. --Petko October 06, 2012, at 07:24 PM


How can the searchbox be embedded in a line of text?

this should be on one line
[[{*$Group}/Recent changes]] - [[Site/Search | $[Search]]]: (:searchbox
target=PmWiki/Search-Talk size=16 wrap=none:)
Recent changes - Search:
[[{*$Group}/Recent changes]] - [[Site/Search | $[Search]]]: (:searchbox
target=PmWiki/Search-Talk size=16 wrap=inline:)
Recent changes - Search:
simon October 06, 2012, at 04:59 PM

Normally, a HTML <form> is a block level element like a <div> so it is usually on a new line. You may be able to use some CSS like display:inline or float:left to let it be on the same line.

this should be on one line
>>float:left<<
before &nbsp;
>>float:left<<
(:searchbox size=16:)
>><<
&nbsp; after

before  

  after

You could add some CSS rules to your local.css file. --Petko October 06, 2012, at 07:24 PM

This was an attempt to place the code from pmwiki.tmpl into a wiki page.[1]

(:input form action='{$ScriptUrl}/PmWiki/Search-Talk':)
[[{*$Group}/Recent changes]] - 
(:input hidden name='n' value='PmWiki/Search-Talk' :)
(:input hidden name='action' value='search' :)
[[PmWiki/Search-Talk | $[Search]]]: 
(:input text name='q' value='' class='inputbox searchbox smaller' :)
(:input submit class='inputbutton searchbutton' value='$[Search]' :)
(:input end:)

Recent changes - Search:

and then it occurred to me it would make more sense to use the searchbox directive.


How to suppress 'Results from' message
(:searchresults req=1 request=1:)

Is it possible to make searches accent insensitive?, eg "Te Tāhuhu" and "te tahuhu" return the same search result?

simon November 26, 2013, at 03:15 PM

You can define your own $StrFoldFunction, something like this:

  $StrFoldFunction = 'MyFoldFunc';
  function MyFoldFunc($str) {
    $str = utf8fold($str);   # if using UTF-8
    $str = strtolower($str); # if not using UTF-8

    $letters = array('ā'=>'a', 'é'=>'e', ); # etc., all letters
    # note: save the file with the encoding of the wiki (utf-8 or cp1252)

    return str_replace(array_keys($letters),array_values($letters),$str);
  }

Then delete the file wiki.d/.pageindex. That should do it.

Note that for this to work, these characters need to be stored as characters in your wiki source text, not as HTML entities like T&#257;huhu. And they will be stored as entities if your wiki is in an encoding that doesn't contain them, like Windows-1252. The encoding UTF-8 supports all characters. --Petko November 26, 2013, at 03:53 PM


This is a talk page for improving PmWiki.Search.

Edit - History - Print - Recent Changes - Search
Page last modified on November 26, 2013, at 03:53 PM