Hi!

Imho the highlight method is supposed to return nil when nothing to
highlight is there. In this case just retrieve the content of the field
with result.name or doc[:name] if working with Ferret directly.

I just checked with a plain Ferret script and it had no problems
retrieving field contents that were just a stop word. If we don't
get this to work there might be an aaf bug, though ;-)

On Thu, Jun 07, 2007 at 04:54:57PM +0200, Jesse Grosjean wrote:
> I'm not really sure if this is a bug, but it makes my search results
> look a bit strange. I have an acts_as_ferret declaration that looks
> like:
> 
>   acts_as_ferret :store_class_name => true, :remote => true, :fields =>
> {
>         :ferret_name => { :store => :yes, :boost => 2 },
>         :ferret_content => { :store => :yes } }
> 
[..]
> Then when I do a search for 'rails' the result will be found, but the
> results highlighted_name will be blank. So I don't see the name of the
> model in the result. This seems to be a special case, because generally
> words like "about" and "the" that are skipped by the tokenizer will
> still be stored when :store => :yes when they are in a phrase.
> 
> I hope that makes some sense. For now I can get around the problem by
> checking for the blank case and loading the value from the model
> directly, but things would be easier if :store => :yes would just always
> store the field value.

What do you mean with 'loading the value directly'? 

If you used aaf's :lazy => true option when searching, aaf would by
default not query your db in the first place, and only do so if you ask
for a non-stored field.

You can read more about this feature there:
http://www.jkraemer.net/2007/3/26/lazy-loading-with-acts_as_ferret


> 
> Thanks for any help,
> Jesse
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ferret-talk mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/ferret-talk
> 

-- 
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
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to