Hi, I'm having a problem getting results over a has_many association.
My models are:

class Question
  has_many :answers

  # this is the function I am having problems with
  def get_equivalents(query)
    answers.search query, :with => { :is_primary =>
true }, :match_mode => :any, :per_page => 5
  end

end

class Answer
  belongs_to :question

  # thinking sphinx indexes
  define_index do
    # fields
    indexes content, :morphology => :stem_en


    # attributes
    has rank, popularity, question_id
    has "ISNULL(equivalent_id)", :as => :is_primary, :type => :integer

    set_property :delta => true
  end
end


So the problem is if call get_equivalents on a question object I get
zero results but if I do Answers.search I can see all the answers I'm
looking for. So they have been indexed and my delta indexing seems to
be working...

Any ideas?

Thanks,

--
Barry

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" 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/thinking-sphinx?hl=en.

Reply via email to