since a tvShow have one or many episodes and an episode have one or many
segments and we can have the people ( guests) of each segment through the
table person_segment, I tried
ThinkingSphinx::Index.define :person, :with => :active_record, :delta =>
> true do
>
...
>
has personSegments.person.id, :as => :person_ids
>
ThinkingSphinx::Index.define :segment, :with => :active_record, :delta =>
> true do
has tv_show_id, :as => :tv_show_ids
>
has personSegments.person.id, :as => :person_ids
>
ThinkingSphinx::Index.define :tv_show, :with => :active_record, :delta =>
> true do
has id, :as => :tv_show_ids
> has segments(:id), :as => :segment_ids
>
but it is not working...
*On the console* :
ThinkingSphinx.search :with => {:tv_show_ids => 1}
> Segment Load (0.5ms) SELECT "segments".* FROM "segments" WHERE
> "segments"."id" IN (1, 2, 3)
> TvShow Load (0.3ms) SELECT "tv_shows".* FROM "tv_shows" WHERE
> "tv_shows"."id" IN (1)
> => [#<Segment id: 1, name: "1", broadcast_date: "2014-03-18 20:00:00",
> tv_show_id: 1, created_at: "2014-04-03 16:19:29", updated_at: "2014-04-03
> 16:19:29", episode_id: 1, delta: false>,
#<TvShow id: 1, name: "All In with", channel: nil, created_at: "2014-04-03
> 16:19:29", updated_at: "2014-04-03 16:19:29", delta: false>,
#<Segment id: 2, name: "2", broadcast_date: "2014-03-18 20:00:00",
> tv_show_id: 1, created_at: "2014-04-03 16:19:29", updated_at: "2014-04-03
> 16:19:29", episode_id: 1, delta: false>, #<Segment id: 3, name: "3",
> broadcast_date: "2014-03-18 20:00:00", tv_show_id: 1, created_at:
> "2014-04-03 16:19:29", updated_at: "2014-04-03 16:19:29", episode_id: 1,
> delta: false>]
>
but this one return 0... i can see that i am missing a "connection" between
segment and people. How can i do that?
ThinkingSphinx.search "",:with=>{:tv_show_ids =>
> 1},:conditions=>{:gender=>"F"}
> => []
>
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.