[dokuwiki] Re: search improvements

  • From: Andreas Gohr <andi@xxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Fri, 25 Aug 2006 19:31:44 +0200

On Fri, 25 Aug 2006 12:53:24 +0100
Chris Smith <chris@xxxxxxxxxxxxx> wrote:

> I have sent a patch through to Andi which revamps the ft_snippet() 
> function. This function, or rather the preg_match_all() within it
> seems  to be the main factor in the search page execution time.

Great, this is one of the things I mentioned at the helpneeded page. I 
just had a look at your code and I really like it. One question I'm
not sure about: I noticed the use of some strlen calls there. Are they
used in a UTF-8 safe way there or would it be possible that they split a
multibyte char? If that could happen we should add a check to strip
invalid UTF-8 chars from beginning and end of the snippet - this would
be a nice addition to the utf-8 lib.

BTW: I didn't see any differences in the snippets generated by opt1 and
opt2. Do you have any ideas in which directions we should look to see if
there are problems?

Andi

-- 
http://www.splitbrain.org
-- 
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: