Ultrasphinx geolookup distance returns NaN value

Hi all,

I’m trying to use geo-location based search using sphinx, Here my search
query.

@search = Ultrasphinx::Search.new(:sort_mode => ‘extended’, :sort_by =>
‘distance’, :location => {:units => ‘degrees’, :lat => 40.7414, :long =>
-74.0014})

@search.results.collect{|x| x.distance}

[0.69084495306015, 400.852783203125, 8684957.0]

But when using :query with geo-location it returns distance as NaN

@search = Ultrasphinx::Search.new(:query=>“sr.software”,:sort_mode =>
‘extended’, :sort_by => ‘distance’, :location => {:units => ‘degrees’,
:lat => 40.7414, :long => -74.0014})

@search.results.collect{|x| x.distance}

[NaN, NaN, NaN]

Please suggest one good solution to use both :query and :location

Regards,
T.Veeraa.