File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments