I''m switching from ferret to ultrasphinx... in ferret I used to search on tags for a model by just including the tag_string method in the list of fields and implementing this method: def tag_string tags.map(&:name).join(",") end 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. Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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? On Mar 18, 12:19 pm, "blinking bear" <blinkingb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m switching from ferret to ultrasphinx... in ferret I used to search on > tags for a model by just including the tag_string method in the list of > fields and implementing this method: > > def tag_string > tags.map(&:name).join(",") > end > > 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. > > Thanks--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
To index your model with tagging, check the post from ''Allan Riley'' on March 29 2008 here: http://rubyforge.org/forum/forum.php?thread_id=18082&forum_id=14244 Hope that helps! <a href="http://www.kiranatama.com">Kiranatama - a Ruby on Rails outsourcing company</a> On Apr 7, 1:04 pm, adeel <adeel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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? > > On Mar 18, 12:19 pm, "blinking bear" <blinkingb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''m switching from ferret to ultrasphinx... in ferret I used to search on > > tags for a model by just including the tag_string method in the list of > > fields and implementing this method: > > > def tag_string > > tags.map(&:name).join(",") > > end > > > 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. > > > Thanks--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Check out the :concatenate parameter of :is_indexed (http:// blog.evanweaver.com/files/doc/fauna/ultrasphinx/classes/ActiveRecord/ 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 acts_as_taggable is_indexed :fields => [''name'', ''description''], :concatenate => [{ :class_name => ''Tag'', :field => ''name'', :association_sql => "LEFT JOIN taggings ON ((taggable_id product.id) AND (taggable_type = ''Product'')) LEFT JOIN tags ON (tags.id = taggings.tag_id)", :as => ''tags'' }] end On May 26, 5:01 am, KiranaTama <ikinwira...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> To index your model with tagging, check the post from ''Allan Riley'' on > March 29 2008 here:http://rubyforge.org/forum/forum.php?thread_id=18082&forum_id=14244 > > Hope that helps! > > <a href="http://www.kiranatama.com">Kiranatama - a Ruby on Rails > outsourcing company</a> > > On Apr 7, 1:04 pm, adeel <adeel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > 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? > > > On Mar 18, 12:19 pm, "blinking bear" <blinkingb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I''m switching from ferret to ultrasphinx... in ferret I used to search on > > > tags for a model by just including the tag_string method in the list of > > > fields and implementing this method: > > > > def tag_string > > > tags.map(&:name).join(",") > > > end > > > > 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. > > > > Thanks--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
which is also covered in the link KiranaTama posted.... On May 26, 5:01 am, KiranaTama <ikinwira...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> To index your model with tagging, check the post from ''Allan Riley'' on > March 29 2008 here:http://rubyforge.org/forum/forum.php?thread_id=18082&forum_id=14244 > > Hope that helps! > > <a href="http://www.kiranatama.com">Kiranatama - a Ruby on Rails > outsourcing company</a> > > On Apr 7, 1:04 pm, adeel <adeel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > 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? > > > On Mar 18, 12:19 pm, "blinking bear" <blinkingb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I''m switching from ferret to ultrasphinx... in ferret I used to search on > > > tags for a model by just including the tag_string method in the list of > > > fields and implementing this method: > > > > def tag_string > > > tags.map(&:name).join(",") > > > end > > > > 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. > > > > Thanks--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---