admkrm
unread,Aug 1, 2008, 4:40:52 AM8/1/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Thinking Sphinx
Dear listmembers (and Pat of course),
I'm having a bit of trouble using Thinking Sphinx in a specific case
involving polymorpic associatons, and I hope you can help me out here.
I'm building a lifestreaming application.
I have an Element model, i.e. the elements of the lifestream, with
(amongst others) the following properties:
id
title
elementable_id
elementable_type
(belongs_to :elementable, :polymorphic => true, :dependent
=> :destroy)
The elements in question can be of the type Note / Photo / Event,
hence e.g. the following model Note
id
body
created_at
updated_at
(has_one :element, :as => :elementable)
I'm using Thinking Sphinx to perform full-text search on the
elements:
define_index do
indexes title
indexes comments.body, :as => :comment_content (KM: for a related
comments table)
has user_id
has :private
end
This all works splendidly, until I want to index e.g. the body from
the notes table, the caption from the videos table ... I'm going to
spare you all the combinations I've tried, but each give an error when
I'm trying to re-index...
Thanks in advance for looking at this problem, kind regards, Kristof