-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.sh
77 lines (70 loc) · 3.45 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
curl -XDELETE "http://localhost:9200/topics?pretty=true"; echo
curl -XPOST "http://localhost:9200/topics?pretty=true" -d '{
"settings": {
"analysis": {
"analyzer": {
"my_start": {
"tokenizer": "whitespace",
"filter": ["asciifolding", "lowercase", "my_edge"]
},
"my_sort": {
"tokenizer": "keyword",
"filter": ["asciifolding", "lowercase"]
}
},
"filter": {
"my_edge": {
"type": "edgeNGram",
"min_gram": 1,
"max_gram": 10,
"side": "front"
}
}
}
},
"mappings": {
"global_topic": {
"properties": {
"name": {
"type": "multi_field",
"fields": {
"start": { "type": "string", "analyzer": "my_start", "include_in_all": false },
"sort": { "type": "string", "analyzer": "my_sort", "include_in_all": false }
}
}
}
},
"user_topic": {
"properties": {
"name": {
"type": "multi_field",
"fields": {
"start": { "type": "string", "analyzer": "my_start", "include_in_all": false },
"sort": { "type": "string", "analyzer": "my_sort", "include_in_all": false }
}
}
}
}
}
}'; echo
sleep 1
curl -XPUT "http://localhost:9200/topics/global_topic/1?pretty=true" -d '{ "name" : "Cheese" }'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/2?pretty=true" -d '{ "name" : "Cheesecake" }'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/3?pretty=true" -d '{ "name" : "Cheese plate" }'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/4?pretty=true" -d '{ "name" : "Grilled Cheese"}'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/5?pretty=true" -d '{ "name" : "Grilled Cheese Sandwich" }'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/6?pretty=true" -d '{ "name" : "Dutch Cheese" }'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/7?pretty=true" -d '{ "name" : "Cheese & Crackers" }'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/8?pretty=true" -d '{ "name" : "Cheese Factory" }'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/9?pretty=true" -d '{ "name" : "Cheesecake Factory" }'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/10?pretty=true" -d '{ "name" : "French Cheese" }'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/11?pretty=true" -d '{ "name" : "Soft Cheese" }'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/12?pretty=true" -d '{ "name" : "Cheeseballs" }'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/12?pretty=true" -d '{ "name" : "Crazy" }'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/13?pretty=true" -d '{ "name" : "Crazy" }'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/13?pretty=true" -d '{ "name" : "Cranky" }'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/14?pretty=true" -d '{ "name" : "Cheese Crack" }'; echo
curl -XPUT "http://localhost:9200/topics/global_topic/15?pretty=true" -d '{ "name" : "Crack store" }'; echo
curl -XPUT "http://localhost:9200/topics/user_topic/1?pretty=true" -d '{ "user": "stefan", "name" : "Cheesecake" }'; echo
curl -XPUT "http://localhost:9200/topics/user_topic/2?pretty=true" -d '{ "user": "stefan", "name" : "Dutch Cheese" }'; echo
curl -XPUT "http://localhost:9200/topics/user_topic/3?pretty=true" -d '{ "user": "alice", "name" : "Cheesecrab" }'; echo