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 () {
104
104
properties : {
105
105
id : { type : 'keyword' } ,
106
106
resourceBookingId : { type : 'keyword' } ,
107
- userHandle : { type : 'keyword' } ,
107
+ userHandle : { type : 'keyword' ,
108
+ normalizer : 'lowercaseNormalizer' } ,
108
109
projectId : { type : 'integer' } ,
109
110
userId : { type : 'keyword' } ,
110
111
startDate : { type : 'date' , format : 'yyyy-MM-dd' } ,
@@ -145,7 +146,29 @@ async function createIndex () {
145
146
]
146
147
147
148
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
+ } )
149
172
logger . info ( { component : 'createIndex' , message : `ES Index ${ index . index } creation succeeded!` } )
150
173
}
151
174
process . exit ( 0 )
You can’t perform that action at this time.
0 commit comments