File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,8 @@ async function createIndex () {
105
105
properties : {
106
106
id : { type : 'keyword' } ,
107
107
resourceBookingId : { type : 'keyword' } ,
108
- userHandle : { type : 'keyword' } ,
108
+ userHandle : { type : 'keyword' ,
109
+ normalizer : 'lowercaseNormalizer' } ,
109
110
projectId : { type : 'integer' } ,
110
111
userId : { type : 'keyword' } ,
111
112
startDate : { type : 'date' , format : 'yyyy-MM-dd' } ,
@@ -179,7 +180,29 @@ async function createIndex () {
179
180
]
180
181
181
182
for ( const index of indices ) {
182
- await esClient . indices . create ( index )
183
+ await esClient . indices . create ( { index : index . index } )
184
+ await esClient . indices . close ( { index : index . index } )
185
+ await esClient . indices . putSettings ( {
186
+ index : index . index ,
187
+ body : {
188
+ settings : {
189
+ analysis : {
190
+ normalizer : {
191
+ lowercaseNormalizer : {
192
+ filter : [ 'lowercase' ]
193
+ }
194
+ }
195
+ }
196
+ }
197
+ }
198
+ } )
199
+ await esClient . indices . open ( { index : index . index } )
200
+ await esClient . indices . putMapping ( {
201
+ index : index . index ,
202
+ body : {
203
+ properties : index . body . mappings . properties
204
+ }
205
+ } )
183
206
logger . info ( { component : 'createIndex' , message : `ES Index ${ index . index } creation succeeded!` } )
184
207
}
185
208
process . exit ( 0 )
You can’t perform that action at this time.
0 commit comments