Hi Kirill & Jono

For something like this, you're going to have to put indexes on both Core and 
Assembly, and then search across both:

  ThinkingSphinx.search "foo", :classes => [Core, Assembly]

That way, you can define the different attributes on both (and make sure they 
have the same name to ensure filters work when using the above search approach).

Of course, if these are the only indexes you have, then you don't need the 
:classes argument.

Hope this helps.

-- 
Pat

On 22/02/2010, at 5:29 PM, Jono wrote:

> Hi
> 
> Due to our usage of STI we need some conditions in our indexing.
> 
> Could you please provide example how to use IF with an association ?
> 
> we have
> Core < Part
> Assembly < Part
> assembly has one core
> 
> 
> here is what i need
> 
> define_index do
> has dimension if Core
> has core.dimension , :as => :dimension  if Assembly
> end
> 
> I hope this is clear
> 
> Thanks
> 
> Kirill Radzikhovskyt
> 
> -- 
> 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.
> 

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