Geo type mapping


(davidll) #1

Hi,
I'm using ES 0.90.2 with mongodb river, and I'm trying to map a geo point field. The field is like this:

"latlon": "37.18817,-3.60667"

And the mapping:

curl -XPUT 'http://localhost:9200/mongoindex/my_index/_mapping' -d '
{
"mappings" : {
"perfil" : {
"properties" : {
"latlon" : {"type" : "geo_point"}
}
}
}
}
'

I search:

http://localhost:9200/mongoindex/users/_search?source={
"query":{
"filtered" : {
"query" : {
"match_all": {}
},
"filter" : {
"geo_distance" : {
"distance" : "12km",
"latlon" : "37.18817,-3.60667"
}
}
}
}
}
}

But the field is not a geo_point:

QueryParsingException[[mongoindex] field [latlon] is not a geo_point field]

Any idea? Thanks


(system) #2