I'm afraid there's no easy way to do this - so, hardcoding is probably the way 
to go. It should be reliable enough, though it does depend on the order of 
statements within your index definition. If you're not changing that code 
much/at all, then it's fine.

Of course, make sure you add a test in to ensure it's working as you like :)

-- 
Pat

On 20/07/2012, at 12:59 AM, Ngan wrote:

> Is there a way to reference the alias name for a joined table during the 
> index declaration?
> 
> I have an indexes that joins a table twice.  The second one is aliased, and 
> the first is not.  But then I have a:
> 
> has "COUNT(DISTINCT(...))", :as => :foo, :type => :integer
> 
> But i'm not sure what to put in place of the "..." so that it references the 
> alias name.  I could hardcode it, but that seems fragile...
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/thinking-sphinx/-/To5WRzHte8QJ.
> 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