feat(server): provide the ability to search archived photos (#6332)

* Feat: provide the ability to search archived photos

Adds a query parameter (`searchArchived`) to the search URL parameters
to allow the results to contain archived photos.

* chore: rename includeArchived => withArchived

* chore: open api

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Steven Carter
2024-01-17 21:08:00 -05:00
committed by GitHub
parent f0b328fb6b
commit d4146e3e6d
11 changed files with 100 additions and 16 deletions

View File

@@ -67,6 +67,7 @@ export class SearchService {
}
const strategy = dto.clip ? SearchStrategy.CLIP : SearchStrategy.TEXT;
const userIds = await this.getUserIdsToSearch(auth);
const withArchived = dto.withArchived || false;
let assets: AssetEntity[] = [];
@@ -77,7 +78,12 @@ export class SearchService {
{ text: query },
machineLearning.clip,
);
assets = await this.smartInfoRepository.searchCLIP({ userIds: userIds, embedding, numResults: 100 });
assets = await this.smartInfoRepository.searchCLIP({
userIds: userIds,
embedding,
numResults: 100,
withArchived,
});
break;
case SearchStrategy.TEXT:
assets = await this.assetRepository.searchMetadata(query, userIds, { numResults: 250 });