-
Notifications
You must be signed in to change notification settings - Fork 0
/
clinton_test.sh
114 lines (112 loc) · 3.53 KB
/
clinton_test.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
curl -XPUT 'http://107.22.137.196:9200/test/?pretty=1' -d '
{
"mappings" : {
"member" : {
"properties" : {
"location" : {
"type" : "geo_point"
},
"member_id" : {
"type" : "string",
"analyzer" : "simple"
},
"birthday" : {
"format" : "yyyy-MM-dd",
"type" : "date"
},
"last_name" : {
"fields" : {
"metaphone" : {
"type" : "string",
"analyzer" : "name_metaphone"
},
"partial" : {
"search_analyzer" : "full_name",
"index_analyzer" : "partial_name",
"type" : "string"
},
"last_name" : {
"type" : "string",
"analyzer" : "full_name"
}
},
"type" : "multi_field"
},
"first_name" : {
"fields" : {
"metaphone" : {
"type" : "string",
"analyzer" : "name_metaphone"
},
"partial" : {
"search_analyzer" : "full_name",
"index_analyzer" : "partial_name",
"type" : "string"
},
"first_name" : {
"type" : "string",
"analyzer" : "full_name"
}
},
"type" : "multi_field"
}
}
}
},
"settings" : {
"analysis" : {
"filter" : {
"name_ngrams" : {
"side" : "front",
"max_gram" : 10,
"min_gram" : 1,
"type" : "edgeNGram"
},
"name_metaphone" : {
"replace" : false,
"encoder" : "metaphone",
"type" : "phonetic"
}
},
"analyzer" : {
"full_name" : {
"filter" : [
"standard",
"lowercase",
"asciifolding"
],
"type" : "custom",
"tokenizer" : "standard"
},
"name_metaphone" : {
"filter" : [
"name_metaphone"
],
"type" : "custom",
"tokenizer" : "standard"
},
"partial_name" : {
"filter" : [
"standard",
"lowercase",
"asciifolding",
"name_ngrams"
],
"type" : "custom",
"tokenizer" : "standard"
}
}
}
}
}
'
### INDEX SAMPLE DATA
# [Mon Jul 18 11:50:54 2011] Protocol: http, Server: 192.168.5.103:9200
curl -XPOST 'http://107.22.137.196:9200/_bulk?pretty=1' -d '
{"index" : {"_index" : "test", "_type" : "member"}}
{"location" : [51.50853, -0.12574], "member_id" : "ABC-1234", "birthday" : "1970-10-24", "last_name" : "Smith", "first_name" : "Robert"}
{"index" : {"_index" : "test", "_type" : "member"}}
{"location" : [53.41667, -2.25], "member_id" : "ABC-1235", "birthday" : "1975-11-03", "last_name" : "Jones", "first_name" : "Robin"}
{"index" : {"_index" : "test", "_type" : "member"}}
{"location" : [41.3873, 2.1762], "member_id" : "ABC-1235", "birthday" : "1975-11-03", "last_name" : "Sánchez", "first_name" : "Jordi"}
'