no smart search cursor

This commit is contained in:
timonrieger
2026-07-25 18:33:45 +02:00
parent 8bcf23789d
commit 34c25b43fc
6 changed files with 6 additions and 38 deletions
-1
View File
@@ -387,7 +387,6 @@ const SmartSearchSchema = withShapeExclusivity(
language: z.string().optional().describe('Search language code'),
page: z.int().min(1).optional().describe('Page number').meta(DEPRECATED_FLAT_FIELD),
filter: filterField,
cursor: cursorField,
}).strict(),
).meta({ id: 'SmartSearchDto' });
+1 -1
View File
@@ -244,7 +244,7 @@ describe(SearchService.name, () => {
mocks.machineLearning.encodeText.mockResolvedValue('[1, 2, 3]');
await sut.searchSmart(auth, { size: 100, filter: {}, query: 'test' });
expect(mocks.search.searchSmartV3).toHaveBeenCalledWith(
{ size: 100, offset: 0 },
{ size: 100 },
expect.objectContaining({ embedding: '[1, 2, 3]' }),
expect.objectContaining({ lockedOwnerId: expect.any(String) }),
);
+4 -5
View File
@@ -285,15 +285,14 @@ export class SearchService extends BaseService {
this.resolveEmbedding(auth, dto, machineLearning),
]);
const { offset } = decodeSearchCursor(dto.cursor);
const size = dto.size;
const { hasNextPage, items } = await this.searchRepository.searchSmartV3(
{ size, offset },
// no cursor until a rank-aware pagination strategy for smart search is decided
const { items } = await this.searchRepository.searchSmartV3(
{ size: dto.size },
{ filter, withExif: dto.withExif, embedding },
scope,
);
return this.mapResponse(items, { auth }, { nextCursor: hasNextPage ? encodeSearchCursor(offset + size) : null });
return this.mapResponse(items, { auth });
}
private async resolveSearchScopeV3(