Can't get geo_point dynamic mapping to work


(skaffman-2) #1

Folks,

I've been using the information in the blog post at


to have a play with the geo_point type mapping, specifically how it
hands dynamic recognition of geopoint data structures in the indexed
documents.

For example, if I index the example document from the blog post, in a
newly-created index:

{
"pin" : {
"location" : {
"lat" : 40.12,
"lon" : -71.34
},
"tag" : ["food", "family"],
"text" : "my favorite family restaurant"
}
}

And then I query the index mapping via the REST API, I get the
following back:

{
"geotest" : {
"pin" : {
"properties" : {
"text" : {
"type" : "string"
},
"location" : {
"properties" : {
"lon" : {
"type" : "double"
},
"lat" : {
"type" : "double"
}
}
},
"tag" : {
"type" : "string"
}
}
}
}
}

My expectation here was for the mapping to have some mention of the
geopoint "location" field, but there's no indication that
ElasticSearch has recognised it for what it is.

Should I be able to see something there? If not, how can I verify that
the geopoint field is being indexed?


(Shay Banon) #2

The geo point type is no longer dynamic, you have to explicitly define it.

On Mon, Dec 20, 2010 at 6:47 PM, skaffman kenny@chasmcity.com wrote:

Folks,

I've been using the information in the blog post at
http://www.elasticsearch.com/blog/2010/08/16/geo_location_and_search.html
to have a play with the geo_point type mapping, specifically how it
hands dynamic recognition of geopoint data structures in the indexed
documents.

For example, if I index the example document from the blog post, in a
newly-created index:

{
"pin" : {
"location" : {
"lat" : 40.12,
"lon" : -71.34
},
"tag" : ["food", "family"],
"text" : "my favorite family restaurant"
}
}

And then I query the index mapping via the REST API, I get the
following back:

{
"geotest" : {
"pin" : {
"properties" : {
"text" : {
"type" : "string"
},
"location" : {
"properties" : {
"lon" : {
"type" : "double"
},
"lat" : {
"type" : "double"
}
}
},
"tag" : {
"type" : "string"
}
}
}
}
}

My expectation here was for the mapping to have some mention of the
geopoint "location" field, but there's no indication that
ElasticSearch has recognised it for what it is.

Should I be able to see something there? If not, how can I verify that
the geopoint field is being indexed?


(skaffman-2) #3

Ah, fair enough then, thanks.

You might want to update that blog entry, though, put up a warning
sign or some such :slight_smile:

On Dec 20, 5:54 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

The geo point type is no longer dynamic, you have to explicitly define it.

On Mon, Dec 20, 2010 at 6:47 PM, skaffman ke...@chasmcity.com wrote:

Folks,

I've been using the information in the blog post at
http://www.elasticsearch.com/blog/2010/08/16/geo_location_and_search....
to have a play with the geo_point type mapping, specifically how it
hands dynamic recognition of geopoint data structures in the indexed
documents.

For example, if I index the example document from the blog post, in a
newly-created index:

{
"pin" : {
"location" : {
"lat" : 40.12,
"lon" : -71.34
},
"tag" : ["food", "family"],
"text" : "my favorite family restaurant"
}
}

And then I query the index mapping via the REST API, I get the
following back:

{
"geotest" : {
"pin" : {
"properties" : {
"text" : {
"type" : "string"
},
"location" : {
"properties" : {
"lon" : {
"type" : "double"
},
"lat" : {
"type" : "double"
}
}
},
"tag" : {
"type" : "string"
}
}
}
}
}

My expectation here was for the mapping to have some mention of the
geopoint "location" field, but there's no indication that
ElasticSearch has recognised it for what it is.

Should I be able to see something there? If not, how can I verify that
the geopoint field is being indexed?


(system) #4