Hello list, 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. Comments, Fixes, Patches are all welcome :) Cheers, Henrik
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
8 aug 2007 kl. 17:33 skrev Stuart Sierra:> 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.Thanks for the info. Now I know I''m not the only one experience this problem. =) Thanks for code sharing. I''ll probably do something similar until this is fixed. It would be nice to get Dave''s input on this but it seems he disappeared from the face of the earth. Thanks, Henrik> > -Stuart Sierra > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk