From 94e037a1a2f047e1d313055448e5ff56932ba7cc Mon Sep 17 00:00:00 2001 From: shatfield4 Date: Fri, 8 Dec 2023 18:02:47 -0800 Subject: [PATCH] fix workspace document searching --- backend/utils/search/documentEmbeddings/exactText.js | 2 +- backend/utils/search/documentEmbeddings/metadata.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/utils/search/documentEmbeddings/exactText.js b/backend/utils/search/documentEmbeddings/exactText.js index 3116064f..0fff853a 100644 --- a/backend/utils/search/documentEmbeddings/exactText.js +++ b/backend/utils/search/documentEmbeddings/exactText.js @@ -27,7 +27,7 @@ async function exactTextSearch(document, query) { const matchingVectorIds = await findTextInDoc(document, query); if (matchingVectorIds.length === 0) return { fragments: [], error: null }; - const queryString = matchingVectorIds.map((vid) => `'${vid}'`).join(","); + const queryString = matchingVectorIds.map((vid) => vid); const fragments = await DocumentVectors.where( { vectorId: { in: queryString } }, 100 diff --git a/backend/utils/search/documentEmbeddings/metadata.js b/backend/utils/search/documentEmbeddings/metadata.js index f38d86bb..e4d6452d 100644 --- a/backend/utils/search/documentEmbeddings/metadata.js +++ b/backend/utils/search/documentEmbeddings/metadata.js @@ -30,7 +30,7 @@ async function metadataSearch(document, query) { const matchingVectorIds = await findKeyValueInDoc(document, query); if (matchingVectorIds.length === 0) return { fragments: [], error: null }; - const queryString = matchingVectorIds.map((vid) => `'${vid}'`).join(","); + const queryString = matchingVectorIds.map((vid) => vid); const fragments = await DocumentVectors.where( { vectorId: { in: queryString } }, 100