attachment -> data

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov
2021-09-13 22:25:55 +02:00
parent 9479ce0f5c
commit 5f9e68c500
5 changed files with 10 additions and 7 deletions
+4 -1
View File
@@ -21,7 +21,10 @@ curl -XPUT "localhost:9200/_ingest/pipeline/attachment?pretty" -H 'Content-Type:
"processors" : [
{
"attachment" : {
"field" : "attachment"
"field" : "data"
},
"remove" : {
"field" : "data"
}
}
]
+1 -1
View File
@@ -52,7 +52,7 @@ export interface IndexedContent extends IndexedDoc {
* @public
*/
export interface IndexedAttachment extends IndexedDoc {
attachment: string
data: string
}
/**
+2 -2
View File
@@ -28,8 +28,8 @@ client.ingest.putPipeline({
id: 'anticrm-pipeline',
body: {
processors: [
{ attachment: { field: 'attachment' } },
{ remove: { field: 'attachment' } }
{ attachment: { field: 'data' } },
{ remove: { field: 'data' } }
]
}
})
+2 -2
View File
@@ -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<void> {
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',
+1 -1
View File
@@ -154,7 +154,7 @@ export function start (transactorEndpoint: string, elasticUrl: string, minio: Cl
space,
modifiedOn: Date.now(),
modifiedBy: 'core:account:System' as Ref<Account>,
attachment: file.data.toString('base64')
data: file.data.toString('base64')
}
await elastic.index(indexedDoc)