From e6e53e323142749e83936f8bdfbfc563d98bde87 Mon Sep 17 00:00:00 2001 From: Vyacheslav Tumanov Date: Wed, 3 Jan 2024 20:30:53 +0500 Subject: [PATCH] Activity order unqiue in elastic (#4291) --- .../src/components/chat-message/ChatMessagePopup.svelte | 2 +- server/core/src/indexer/fulltextPush.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/chunter-resources/src/components/chat-message/ChatMessagePopup.svelte b/plugins/chunter-resources/src/components/chat-message/ChatMessagePopup.svelte index b6222c21e4..d5e6fd5cc9 100644 --- a/plugins/chunter-resources/src/components/chat-message/ChatMessagePopup.svelte +++ b/plugins/chunter-resources/src/components/chat-message/ChatMessagePopup.svelte @@ -35,7 +35,7 @@ let messages: ChatMessage[] = [] let activityOrderNewestFirst = JSON.parse(localStorage.getItem('activity-newest-first') ?? 'false') - + $: localStorage.setItem('activity-newest-first', JSON.stringify(activityOrderNewestFirst)) $: query.query( chunter.class.ChatMessage, { attachedTo: objectId }, diff --git a/server/core/src/indexer/fulltextPush.ts b/server/core/src/indexer/fulltextPush.ts index 7b82b9ff58..431665a7f1 100644 --- a/server/core/src/indexer/fulltextPush.ts +++ b/server/core/src/indexer/fulltextPush.ts @@ -305,7 +305,7 @@ function updateDoc2Elastic ( doc[docIdAttr] = typeof doc[docIdAttr] === 'string' ? [doc[docIdAttr]] : [...(doc[docIdAttr] ?? [])] if (vv !== '') { if (typeof vv !== 'object') { - doc[docIdAttr].push(vv) + doc[docIdAttr] = Array.from(new Set([...doc[docIdAttr], vv])) } } }