Hello Mark,
Thanks a bunch for your reply. I have tried getting the hang of that link before.. but I can't seem to figure out what I'm doing wrong.
Since my location is stored as a list/array, I'd assume I need this one, right?
PUT my_index/my_type/4
{
"text": "Geo-point as an array",
"location": [ -71.34, 41.12 ]
}
So if you like to my mongodb record, I'd say mine would have to look like this:
PUT yapdns(index name)/loc(key where lon,lat are stored)/4(what does this 4 mean?)
{
"loc": "Geo-point as an array",
"location": [ -71.34, 41.12 ]
}
why does "location": [ -71.34, 41.12 ] already has a value entered?
I also tried this:
curl -XPUT 'http://localhost:9200/yapdns/_mapping' -d '
{
"mappings": {
"loc": {
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
}
}
'
but got this error:
{"error":{"root_cause":[{"type":"action_request_validation_exception","reason":"Validation Failed: 1: mapping type is missing;"}],"type":"action_request_validation_exception","reason":"Validation Failed: 1: mapping type is missing;"},"status":400}
Next I tried:
curl -XPUT 'http://localhost:9200/yapdns/_mapping/loc' -d '
{
"properties": {
"loc": {
"type": "geo_point"
}
}
}
getting the following error on that:
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"mapper [loc] cannot be changed from type [string] to [geo_point]"}],"type":"illegal_argument_exception","reason":"mapper [loc] cannot be changed from type [string] to [geo_point]"},"status":400}