mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 19:11:33 +03:00
attachment -> data
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
9479ce0f5c
commit
5f9e68c500
@ -21,7 +21,10 @@ curl -XPUT "localhost:9200/_ingest/pipeline/attachment?pretty" -H 'Content-Type:
|
||||
"processors" : [
|
||||
{
|
||||
"attachment" : {
|
||||
"field" : "attachment"
|
||||
"field" : "data"
|
||||
},
|
||||
"remove" : {
|
||||
"field" : "data"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -52,7 +52,7 @@ export interface IndexedContent extends IndexedDoc {
|
||||
* @public
|
||||
*/
|
||||
export interface IndexedAttachment extends IndexedDoc {
|
||||
attachment: string
|
||||
data: string
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,8 +28,8 @@ client.ingest.putPipeline({
|
||||
id: 'anticrm-pipeline',
|
||||
body: {
|
||||
processors: [
|
||||
{ attachment: { field: 'attachment' } },
|
||||
{ remove: { field: 'attachment' } }
|
||||
{ attachment: { field: 'data' } },
|
||||
{ remove: { field: 'data' } }
|
||||
]
|
||||
}
|
||||
})
|
||||
|
@ -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',
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user