This does not work.:(
I think its because the table_name for a model does not affect the
definition of define_index. During the time of indexing it takes up
whatever the Model.table_name value is.

In lib/thinking_sphinx/rails_additions.rb its written on line #61:

module ThinkingSphinx
  module ActiveRecordQuotedName
    def quoted_table_name
      self.connection.quote_table_name(self.table_name)
    end
  end
end
I think for this thinking_sphinx have to support accepting the table
name in define_index.


On Feb 3, 7:34 pm, Pat Allan <[email protected]> wrote:
> I don't think TS supports changing table names... however, I've not actually 
> tested it. Perhaps it can be done by something like the following? 
> Although... the SQL generation is what matters, and that is done after the 
> indexes are all set.
>
> So, I think this isn't supported at all, but it's worth trying, just to check.
>
>   define_index do
>     # changing the table name, looping through each option
>       define_source do
>         indexes name, description
>         has created_at
>       end
>     # end loop
>   end
>
> --
> Pat
>
> On 02/02/2010, at 2:38 PM, ritukamthan wrote:
>
>
>
> > Hi
>
> > For some reason my model uses different table in different situations.
> > So for this I wanted my model to do multiple indexing each related to
> > the different table. Does TS support it?
>
> > I mean they way I can specify index name in define_index can I define
> > table name as well?
>
> > --
> > 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 
> > athttp://groups.google.com/group/thinking-sphinx?hl=en.

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