nevermind, i solved it by doing something like this -
GeoPoint latLng = GeoPoint.parseFromLatLon((String)
                    sourceMap.get("lat_lng"));

at the time of indexing, i am passing as "<lat>,<lng>"

earlier i was passing as GeoPoint but that caused a major problem and
messed up my mapping. When i read the document and then change some other
field and do index, then it would raise this exception -
ElasticsearchParseException("field must be either '" + LATITUDE + "', '" +
LONGITUDE + "' or '" + GEOHASH + "'");

so i figured that indexing by passing the string (even though mapping is
geo_point) works.
thanks

On Thu, Dec 4, 2014 at 6:32 AM, Nicholas Knize <
[email protected]> wrote:

> Can you post a code example from your use case for how you're inserting,
> retrieving, and reading the documents?
>
> - Nick
>
>
> On Tuesday, December 2, 2014 2:16:30 PM UTC-6, T Vinod Gupta wrote:
>>
>> has anyone seen this problem? my mapping says that the field is of type
>> geo_point. but when i read documents using java api and get the sourcemap,
>> the type of the field is string and i can't cast it to a GeoPoint.
>>
>> ...
>>           "lat_lng" : {
>>             "type" : "geo_point",
>>             "lat_lon" : true
>>           },
>> ..
>>
>> thanks
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "elasticsearch" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/b5ed03a4-eaad-491b-9856-087ae3ab2587%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/b5ed03a4-eaad-491b-9856-087ae3ab2587%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAHau4yvDyp5uO_bhj%3DFwNtNB_fPu9sHpbKfb-OMr4hBygL8bfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to