Skip to content

Commit eccb4fc

Browse files
committedJul 31, 2018
add example
1 parent b507275 commit eccb4fc

4 files changed

+529
-3
lines changed
 

‎examples/export.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if [ -f csv2es ]; then
99
cmd="./csv2es"
1010
fi
1111

12-
index=test
12+
index=test_1
1313
if [ $# = 1 ]; then
1414
index="$1"
1515
fi

‎examples/eyenlp_housing_estate_20180523.csv

+500
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"properties": {
3+
"province": {"type": "keyword", "index": false},
4+
"city": {"type": "keyword", "index": false},
5+
"county": {"type": "keyword", "index": false},
6+
"town": {"type": "keyword", "index": false},
7+
"address": {"type": "keyword", "index": false},
8+
"standard_province": {"type": "keyword", "index": false},
9+
"standard_city": {"type": "keyword", "index": false},
10+
"standard_county": {"type": "keyword", "index": false},
11+
"standard_town": {"type": "keyword", "index": false},
12+
"standard_village": {"type": "keyword", "index": false},
13+
"title": {"type": "keyword", "index": false},
14+
"cityCode": {"type": "text", "index": true},
15+
"search_title": {"type": "text", "index": true},
16+
"aliases": {"type": "keyword", "index": false},
17+
"lon": {"type": "float"},
18+
"lat": {"type": "float"}
19+
}
20+
}

‎examples/import.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ if [ -f csv2es ]; then
99
cmd="./csv2es"
1010
fi
1111

12-
$cmd import --host=100.115.147.50 --port=9200 --index=test --type=test --mapping=./eyenlp_area2016.json --csv=./eyenlp_area2016.csv --delete-index=true --debug=true
12+
host=$1
13+
14+
$cmd import --host=$host --port=9200 --index=test_1 --type=test_1 --mapping=./eyenlp_area2016.json --csv=./eyenlp_area2016.csv --delete-index=true --debug=true
15+
16+
$cmd import --host=$host --port=9200 --index=test_2 --type=test_2 --mapping=./eyenlp_housing_estate_20180523.json --csv=./eyenlp_housing_estate_20180523.csv --delete-index=true --debug=true
1317

1418
# 查看mapping是否生效
15-
curl 100.115.147.50:9200/test/_mapping|json_pp
19+
curl $host:9200/test_1/_mapping|json_pp
20+
curl $host:9200/test_2/_mapping|json_pp
21+

0 commit comments

Comments
 (0)
Please sign in to comment.