Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get distance from search [NoMethodError: undefined method `match' for nil:NilClass] #586

Open
mois3x opened this issue Jun 2, 2014 · 0 comments

Comments

@mois3x
Copy link

mois3x commented Jun 2, 2014

Hey, im adjusting params to get distance in the results. But, im getting:

NoMethodError: undefined method `match' for nil:NilClass

When i do this

 adjust_solr_params do |solr_para|
    solr_para[:sort] = "geodist() asc"
    solr_para[:sfield] = 'location_ll'
    solr_para[:pt] = "#{lat},#{lng}"
    solr_para[:d] = radius.to_s
    solr_para[:fq] = "_query_:\"{!geofilt}\""
    solr_para[:fl] = 'distance:geodist() AND doc_id:id'
  end

The problem comes when distance:geodist() AND doc_id:idis added. .totalsays there is results but .results and .hits throw the annoying error.

I was looking for doc_id in code but no luck. How do you guys do this?

@ma2kubo
Copy link

ma2kubo commented Jun 2, 2014

Evernote was unable to submit your note for the following reason:

The emailed note was received, but Evernote did not understand the email address. It may have been mistyped, or the user may not exist. Please check to make sure the address was properly entered.

Original message information:
From: mois3x <notifications@github.com>
Delivered To: deviceone.c1297@m.evernote.com
All recipients: sunspot/sunspot <sunspot@noreply.github.com>
Subject: [sunspot] Get distance from search NoMethodError: undefined method `match' for nil:NilClass

To prevent excessive emails, you may not receive another error reply for the next 360 minutes.

  • The Evernote team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants