Skip to content

Commit 974a6fb

Browse files
committed
update mappings to be compatible with elasticsearch 7
Elasticsearch 5 and newer has separate types for text and keywords rather than using the string type. Update our mappings to use these types, and add a compatibility shim to return the older style mappings when running 2.x.
1 parent adce273 commit 974a6fb

File tree

15 files changed

+207
-408
lines changed

15 files changed

+207
-408
lines changed

es/account/mapping.json

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,27 @@
55
"dynamic": true,
66
"properties": {
77
"client": {
8-
"ignore_above": 2048,
9-
"index": "not_analyzed",
10-
"type": "string"
8+
"type": "keyword"
119
},
1210
"token": {
13-
"ignore_above": 2048,
14-
"index": "not_analyzed",
15-
"type": "string"
11+
"type": "keyword"
1612
}
1713
}
1814
},
1915
"code": {
20-
"ignore_above": 2048,
21-
"index": "not_analyzed",
22-
"type": "string"
16+
"type": "keyword"
2317
},
2418
"id": {
25-
"ignore_above": 2048,
26-
"index": "not_analyzed",
27-
"type": "string"
19+
"type": "keyword"
2820
},
2921
"identity": {
3022
"dynamic": false,
3123
"properties": {
3224
"key": {
33-
"ignore_above": 2048,
34-
"index": "not_analyzed",
35-
"type": "string"
25+
"type": "keyword"
3626
},
3727
"name": {
38-
"ignore_above": 2048,
39-
"index": "not_analyzed",
40-
"type": "string"
28+
"type": "keyword"
4129
}
4230
}
4331
}

es/author/mapping.json

Lines changed: 21 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -9,62 +9,44 @@
99
"format": "disabled"
1010
},
1111
"store": true,
12-
"type": "string"
12+
"type": "text"
1313
}
1414
},
15-
"ignore_above": 2048,
16-
"index": "not_analyzed",
17-
"type": "string"
15+
"type": "keyword"
1816
},
1917
"blog": {
2018
"dynamic": true,
2119
"properties": {
2220
"feed": {
23-
"ignore_above": 2048,
24-
"index": "not_analyzed",
25-
"type": "string"
21+
"type": "keyword"
2622
},
2723
"url": {
28-
"ignore_above": 2048,
29-
"index": "not_analyzed",
30-
"type": "string"
24+
"type": "keyword"
3125
}
3226
}
3327
},
3428
"city": {
35-
"ignore_above": 2048,
36-
"index": "not_analyzed",
37-
"type": "string"
29+
"type": "keyword"
3830
},
3931
"country": {
40-
"ignore_above": 2048,
41-
"index": "not_analyzed",
42-
"type": "string"
32+
"type": "keyword"
4333
},
4434
"donation": {
4535
"dynamic": true,
4636
"properties": {
4737
"id": {
48-
"ignore_above": 2048,
49-
"index": "not_analyzed",
50-
"type": "string"
38+
"type": "keyword"
5139
},
5240
"name": {
53-
"ignore_above": 2048,
54-
"index": "not_analyzed",
55-
"type": "string"
41+
"type": "keyword"
5642
}
5743
}
5844
},
5945
"email": {
60-
"ignore_above": 2048,
61-
"index": "not_analyzed",
62-
"type": "string"
46+
"type": "keyword"
6347
},
6448
"gravatar_url": {
65-
"ignore_above": 2048,
66-
"index": "not_analyzed",
67-
"type": "string"
49+
"type": "keyword"
6850
},
6951
"is_pause_custodial_account": {
7052
"type": "boolean"
@@ -80,30 +62,22 @@
8062
"format": "disabled"
8163
},
8264
"store": true,
83-
"type": "string"
65+
"type": "text"
8466
}
8567
},
86-
"ignore_above": 2048,
87-
"index": "not_analyzed",
88-
"type": "string"
68+
"type": "keyword"
8969
},
9070
"pauseid": {
91-
"ignore_above": 2048,
92-
"index": "not_analyzed",
93-
"type": "string"
71+
"type": "keyword"
9472
},
9573
"perlmongers": {
9674
"dynamic": true,
9775
"properties": {
9876
"name": {
99-
"ignore_above": 2048,
100-
"index": "not_analyzed",
101-
"type": "string"
77+
"type": "keyword"
10278
},
10379
"url": {
104-
"ignore_above": 2048,
105-
"index": "not_analyzed",
106-
"type": "string"
80+
"type": "keyword"
10781
}
10882
}
10983
},
@@ -119,39 +93,29 @@
11993
"format": "disabled"
12094
},
12195
"store": true,
122-
"type": "string"
96+
"type": "text"
12397
}
12498
},
125-
"ignore_above": 2048,
126-
"index": "not_analyzed",
127-
"type": "string"
99+
"type": "keyword"
128100
},
129101
"name": {
130-
"ignore_above": 2048,
131-
"index": "not_analyzed",
132-
"type": "string"
102+
"type": "keyword"
133103
}
134104
},
135105
"type": "nested"
136106
},
137107
"region": {
138-
"ignore_above": 2048,
139-
"index": "not_analyzed",
140-
"type": "string"
108+
"type": "keyword"
141109
},
142110
"updated": {
143111
"format": "strict_date_optional_time||epoch_millis",
144112
"type": "date"
145113
},
146114
"user": {
147-
"ignore_above": 2048,
148-
"index": "not_analyzed",
149-
"type": "string"
115+
"type": "keyword"
150116
},
151117
"website": {
152-
"ignore_above": 2048,
153-
"index": "not_analyzed",
154-
"type": "string"
118+
"type": "keyword"
155119
}
156120
}
157121
}

es/contributor/mapping.json

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,22 @@
22
"dynamic": false,
33
"properties": {
44
"distribution": {
5-
"ignore_above": 2048,
6-
"index": "not_analyzed",
7-
"type": "string"
5+
"type": "keyword"
86
},
9-
"pauseid": {
10-
"ignore_above": 2048,
11-
"index": "not_analyzed",
12-
"type": "string"
7+
"email": {
8+
"type": "keyword"
139
},
1410
"name": {
15-
"ignore_above": 2048,
16-
"index": "not_analyzed",
17-
"type": "string"
11+
"type": "keyword"
1812
},
19-
"email": {
20-
"ignore_above": 2048,
21-
"index": "not_analyzed",
22-
"type": "string"
13+
"pauseid": {
14+
"type": "keyword"
2315
},
2416
"release_author": {
25-
"ignore_above": 2048,
26-
"index": "not_analyzed",
27-
"type": "string"
17+
"type": "keyword"
2818
},
2919
"release_name": {
30-
"ignore_above": 2048,
31-
"index": "not_analyzed",
32-
"type": "string"
20+
"type": "keyword"
3321
}
3422
}
3523
}

es/cover/mapping.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,13 @@
2222
}
2323
},
2424
"distribution": {
25-
"ignore_above": 2048,
26-
"index": "not_analyzed",
27-
"type": "string"
25+
"type": "keyword"
2826
},
2927
"release": {
30-
"ignore_above": 2048,
31-
"index": "not_analyzed",
32-
"type": "string"
28+
"type": "keyword"
3329
},
3430
"version": {
35-
"ignore_above": 2048,
36-
"index": "not_analyzed",
37-
"type": "string"
31+
"type": "keyword"
3832
}
3933
}
4034
}

es/cve/mapping.json

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,35 @@
22
"dynamic": false,
33
"properties": {
44
"affected_versions": {
5-
"type": "string"
5+
"type": "text"
66
},
77
"cpansa_id": {
8-
"ignore_above": 2048,
9-
"index": "not_analyzed",
10-
"type": "string"
8+
"type": "keyword"
119
},
1210
"cves": {
13-
"type": "string"
11+
"type": "text"
1412
},
1513
"description": {
16-
"type": "string"
14+
"type": "text"
1715
},
1816
"distribution": {
19-
"index": "not_analyzed",
20-
"type": "string"
17+
"type": "keyword"
2118
},
2219
"references": {
23-
"type": "string"
20+
"type": "text"
2421
},
2522
"releases": {
26-
"index": "not_analyzed",
27-
"type": "string"
23+
"type": "keyword"
2824
},
2925
"reported": {
3026
"format": "strict_date_optional_time||epoch_millis",
3127
"type": "date"
3228
},
3329
"severity": {
34-
"type": "string"
30+
"type": "text"
3531
},
3632
"versions": {
37-
"index": "not_analyzed",
38-
"type": "string"
33+
"type": "keyword"
3934
}
4035
}
4136
}

es/distribution/mapping.json

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
"type": "integer"
1818
},
1919
"source": {
20-
"ignore_above": 2048,
21-
"index": "not_analyzed",
22-
"type": "string"
20+
"type": "keyword"
2321
}
2422
}
2523
},
@@ -48,9 +46,7 @@
4846
"type": "integer"
4947
},
5048
"source": {
51-
"ignore_above": 2048,
52-
"index": "not_analyzed",
53-
"type": "string"
49+
"type": "keyword"
5450
},
5551
"stalled": {
5652
"type": "integer"
@@ -63,26 +59,18 @@
6359
"dynamic": true,
6460
"properties": {
6561
"cygwin": {
66-
"ignore_above": 2048,
67-
"index": "not_analyzed",
68-
"type": "string"
62+
"type": "keyword"
6963
},
7064
"debian": {
71-
"ignore_above": 2048,
72-
"index": "not_analyzed",
73-
"type": "string"
65+
"type": "keyword"
7466
},
7567
"fedora": {
76-
"ignore_above": 2048,
77-
"index": "not_analyzed",
78-
"type": "string"
68+
"type": "keyword"
7969
}
8070
}
8171
},
8272
"name": {
83-
"ignore_above": 2048,
84-
"index": "not_analyzed",
85-
"type": "string"
73+
"type": "keyword"
8674
},
8775
"repo": {
8876
"dynamic": true,

0 commit comments

Comments
 (0)