Hi!
On Mon, May 22, 2006 at 09:37:54AM +0200, Jan Prill wrote:
> Hi, Tom,
>
> haven't used this myself but if I understand
> http://projects.jkraemer.net/acts_as_ferret/rdoc/classes/FerretMixin/Acts/ARFerret/ClassMethods.html#M000005correctly
> you are able to add symbols of your instance methods to the fields
> of the options hash of acts_as_ferret:
>
> "fields:names all fields to include in the index. If not given,
>
> all attributes of the class will be indexed. You may also give
> symbols pointing to instance methods of your model here, i.e.
> to retrieve and index data from a related model.
> "
right, just use the method name as a symbol in the fields list:
class MyModel < ActiveRecord::Base
acts_as_ferret :fields => [ :full_text, 'title' ]
def full_text
# return content to be indexed here
end
end
where title is a normal database backed attribute.
Cheers,
Jens
> On 5/22/06, Tom <[EMAIL PROTECTED]> wrote:
> >
> >Hi,
> >
> >One of the AAF features is to be able to index results of methods, but I
> >haven't seen anywhere how to do this. I have a method that returns the
> >full text of a file and I'd like for this to be indexed. Can anyone out
> >there help me out on this one?
> >
> >Tom
> >
> >--
> >Posted via http://www.ruby-forum.com/.
> >_______________________________________________
> >Ferret-talk mailing list
> >[email protected]
> >http://rubyforge.org/mailman/listinfo/ferret-talk
> >
> _______________________________________________
> Ferret-talk mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/ferret-talk
--
webit! Gesellschaft für neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer [EMAIL PROTECTED]
Schnorrstraße 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk