From 68439fd6f3229a78860aec8ca3e876003f3adb71 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Thu, 29 Dec 2022 00:11:09 +0700 Subject: [PATCH] Fix plugin import search (#2480) Signed-off-by: Andrey Sobolev --- server/front/src/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/front/src/index.ts b/server/front/src/index.ts index 5e5f83c705..1b82695f0c 100644 --- a/server/front/src/index.ts +++ b/server/front/src/index.ts @@ -15,7 +15,7 @@ // import attachment from '@hcengineering/attachment' -import { Account, Doc, Ref, Space, WorkspaceId } from '@hcengineering/core' +import { Account, Class, Doc, Ref, Space, WorkspaceId } from '@hcengineering/core' import { createElasticAdapter } from '@hcengineering/elastic' import { MinioService } from '@hcengineering/minio' import type { IndexedDoc } from '@hcengineering/server-core' @@ -317,6 +317,7 @@ export function start ( const url = req.query.url as string const cookie = req.query.cookie as string | undefined const attachedTo = req.query.attachedTo as Ref | undefined + const attachedToClass = req.query.attachedToClass as Ref> | undefined if (url === undefined) { res.status(500).send('URL param is not defined') return @@ -361,7 +362,6 @@ export function start ( if (attachedTo !== undefined) { const space = req.query.space as Ref const elastic = await createElasticAdapter(config.elasticUrl, payload.workspace) - const indexedDoc: IndexedDoc = { id: id as Ref, _class: attachment.class.Attachment, @@ -369,9 +369,10 @@ export function start ( modifiedOn: Date.now(), modifiedBy: 'core:account:System' as Ref, attachedTo, + attachedToClass, data: buffer.toString('base64') } - + console.log('indexing doc', id) await elastic.index(indexedDoc) }