Hello everybody.

I'm very happy with the results of sphinx and TS (thx Pat for it!) but
I have a problem I dont manage to resolve.

My case is de following: I have 2 models: questions (Q) and asnwers
(A).
As you would expect Q has_many A and A belongs_to Q.

What I want is to search inside both Q and A. So what I do right now
is the following:

 class Question < ActiveRecord::Base
  has_many :answers
  define_index do
    indexes body
    indexes answers.body, :as => :answers
  end
 end

The problem is that if sphinx (or TS I'm not sure) finds a match
inside an answer he is going to give me the question containing it
(even if the question doesn't matches the query). This might be a
little strange from the user point of view: he might see some results
that apparently don't match his search query.

What I like to do is to show him the Question and, next to it, the
answer(s) containing the match.

I would love TS to give me  an array like this: [Q, A, Q, Q, Q, A,
A, ....] each answer belonging to the question on his left.

Do you think it is possible to make something like that?

I've tried to be clear presenting the problem, if that's not the case
don't hesitate to ask me anything

Thank you a lot


Alex

--~--~---------~--~----~------------~-------~--~----~
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