1 curl -XDELETE 'http://localhost:9201/test999'
2 curl -XDELETE 'http://localhost:9201/_river'
3
4 curl -XPUT 'http://localhost:9201/test999/'
5
6 curl -XPUT 'http://localhost:9201/test999/test999/_mapping' -d '
7 {
8 "test999" : {
9 "properties":{
10 "klb_app_id":{"type":"string","store":"yes"}
11 ,"klb_knowledge_object_id":{"type":"string","store":"yes"}
12 ,"klb_knowledge_id":{"type":"string","store":"yes"}
13 ,"klb_tag_target_id":{"type":"string","store":"yes","analyzer":"ik"}
14 ,"klb_tag_target_name":{"type":"string","store":"yes","analyzer":"ik"}
15 ,"klb_tag_id":{"type":"string","store":"yes","analyzer":"ik"}
16 ,"klb_tag_name":{"type":"string","store":"yes","analyzer":"ik"}
17 ,"exam_question_id":{"type":"string","store":"yes"}
18 ,"exam_question_code":{"type":"string","store":"yes"}
19 ,"exam_question_createdate":{"type":"date","format":"yyyy-MM-dd HH:mm:ss","store":"yes"}
20 ,"exam_question_inputtype":{"type":"string","store":"yes"}
21 ,"exam_question_createby":{"type":"string","store":"yes"}
22 ,"exam_question_questiontypeid":{"type":"string","store":"yes"}
23 ,"exam_question_status":{"type":"string","store":"yes"}
24 ,"exam_question_topic":{"type":"string","store":"yes","analyzer":"ik"}
25 ,"exam_question_correct":{"type":"string","store":"yes","analyzer":"ik"}
26 ,"exam_question_result":{"type":"string","store":"yes","analyzer":"ik"}
27 ,"exam_question_explan":{"type":"string","store":"yes","analyzer":"ik"}
28 ,"exam_paper_id":{"type":"string","store":"yes"}
29 ,"exam_paper_code":{"type":"string","store":"yes"}
30 ,"exam_paper_name":{"type":"string","store":"yes"}
31 ,"exam_paper_createdate":{"type":"date","format":"yyyy-MM-dd HH:mm:ss","store":"yes"}
32 ,"exam_paper_orgtype":{"type":"string","store":"yes"}
33 ,"exam_paper_split":{"type":"string","store":"yes"}
34 ,"exam_paper_totalscore":{"type":"string","store":"yes"}
35 ,"exam_paper_createby":{"type":"string","store":"yes"}
36 ,"exam_paper_templatecode":{"type":"string","store":"yes"}
37 ,"exam_paper_status":{"type":"string","store":"yes"}
38 ,"exam_test_id":{"type":"string","store":"yes"}
39 ,"exam_test_code":{"type":"string","store":"yes"},"exam_test_name":{"type":"string","store":"yes"},"exam_test_testtype":{"type":"string","store":"yes"}
40 ,"exam_test_createby":{"type":"string","store":"yes"}
41 ,"exam_test_status":{"type":"string","store":"yes"}
42 ,"exam_test_createdate":{"type":"date","format":"yyyy-MM-dd HH:mm:ss","store":"yes"}
43 }
44 }
45 }'
46
47 curl -XPUT 'http://localhost:9201/_river/my_jdbc_river/_meta' -d '{
48 "type" : "jdbc",
49 "jdbc" : {
50 "driver" : "com.mysql.jdbc.Driver",
51 "url" : "jdbc:mysql://localhost:3301/newexam",
52 "user" : "root",
53 "password" : "root",
54 "sql" : "select * from index_temp"
55 },
56 "index" : {
57 "index" : "test999",
58 "type" : "test999",
59 "bulk_size" : 100,
60 "max_bulk_requests" : 30,
61 "bulk_timeout" : "60s"
62 }
63 }'