Skip to content

Commit c229221

Browse files
committed
geo mapping
1 parent ba9532d commit c229221

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

examples/geo_mapping.sh

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
#
3+
# es geo_point mapping test
4+
# Author: alex
5+
# Created Time: 2018年06月22日 星期五 20时06分28秒
6+
curl -XDELETE 100.115.147.50:9200/my_index
7+
8+
curl -XPUT 100.115.147.50:9200/my_index -d '{
9+
"mappings": {
10+
"my_doc": {
11+
"properties": {
12+
"location": {
13+
"type": "geo_point"
14+
}
15+
}
16+
}
17+
}
18+
}'
19+
20+
curl -XPUT 100.115.147.50:9200/my_index/my_doc/1 -d '{
21+
"text": "Geo-point as a string",
22+
"location": "41.12,-71.34"
23+
}'
24+
25+
curl -XPUT 100.115.147.50:9200/my_index/my_doc/2 -d '{
26+
"text": "Geo-point as a map",
27+
"location": {
28+
"lat": 41.12,
29+
"lon": -71.34
30+
}
31+
}'
32+
33+
curl 100.115.147.50:9200/my_index/my_doc/1 |json_pp
34+
curl 100.115.147.50:9200/my_index/my_doc/2 |json_pp

0 commit comments

Comments
 (0)