[pmwiki-users] improve the search

Roman romat2 at gmail.com
Tue Oct 14 04:34:28 CDT 2008


On Mon, Oct 13, 2008 at 06:37, Jorge Efrain Mamani C.
<efranet.bo at gmail.com>wrote:

> Since I can improve the search using the function removeaccents from PIT
> 00086  (http://www.pmwiki.org/wiki/PITS/00086). How i use this function?,
> where the inserted thing? and since do I it call?. Tks.
>

Thank you for pointing out to this PITS page, I was looking for solution of
this problem as well. At the end of this page Pm writes that it was solved
in 2.2.0b43. Changelog does not say anything about it so I downloaded
2.2.0b42 and 2.2.0b43, compared sources and found that since 2.2.0b43 it is
possible to redefine a function that is used for normalization of search
terms (strtolower by default).

I tried to put the following lines to config and it works (you have to
delete wiki.d/.pageindex file in so it could be recreated with deaccented
versions of search terms).

function removeaccents($string) {
return strtr(strtolower($string),
  'aáâaäaçeéeëiíîinoóôoöouúuüýy',
  'aaaaaaceeeeiiiinoooooouuuuyy');
}
$StrFoldFunction = 'removeaccents';

Depending on what cookbook recipes are used it may need some further work.
For example I use SortByScore and SearchTerms recipes that don't work
correctly with deaccented searches.

HTH, Roman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20081014/c8ab311f/attachment.html 


More information about the pmwiki-users mailing list