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 @@ -104,7 +104,8 @@ async function createIndex () {
104104 properties : {
105105 id : { type : 'keyword' } ,
106106 resourceBookingId : { type : 'keyword' } ,
107- userHandle : { type : 'keyword' } ,
107+ userHandle : { type : 'keyword' ,
108+ normalizer : 'lowercaseNormalizer' } ,
108109 projectId : { type : 'integer' } ,
109110 userId : { type : 'keyword' } ,
110111 startDate : { type : 'date' , format : 'yyyy-MM-dd' } ,
@@ -145,7 +146,29 @@ async function createIndex () {
145146 ]
146147
147148 for ( const index of indices ) {
148- await esClient . indices . create ( index )
149+ await esClient . indices . create ( { index : index . index } )
150+ await esClient . indices . close ( { index : index . index } )
151+ await esClient . indices . putSettings ( {
152+ index : index . index ,
153+ body : {
154+ settings : {
155+ analysis : {
156+ normalizer : {
157+ lowercaseNormalizer : {
158+ filter : [ 'lowercase' ]
159+ }
160+ }
161+ }
162+ }
163+ }
164+ } )
165+ await esClient . indices . open ( { index : index . index } )
166+ await esClient . indices . putMapping ( {
167+ index : index . index ,
168+ body : {
169+ properties : index . body . mappings . properties
170+ }
171+ } )
149172 logger . info ( { component : 'createIndex' , message : `ES Index ${ index . index } creation succeeded!` } )
150173 }
151174 process . exit ( 0 )
You can’t perform that action at this time.
0 commit comments