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