Started receiving an error when faceting with distance after setting a location filter on a Search API View. Any ideas? :)

An error occurred while trying to search with Solr: "500" Status: Server Error: Server Error{"error":{"trace":"java.lang.NullPointerException\n\tat com.spatial4j.core.io.ParseUtils.parsePoint(ParseUtils.java:42)\n\tat
org.apache.solr.schema.LatLonType.getRangeQuery(LatLonType.java:110)\n\tat org.apache.solr.parser.SolrQueryParserBase.getRangeQuery(SolrQueryParserBase.java:974)\n\tat 
...

Never seen such an error before, and geo faceting worked ok before.

The location filter works fine, and I can see the distance facets just fine, but when I click on one of them I get this 500 error message from the server.

I am using solr 4.3.0

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

giorgio79 created an issue. See original summary.

giorgio79’s picture

Issue summary: View changes
giorgio79’s picture

Issue summary: View changes
giorgio79’s picture

Issue summary: View changes
drunken monkey’s picture

Did you maybe not yet activate "Clean identifiers"?
In the Solr server settings in Drupal, please verify that there is no button to turn on that feature. If there is, please press it and re-index.

giorgio79’s picture

No such button. Would this button be available in a dev version? I would be happy to try.

drunken monkey’s picture

Status: Active » Needs review
FileSize
801 bytes

If you're using Search API Solr 1.2 or higher, the button not being present means that clean identifiers are already used.

I now tried it out myself and, indeed, I could reproduce the problem. This just doesn't work anymore.
A bit of digging revealed this has apparently been broken ever since #1390598: Add a way to easily identify facet filters inside the query – i.e., for more than two years –, apparently without anyone noticing. So, thanks all the more for reporting this!

The attached patch should fix the problem. Please test!

giorgio79’s picture

Project: Search API Location » Search API Solr
Version: 7.x-2.x-dev » 7.x-1.x-dev
Status: Needs review » Reviewed & tested by the community

Beautiful! Thank you. I noticed this patch needs to go into Search API Solr though, not Search API Location :)

  • drunken monkey committed f7499d1 on 7.x-1.x
    Issue #2636016 by drunken monkey: Fixed location search distance facets.
    
drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Good to hear, thanks a lot for testing! (And for moving this to the right issue queue.)
Committed.

drunken monkey’s picture

Component: Miscellaneous » Code
drunken monkey’s picture

Priority: Major » Normal

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.