Hello All, I wanted to implement sphinx search. I have following models. Blog # post model has column "channel_feature_id" has_many :posts, :foreign_key => "channel_feature_id" ------ Post # Indexes for thinking sphinx define_index do indexes title indexes abstract indexes body #indexes comments.body, :as => :comment_content # OPTIONAL: keeps search index uptodate # First, add a boolean column to your model, named 'delta', and have it default to true. # Then uncomment following line. #set_property :delta => true end belongs_to :blog has_many :comments # GET published posts named_scope :published, :conditions => [ 'published = ?', true ] ------ Comment belongs_to :post ------ In my search action i have blog.posts.published.search ( params[:search] ) i dont know what is going wrong with me. i am getting following error Missing Attribute for Foreign Key channel_feature_id
here is full trace....... vendor/plugins/thinking-sphinx/lib/thinking_sphinx/active_record/has_many_association.rb:18:in `search' /home/sandip/.gem/ruby/1.8/gems/activerecord-2.1.2/lib/active_record/named_scope.rb:158:in `send' /home/sandip/.gem/ruby/1.8/gems/activerecord-2.1.2/lib/active_record/named_scope.rb:158:in `method_missing' /home/sandip/.gem/ruby/1.8/gems/activerecord-2.1.2/lib/active_record/base.rb:1857:in `with_scope' /home/sandip/.gem/ruby/1.8/gems/activerecord-2.1.2/lib/active_record/associations/association_proxy.rb:164:in `send' /home/sandip/.gem/ruby/1.8/gems/activerecord-2.1.2/lib/active_record/associations/association_proxy.rb:164:in `with_scope' (__DELEGATION__):2:in `__send__' (__DELEGATION__):2:in `with_scope' app/controllers/blogs_controller.rb:36:in `search' Thanks, Sandip -- Ruby on Rails Developer http://sandip.sosblog.com http://funonrails.wordpress.com www.joshsoftware.com --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

