How do you send your mapping?

--
David ;-)
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 4 mai 2015 à 08:32, Dharshana Ratnayake <darthsh...@gmail.com> a écrit :
> 
> Hi Guys
> 
> Im trying to save documents in elasticsearch where one field i want to map a 
> geo_point with lat and lon
> But i would like to do this through java because i create my index through 
> java code
> 
> i tried
>             XContentBuilder builder = 
> XContentFactory.jsonBuilder().startObject().startObject("unitStatus").startObject("properties");
> 
>             builder.startObject("location")
> 
>                 .field("type", "geo_point")
> 
>                 .field("store", "yes")
> 
>                 .endObject();
> 
>  but that does not seem to work. When i query th empaling i get
> curl -XGET 
> 'http://127.0.0.1:9200/test_lost_victories1_unit_status/_mapping?pretty=1'
> 
> {
> 
>   "test_lost_victories1_unit_status" : {
> 
>     "mappings" : {
> 
>       "unitStatus" : {
> 
>         "properties" : {  
>          
>           "location" : {
> 
>             "properties" : {
> 
>               "lat" : {
> 
>                 "type" : "double"
> 
>               },
> 
>               "lon" : {
> 
>                 "type" : "double"
> 
>               }
> 
>             }
> 
>           }
>          
>        }
> 
>       }
> 
>     }
> 
>   }
> 
> }
> 
> And when i query by location i get a
> QueryParsingException[[test_lost_victories1_unit_status] failed to find 
> geo_point field [location]];
> 
> Any help with how to correctly map a geo point using the java api would be 
> greatly appreciated
> thanks
> Dharshana
> -- 
> 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 elasticsearch+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/elasticsearch/1b10e111-5d82-481a-8b85-5b7e7c86f631%40googlegroups.com.
> 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 elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/8C72A261-1D03-4230-B84C-248CA33A37F4%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

Reply via email to