title: how can i fix 'failed to find geo_point field [pin.location]'
body: <p>so i have a index for my map points and i need to put some data in it. but it seems it does not register my data as a valid input for pin.location .</p>
  
  <p>I have tried all i could get from <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-query.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-query.html</a>
  and still this does not work</p>
  
  <p>This is where i set the index:</p>
  
  <pre class="lang-py prettyprint-override"><code>mappings = {
      "mappings": {
          "properties": {
              "pin": {
                  "properties": {
                      "location": {
                          "type": "geo_point"
                      }
                  }
              },
              "index.mapping.single_type": False
          }
      }
  }
  es = Elasticsearch([{'host': 'localhost', 'port': 9200}])
  if not es.indices.exists(index="groups_map"):
      es.indices.create(index='groups_map', body=mappings)
  es.index(index='groups_map', id=data["id"], doc_type='groups_map', body=data, request_timeout=30)
  
  </code></pre>
  
  <p>here is data:</p>
  
  <pre class="lang-py prettyprint-override"><code>data = {
          "pin": {
                 "properties": {"location": {
                                "type": "geo_point",
                                'lat': request.POST['source_lat'],
                                'lon': request.POST['source_lon']}
                      }
  
                  },
           "id": instance.id,
  
          }
  </code></pre>
  
  <p>and this is my query data here is just a dictionary with lat and lon values</p>
  
  <pre class="lang-py prettyprint-override"><code> query = {
          "bool": {
              "must": {
                  "match_all": {}
              },
              "filter": {
                  "geo_distance": {
                      "distance": "12km",
                      "pin.location": {
                          "lat": data["lat"],
                          "lon": data["lon"]
                      }
                  }
              }
          }
      }
  return es.search(index="groups_map", body={"query": query}, size=20)
  
  </code></pre>
  
  <p>this is the full error i get:
  elasticsearch.exceptions.RequestError: RequestError(400, 'search_phase_execution_exception', 'failed to find geo_point field [pin.location]')</p>