From e477f99c7deb03a7e430e61c6cb92391a4c397c8 Mon Sep 17 00:00:00 2001 From: Mert <101130780+mertalev@users.noreply.github.com> Date: Fri, 30 Jun 2023 12:33:54 -0400 Subject: [PATCH] fix(server): fix more vector search results being returned than intended (#3042) --- server/src/infra/repositories/typesense.repository.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/infra/repositories/typesense.repository.ts b/server/src/infra/repositories/typesense.repository.ts index 9a03a104ef..40bd71ddb3 100644 --- a/server/src/infra/repositories/typesense.repository.ts +++ b/server/src/infra/repositories/typesense.repository.ts @@ -275,7 +275,7 @@ export class TypesenseRepository implements ISearchRepository { collection: faceSchema.name, q: '*', vector_query: `embedding:([${input.join(',')}], k:5)`, - per_page: 250, + per_page: 5, filter_by: this.buildFilterBy('ownerId', filters.ownerId, true), } as any, ], @@ -291,7 +291,7 @@ export class TypesenseRepository implements ISearchRepository { collection: assetSchema.name, q: '*', vector_query: `smartInfo.clipEmbedding:([${input.join(',')}], k:100)`, - per_page: 250, + per_page: 100, facet_by: this.getFacetFieldNames(SearchCollection.ASSETS), filter_by: this.getAssetFilters(filters), } as any,