Highlight slowness

Has anyone else found that using ferret’s highlighting slows searches
down significantly? I am seeing that it more than doubles the search
time on my system. I am returning up to 500 results at once, so the
slow down is quite noticeable (probably adding about .7 seconds for
searches with large result sets.)
–Paul

Paul L. wrote:

Has anyone else found that using ferret’s highlighting slows searches
down significantly? I am seeing that it more than doubles the search
time on my system. I am returning up to 500 results at once, so the
slow down is quite noticeable (probably adding about .7 seconds for
searches with large result sets.)
–Paul

Are you using lazy loading? If so the problem might be that you are not
loading anything from your database when doing non-highlight searches
(good! fast), but you are when you do a highlight search (bad! slow)

Or that might not have anything to do with it, I’m still learning ferret
and rails.

See this post:

http://www.ruby-forum.com/topic/111027#264368

Jesse

Paul L. wrote:

Has anyone else found that using ferret’s highlighting slows searches
down significantly? I am seeing that it more than doubles the search
time on my system. I am returning up to 500 results at once, so the
slow down is quite noticeable (probably adding about .7 seconds for
searches with large result sets.)
–Paul

Hello Paul,

I got the same problem.

highlighting performance are based on the tolerance you selected.
Example for me :

QUERY~1 is fast. < 10 ms
QUERY~0.9 is slower. < 50 ms
QUERY~0.8 is slow. = 1 sec
QUERY~0.7 is very slow. > 2 sec

If anyone have a solution to speed it up, i would appreciate too.

Here how i do highlighting

in my model :
acts_as_ferret :fields => { :content => {:store => :yes}, :title =>
{:store => :yes}}

results = list.find_by_contents(“QUERY~7”, options)

In my view :
<% results[0].highlight(“QUERY~7”, :field => :content,… ) -%>

Is there a way to make it faster without changing the tolerance factor ?
( ~7 in this example )

On Tue, Jul 03, 2007 at 07:02:26PM +0200, Landanger Pierre-Yves wrote:

In my view :
<% results[0].highlight(“QUERY~7”, :field => :content,… ) -%>

Is there a way to make it faster without changing the tolerance factor ?
( ~7 in this example )

I could imagine that doing the highlighting right inside
find_by_contents could speed up things quite a bit, maybe something
like:

results = list.find_by_contents(“QUERY~7”, :highlight => { :field =>
:content })

I’d happily apply a patch for this, or just file it as a feature request
in aaf’s Trac :wink:

Jens


Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa