diff --git a/Services/server/tools/prepare.ts b/Services/server/tools/prepare.ts index 1a3f739..a811d74 100644 --- a/Services/server/tools/prepare.ts +++ b/Services/server/tools/prepare.ts @@ -27,21 +27,49 @@ esClient.ingest.putPipeline({ }, }); -esClient.indices.putMapping({ +esClient.indices.create({ index: DEFAULT_INDEX, - body: { + settings: { + index: { + analysis: { + analyzer: { + analyzer_shingle: { + type: "custom", + tokenizer: "icu_tokenizer", + filter: ["filter_shingle"], + }, + }, + filter: { + filter_shingle: { + type: "shingle", + max_shingle_size: 3, + min_shingle_size: 2, + output_unigrams: true, + }, + }, + }, + }, + }, + mappings: { properties: { - pathname: { - type: "keyword", - }, - path: { - type: "keyword", - }, + path: { type: "keyword" }, + pathname: { type: "keyword" }, + + fileName: { type: "text", analyzer: "analyzer_shingle" }, + title: { type: "text", analyzer: "analyzer_shingle" }, + description: { type: "text", analyzer: "analyzer_shingle" }, + + "attachment.content": { type: "text", analyzer: "analyzer_shingle" }, }, }, }); minioClient.makeBucket(DEFAULT_BUCKET!, (e) => { - if (!e) console.log("Success. Configuration is needed for Bucket Notification to AMQP."); - console.error(e); + if (!e) { + console.log("Success."); + console.log("Configuration is required for Bucket Notification to AMQP."); + console.log("Configuration is required for Keycloak."); + } else { + console.error(e); + } });