diff --git a/deploy/setup-es-attachment-pipeline.sh b/deploy/setup-es-attachment-pipeline.sh index efbc6dd37c..7e232589d5 100755 --- a/deploy/setup-es-attachment-pipeline.sh +++ b/deploy/setup-es-attachment-pipeline.sh @@ -21,7 +21,10 @@ curl -XPUT "localhost:9200/_ingest/pipeline/attachment?pretty" -H 'Content-Type: "processors" : [ { "attachment" : { - "field" : "attachment" + "field" : "data" + }, + "remove" : { + "field" : "data" } } ] diff --git a/server/core/src/types.ts b/server/core/src/types.ts index dbb64525f9..2770eab101 100644 --- a/server/core/src/types.ts +++ b/server/core/src/types.ts @@ -52,7 +52,7 @@ export interface IndexedContent extends IndexedDoc { * @public */ export interface IndexedAttachment extends IndexedDoc { - attachment: string + data: string } /** diff --git a/server/elastic/src/__init.ts b/server/elastic/src/__init.ts index 3aa6fae6cd..8f541b474e 100644 --- a/server/elastic/src/__init.ts +++ b/server/elastic/src/__init.ts @@ -28,8 +28,8 @@ client.ingest.putPipeline({ id: 'anticrm-pipeline', body: { processors: [ - { attachment: { field: 'attachment' } }, - { remove: { field: 'attachment' } } + { attachment: { field: 'data' } }, + { remove: { field: 'data' } } ] } }) diff --git a/server/elastic/src/adapter.ts b/server/elastic/src/adapter.ts index 098782e41a..1377153e96 100644 --- a/server/elastic/src/adapter.ts +++ b/server/elastic/src/adapter.ts @@ -34,7 +34,7 @@ class ElasticAdapter implements FullTextAdapter { query: { match: { // content: query.$search, - 'att.content': query.$search + 'attachment.content': query.$search } } } @@ -46,7 +46,7 @@ class ElasticAdapter implements FullTextAdapter { async index (doc: IndexedDoc): Promise { console.log('eastic: index', doc) - if ((doc as IndexedAttachment).attachment === undefined) { + if ((doc as IndexedAttachment).data === undefined) { const resp = await this.client.index({ index: this.db, type: '_doc', diff --git a/server/upload/src/app.ts b/server/upload/src/app.ts index f385034c94..0e66dbec50 100644 --- a/server/upload/src/app.ts +++ b/server/upload/src/app.ts @@ -154,7 +154,7 @@ export function start (transactorEndpoint: string, elasticUrl: string, minio: Cl space, modifiedOn: Date.now(), modifiedBy: 'core:account:System' as Ref, - attachment: file.data.toString('base64') + data: file.data.toString('base64') } await elastic.index(indexedDoc)