Hello guys,
I'm stuck with a little problem : I can't use custom sphinx_select with V3 
as I was used to with V2 and dont understand why :/


*This return me 20K results :*
User.search with: simple_attributes.merge
(simple attributes is a set of attributes)

*This return me no one :*
ad_type.search sphinx_select: "*, (true) AS is_valid",
                       with: simple_attributes.merge!({is_valid: true})

*I've tried this one too, still no result :*
ad_type.search sphinx_select: "*, (1) AS is_valid",
                       with: simple_attributes.merge!({is_valid: 1})


*My final goal is to do this :*
Search for user whose set an email_alert_distance, inferior to the actual 
distance between origin an user's location.

rayus_rule = "GEODIST(geo_latitude, geo_longitude, #{self.geo_latitude * 
Math::PI / 180}, #{self.geo_longitude * Math::PI / 180}) < 
(email_alert_distance * 1000)"

ad_type.search sphinx_select: "*, (#{rayus_rule}) AS is_valid",
                   with: simple_attributes.merge!({is_valid: true})

I've tried to use sql: argument but didnt succeed anything

Many thanks for your help :)

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.

Reply via email to