-
Notifications
You must be signed in to change notification settings - Fork 2
/
topics.sh
53 lines (49 loc) · 1.28 KB
/
topics.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
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