Searching has_many with UltraSphinx

I’m switching from ferret to ultrasphinx… in ferret I used to search
tags for a model by just including the tag_string method in the list of
fields and implementing this method:

def tag_string",")

Does anyone know how to get at this kind of info using sphinx? My
huntch is
that it needs to use the ;include syntax somehow.


I’m also switching from Ferret to Ultrasphinx. I was using
acts_as_taggable to search tags for Product models.
Now I’m getting a “FATAL: no sources found in config file” error when
I try to “rake ultrasphinx:index”.
I am suspecting this is due to the fact that I tried writing
“is_indexed :fields => [:tag_list]” in my Product model.
Any ideas?

To index your model with tagging, check the post from ‘Allan Riley’ on
March 29 2008 here:

Hope that helps!

Kiranatama - a Ruby on Rails
outsourcing company

which is also covered in the link KiranaTama posted…

Check out the :concatenate parameter of :is_indexed (http://
Base.html). We wanted to treat the tags as a single text field and to
do that you need to write some custom sql but here’s what we’re using:

class Product
is_indexed :fields => [‘name’, ‘description’],
:concatenate => [{ :class_name => ‘Tag’, :field =>
‘name’, :association_sql => “LEFT JOIN taggings ON ((taggable_id = AND (taggable_type = ‘Product’)) LEFT JOIN tags ON
( = taggings.tag_id)”, :as => ‘tags’ }]