[pmwiki-users] SearchExtensions

K.A.Bouton k.a.bouton at reading.ac.uk
Thu Jul 28 03:53:15 CDT 2005


I really appreciate your effort in this. We both get to learn something.

OK - downloaded new searchterms.php with changes in it (Thanks Patrick)

Cool - Almost there.
1) Searches seem to work but highlighting doesn't.
2) When search is conducted and results page comes up, sidebar searchbox
disappears leaving only 'searching wiki'
3) The search excludes don't seem to work so Sidebar which should be
excluded somes up in the searches
I have this in my farmconfig.php (also tried with no luck in
local/config.php)
    $SearchPatterns['default'][] 	= '!\\.SideBar$!';


> -----Original Message-----
> From: John Rankin [mailto:john.rankin at affinity.co.nz] 
> Sent: Thursday, July 28, 2005 2:15 AM
> To: pmwiki-users at pmichaud.com; K.A.Bouton
> Cc: pmichaud at pobox.com
> Subject: Re: [pmwiki-users] SearchExtensions
> 
> 
> On Thursday, 28 July 2005 1:57 AM, K.A.Bouton 
> <k.a.bouton at reading.ac.uk> wrote:
> >> Try downloading the latest version of search2.php from the
> >> Cookbook.SearchExtensions and see if that makes a difference.
> >
> >Done - and no it doesn't seem to make a difference unfortunately. In 
> >fact seems worse :)
> >
> >Here is the url
> >http://www.cgam.nerc.ac.uk/pmwiki/NMM
> >
> 
> I believe I might know what the problem is!
> 
> Are you using the searchterms recipe to highlight 
> search terms in the resulting pages?
> 
> If so, try changing 
> 
> $words[$w]++; to $words[preg_replace('/^.*?\\//','',$w)]++;
> 
> in the foreach(preg_split(... statement of that script.
> 
> The problem only occurs if the search term has a '/' in it. 
> This messes up the following statement: Markup('searchterms', 
> '>restore',
>   "/\\b($words)\\b(?![^<]*>)/i",
>   "<font class='searchterms'>$1</font>");
> 
> producing, for example
> 
>  pat=/\b(Main/comments)\b(?![^<]*>)/i
> 
> The / causes the pattern to end, and the c generates an 
> error. The search was for 'Main/comments'.
> 
> The proposed change removes any text up to and including a /.
> 
> >Curious if this is worth our effort if action=search is to be 
> >implemented which will do what I want - ie just get the 
> search results 
> >returned within the field it was searching
> 
> Well, if I am doing something wrong, I'd like to learn, so I 
> can avoid making the same mistake again in future. In this 
> case, I think it's the searchterms recipe that's 
> mis-interacting with the searchextensions.
> 
> If my hypothesis is correct, the problem will occur if a 
> regular search (using PmWiki's standard search feature) 
> includes a Group/ qualifier. I think.
> 
> Let me know how you get on.
> >
> >Anyway - willing until then
> >Katherine
> >
> >
> 
> 
> -- 
> JR
> --
> John Rankin
> 
> 
> 





More information about the pmwiki-users mailing list