mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 11:50:56 +00: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" : [
|
"processors" : [
|
||||||
{
|
{
|
||||||
"attachment" : {
|
"attachment" : {
|
||||||
"field" : "attachment"
|
"field" : "data"
|
||||||
|
},
|
||||||
|
"remove" : {
|
||||||
|
"field" : "data"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -52,7 +52,7 @@ export interface IndexedContent extends IndexedDoc {
|
|||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
export interface IndexedAttachment extends IndexedDoc {
|
export interface IndexedAttachment extends IndexedDoc {
|
||||||
attachment: string
|
data: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,8 +28,8 @@ client.ingest.putPipeline({
|
|||||||
id: 'anticrm-pipeline',
|
id: 'anticrm-pipeline',
|
||||||
body: {
|
body: {
|
||||||
processors: [
|
processors: [
|
||||||
{ attachment: { field: 'attachment' } },
|
{ attachment: { field: 'data' } },
|
||||||
{ remove: { field: 'attachment' } }
|
{ remove: { field: 'data' } }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -34,7 +34,7 @@ class ElasticAdapter implements FullTextAdapter {
|
|||||||
query: {
|
query: {
|
||||||
match: {
|
match: {
|
||||||
// content: query.$search,
|
// 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> {
|
async index (doc: IndexedDoc): Promise<void> {
|
||||||
console.log('eastic: index', doc)
|
console.log('eastic: index', doc)
|
||||||
if ((doc as IndexedAttachment).attachment === undefined) {
|
if ((doc as IndexedAttachment).data === undefined) {
|
||||||
const resp = await this.client.index({
|
const resp = await this.client.index({
|
||||||
index: this.db,
|
index: this.db,
|
||||||
type: '_doc',
|
type: '_doc',
|
||||||
|
@ -154,7 +154,7 @@ export function start (transactorEndpoint: string, elasticUrl: string, minio: Cl
|
|||||||
space,
|
space,
|
||||||
modifiedOn: Date.now(),
|
modifiedOn: Date.now(),
|
||||||
modifiedBy: 'core:account:System' as Ref<Account>,
|
modifiedBy: 'core:account:System' as Ref<Account>,
|
||||||
attachment: file.data.toString('base64')
|
data: file.data.toString('base64')
|
||||||
}
|
}
|
||||||
|
|
||||||
await elastic.index(indexedDoc)
|
await elastic.index(indexedDoc)
|
||||||
|
Loading…
Reference in New Issue
Block a user