Hi Kyle
You'll need to set a value for :sort_by as well - for example:
client.sort_by = '@geodist ASC, @weight DESC'
I'm pretty sure this is what's causing the error. That said, you shouldn't need
to use the expression sorting mode - but you do need a reference to @geodist in
your sorting or filters for geo searching to come into play. So alternatively,
you can use the :extended sort mode (not sure if there's going to be any
noticeable speed difference between that and :expr though).
--
Pat
On 27/12/2009, at 4:55 AM, Kyle Murph wrote:
> Sorry for the somewhat OT thread here, but I'm using Riddle with
> Sinatra, trying to get GeoDist working, and I'm thoroughly confused.
>
> I can get Riddle up and running, and do basic :extended match_mode
> searches. It seems I need to use PH_SORT_EXPR for GeoDist, but I
> can't seem to get it working.
>
> Here's my terminal session:
>
>> client.sort_mode = :expr
>> client.query "hey"
> => {:status=>1, :attributes=>{}, :matches=>[], :fields=>
> [], :error=>"index test2: syntax error, unexpected $end near
> ''", :words=>{}, :attribute_names=>[]}
>
> Am I doing something wrong? Any kind of query causes the same error
> after setting sort_mode to :expr.
>
> Any help is greatly appreciated.
>
> --
>
> 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.