named_scope is purely for SQL-based queries, not Sphinx queries - they
work in different ways.
People have requested named_scope support, but I'm thinking that might
not be possible - although a similar function just for Sphinx queries
might work (ie: named_sphinx_scope, or something along those lines).
Either way, nothing's implemented yet.
Cheers
--
Pat
Foo.search @term, :conditions => {:state => state, :city => city}
OR, push them out into their own tables, use foreign keys, add those
keys to your attributes, and then use something like:
Foo.search @term, :with => {:state_id => state.id, :city_id => city.id}
I'm not sure, but the latter might be faster from a Sphinx perspective.
Cheers
--
Pat
Field conditions get translated to text - as that's what Sphinx
requires.
So, you could try the following:
:state => "(one | two)"
Or, if you've already got an array:
:state => "(#{states.join(' | ')})"
For general extended query syntax, see
http://sphinxsearch.com/doc.html#extended-syntax
(Extended query syntax is the default *if* you're searching on certain
fields).
Cheers
--
Pat