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 () {
105105 properties : {
106106 id : { type : 'keyword' } ,
107107 resourceBookingId : { type : 'keyword' } ,
108- userHandle : { type : 'keyword' } ,
108+ userHandle : { type : 'keyword' ,
109+ normalizer : 'lowercaseNormalizer' } ,
109110 projectId : { type : 'integer' } ,
110111 userId : { type : 'keyword' } ,
111112 startDate : { type : 'date' , format : 'yyyy-MM-dd' } ,
@@ -179,7 +180,29 @@ async function createIndex () {
179180 ]
180181
181182 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+ } )
183206 logger . info ( { component : 'createIndex' , message : `ES Index ${ index . index } creation succeeded!` } )
184207 }
185208 process . exit ( 0 )
You can’t perform that action at this time.
0 commit comments