<p dir="auto"><strong>Elasticsearch version</strong>: 2.3.3</p>
<p dir="auto"><strong>JVM version</strong>:1.8.0_101</p>
<p dir="auto"><strong>OS version</strong>: Ubuntu 14.0.4</p>
<p dir="auto"><strong>Description of the problem including expected versus actual behavior</strong>:</p>
<p dir="auto"><strong>Steps to reproduce</strong>:</p>
<p dir="auto">Adding documents with two different location formats:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PUT /foo
{
  &quot;mappings&quot;: {
    &quot;bar&quot;: {
      &quot;properties&quot;: {
        &quot;location&quot;: {
          &quot;type&quot;: &quot;geo_point&quot;,
          &quot;lat_lon&quot;:true
        }
      }
    }
  }
}

PUT /foo/bar/1
{
  &quot;location&quot;: &quot;42,72&quot;
}

PUT /foo/bar/2
{
  &quot;location&quot;: {
    &quot;lat&quot;: 41,
    &quot;lon&quot;: 71
    }
}"><pre class="notranslate"><code class="notranslate">PUT /foo
{
  "mappings": {
    "bar": {
      "properties": {
        "location": {
          "type": "geo_point",
          "lat_lon":true
        }
      }
    }
  }
}

PUT /foo/bar/1
{
  "location": "42,72"
}

PUT /foo/bar/2
{
  "location": {
    "lat": 41,
    "lon": 71
    }
}
</code></pre></div>
<p dir="auto">And searching wanting to output the sub-fields <code class="notranslate">lat</code> and <code class="notranslate">lon</code> which should be created as a result of setting <code class="notranslate">"lat_lon": true</code> in the mapping:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="GET /foo/bar/_search
{
  &quot;fields&quot;: [ &quot;location.lat&quot;, &quot;location.lon&quot; ]
}"><pre class="notranslate"><code class="notranslate">GET /foo/bar/_search
{
  "fields": [ "location.lat", "location.lon" ]
}
</code></pre></div>
<p dir="auto">returns</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    &quot;hits&quot;: [
      {
        &quot;_index&quot;: &quot;foo&quot;,
        &quot;_type&quot;: &quot;bar&quot;,
        &quot;_id&quot;: &quot;2&quot;,
        &quot;_score&quot;: 1,
        &quot;fields&quot;: {
          &quot;location.lat&quot;: [
            41
          ],
          &quot;location.lon&quot;: [
            71
          ]
        }
      },
      {
        &quot;_index&quot;: &quot;foo&quot;,
        &quot;_type&quot;: &quot;bar&quot;,
        &quot;_id&quot;: &quot;1&quot;,
        &quot;_score&quot;: 1,
        &quot;fields&quot;: {
          &quot;location.lat&quot;: [
            &quot;42,72&quot;
          ],
          &quot;location.lon&quot;: [
            &quot;42,72&quot;
          ]
        }
      }"><pre class="notranslate"><code class="notranslate">    "hits": [
      {
        "_index": "foo",
        "_type": "bar",
        "_id": "2",
        "_score": 1,
        "fields": {
          "location.lat": [
            41
          ],
          "location.lon": [
            71
          ]
        }
      },
      {
        "_index": "foo",
        "_type": "bar",
        "_id": "1",
        "_score": 1,
        "fields": {
          "location.lat": [
            "42,72"
          ],
          "location.lon": [
            "42,72"
          ]
        }
      }
</code></pre></div>
<p dir="auto">Where we see that in document <em>2</em> the fields are correct, but in document <em>1</em> both lat and lon fields are the full original string.</p>
<p dir="auto">Have I misunderstood <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/lat-lon.html" rel="nofollow">the documentation</a> or is this a bug?</p>
<blockquote>
<p dir="auto">Setting lat_lon to true causes the latitude and longitude values to be indexed as numeric fields (called .lat and .lon).</p>
</blockquote>
<p dir="auto">Hi,</p>
<p dir="auto">I've recently upgraded ES from version 1.4.4 to 1.7.1 and now I have an issue with lat and lon indexed fields for geo_point.<br>
In my index I have a field defined as follows:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;geolocation&quot;: {
    &quot;lat_lon&quot;: true,
    &quot;geohash_prefix&quot;: true,
    &quot;type&quot;: &quot;geo_point&quot;,
    &quot;geohash&quot;: true
}"><pre class="notranslate"><code class="notranslate">"geolocation": {
    "lat_lon": true,
    "geohash_prefix": true,
    "type": "geo_point",
    "geohash": true
}
</code></pre></div>
<p dir="auto">When issuing the query</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
&quot;fields&quot;:[&quot;geolocation.lat&quot;,&quot;geolocation.lon&quot;,&quot;geolocation&quot;],
  &quot;query&quot;: {
    &quot;filtered&quot; : {
        &quot;query&quot; : {
            &quot;match_all&quot; : {}
        },

        &quot;filter&quot; : {
            &quot;geo_distance&quot; : {
                &quot;distance&quot; : &quot;20km&quot;,
                &quot;geolocation&quot; : {
                    &quot;lat&quot; : 37.9174,
                    &quot;lon&quot; : -122.3050
                }
            }
        }
    }
  }
}"><pre class="notranslate"><code class="notranslate">{
"fields":["geolocation.lat","geolocation.lon","geolocation"],
  "query": {
    "filtered" : {
        "query" : {
            "match_all" : {}
        },

        "filter" : {
            "geo_distance" : {
                "distance" : "20km",
                "geolocation" : {
                    "lat" : 37.9174,
                    "lon" : -122.3050
                }
            }
        }
    }
  }
}
</code></pre></div>
<p dir="auto">this is the response</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;hits&quot;: {
    &quot;total&quot;: 3995,
    &quot;max_score&quot;: 1,
    &quot;hits&quot;: [
        {
            &quot;_index&quot;: &quot;idx&quot;,
            &quot;_type&quot;: &quot;event&quot;,
            &quot;_id&quot;: &quot;466201666890120&quot;,
            &quot;_score&quot;: 1,
            &quot;fields&quot;: {
                &quot;geolocation&quot;: [
                    &quot;37.768991279975,-122.41938924477&quot;
                ],
                &quot;geolocation.lon&quot;: [
                    &quot;37.768991279975,-122.41938924477&quot;
                ],
                &quot;geolocation.lat&quot;: [
                    &quot;37.768991279975,-122.41938924477&quot;
                ]
            }
        }"><pre class="notranslate"><code class="notranslate">"hits": {
    "total": 3995,
    "max_score": 1,
    "hits": [
        {
            "_index": "idx",
            "_type": "event",
            "_id": "466201666890120",
            "_score": 1,
            "fields": {
                "geolocation": [
                    "37.768991279975,-122.41938924477"
                ],
                "geolocation.lon": [
                    "37.768991279975,-122.41938924477"
                ],
                "geolocation.lat": [
                    "37.768991279975,-122.41938924477"
                ]
            }
        }
</code></pre></div>
<p dir="auto">In other words geolocation.lat and geolocation.lon contain the pair and not just the single value.<br>
Version 1.4.4 worked properly as expected.</p>