Geo searching part of intro webinar is now broken


(Tom Busby) #1

In the introductory webinar at https://www.elastic.co/webinars/getting-started-elasticsearch?storm=start-page&iesrc=ctr, the part where he explains how to do geo based search no longer works.

(The commands he uses are here, looping back to redo the bulk add after creating the mappings manually)

You get the following error both before and after you have specified the mappings:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "failed to find mapper for [business_location] for geo distance based sort"
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "inspections",
        "node": "Agm7P2MYRa2vU7EEAkc6dg",
        "reason": {
          "type": "illegal_argument_exception",
          "reason": "failed to find mapper for [business_location] for geo distance based sort"
        }
      }
    ],
    "caused_by": {
      "type": "illegal_argument_exception",
      "reason": "failed to find mapper for [business_location] for geo distance based sort",
      "caused_by": {
        "type": "illegal_argument_exception",
        "reason": "failed to find mapper for [business_location] for geo distance based sort"
      }
    }
  },
  "status": 400
}

(Jason Zucchetto) #2

Hello, thanks for bringing this up! There is definitely an error in the command file (a slightly newer version was used in the webinar), the correct command is below (notice the "coordinates" field is used instead of the "business_location" field" for the sort:

GET /inspections/_doc/_search
{
  "query": {
    "match": { "business_name": "soup"}
  },
  "sort": [
    {
      "_geo_distance": {
        "coordinates": {
          "lat":  37.800175,
          "lon": -122.409081
        },
        "order":         "asc",
        "unit":          "km",
        "distance_type": "plane"
      }
    }
    ]
}

I will work on updating the commands file that you linked to.

Thanks for reporting this!


(Tom Busby) #3

Ah, I didn't notice that, thanks, I'll redo that section.


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.