Hi Vin
If you have an STI setup like below, the parent's index is shared with
the child class. Which means that the index defined in B is an
additional one... and I'll say right now that multiple indexes for a
single model needs some work (I need to clear up what Sphinx requires,
and then make sure the code enforces that).
As for the db:create thing, I'll try to get a patch sorted soon -
ideally this week.
Cheers
--
Pat
On 06/10/2008, at 2:09 AM, Vin wrote:
>
> Hi Wolf,
>
> Sorry for pulling the trigger on reply early.
> There is one issue which I found fixed the error and I don't know much
> to explain the reason. Here's the scenario
>
> I've actvierecord inheritance model which I derive from other active
> record.
> e.g.
> class B < A{
> define_index do
> indexes [screen_name], :as => :screen_name, :sortable =>
> true, :infixes => true
> indexes [first_name, last_name], :as => :name, :sortable => true
> set_property :field_weights => {"screen_name" => 100, :name =>
> 60, :description => 40}
> end
> }
>
> class A {
>
> define_index do
> indexes [screen_name], :as => :screen_name, :sortable =>
> true, :infixes => true
> indexes [description], :as => :description, :sortable => true
> indexes [first_name, last_name], :as => :name, :sortable => true
> where "some_condition"
> set_property :field_weights => {"screen_name" => 100, :name =>
> 60, :description => 40}
> end
> }
>
> now both B and A active records have same define_index definition,
> except there is "where " condition in the base active record A.
> Somehow db:create migrtation fails at the definition of
> "define_index do" in class B.
>
> If I remove define_index from derived class, everything works fine,
> i.e., once I remove the ineheritance relationship everything works
> fine.
>
> My question is there index class dependency between derived or parent
> class; or each active record define_index is independent of
> inheritance relationship? I would think looking at the config that
> they are independent. I'm confused how TS handles inheritance
> relationship, when both parent and child have index defined?
>
> regards
> -Vin
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---