Henrik Zagerholm wrote:
> As there is still some large file support bugs in the 0.11.4 release  
> I had to download the trunk and apply a patch sent in by kyle http:// 
> ferret.davebalmain.com/trac/ticket/215.
> 
> The problem is now that the highlighting doesn't work.
> 
> Somehow it combines excerpt_length with num_excerpts so if you have  
> and excerpt_length of 50 and num_excerpts of 5 and you get only one  
> hit when searching the excerpts is either the whole text or 50*5 = 250.
> 
> So everytime you get a result with less hits than num_excerpts the  
> highlighting goes crazy.

I've had the same problem with the large file patch.  I couldn't figure 
out a fix, but I worked around it by trimming the excerpts to the last 
150 characters:

       highlights.collect do |excerpt|
         if excerpt.length <= 150
           excerpt
         else
           excerpt[-150..-1]
         end
       end

This is ugly, and it chops up words, but it seems to work.

I wondered if this might have something to do with Ferret's low-level IO 
routines: is_read_u64, os_read_u64, is_read_u32, etc.  Maybe the wrong 
ones are being used for reading and writing the offsets in the segment 
file, now that Kyle's patch has changed the offsets from type int to 
type offset_t.

-Stuart Sierra
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to