I'm afraid what you want to do probably isn't possible. The expression sorting 
syntax is quite flexible, but you can't reference fields with it.
http://sphinxsearch.com/docs/manual-2.0.1.html#expressions

Not sure of any other approaches, beyond adding string_1 to the search query - 
but doing that *and* getting the results you want in the order you want 
probably isn't easy either.

-- 
Pat

On 08/12/2011, at 11:10 PM, kzielonka wrote:

> Hi!
> 
> I have the following problem:
> 
> In db I have 3 tables A, B, C with associations:
> * A has many B
> * B has one C
> 
> Table C has a string field x. (x in {'string_1', 'string_2',
> 'string_3', 'string_4'})
> 
> I would like to index the table A but with information that exists
> association with C that x='string_1' or not.
> 
> Exactly I would like to do somethink like that in ROR:
> A.search("something", :sort => :extended, :order => "A that have C
> with x='string_1' first")
> 
> P.S.
> sorry for my english
> 
> -- 
> 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