Skip to content

Commit 623576a

Browse files
add normalizer to the name property
1 parent e36abeb commit 623576a

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/scripts/update-es-mappings.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ function createIndex (indexName) {
1414
const body = { mappings: {} }
1515
body.mappings[config.get('ES.ES_TYPE')] = {
1616
properties: {
17-
id: { type: 'keyword' }
17+
id: { type: 'keyword' },
18+
name: {
19+
type: 'keyword',
20+
normalizer: 'custom_sort_normalizer'
21+
}
1822
},
1923
dynamic_templates: [{
2024
metadata: {
@@ -25,6 +29,17 @@ function createIndex (indexName) {
2529
}
2630
}]
2731
}
32+
body.settings = {
33+
analysis: {
34+
normalizer: {
35+
custom_sort_normalizer: {
36+
type: 'custom',
37+
char_filter: [],
38+
filter: ['lowercase', 'asciifolding']
39+
}
40+
}
41+
}
42+
}
2843

2944
return esClient.indices.create({
3045
index: indexName,

0 commit comments

Comments
 (0)