refactor(server): use includeNull in query for search suggestions (#14626)

* use `includeNull`

* push down `includeNull` into query, inner joins

* remove filter

* update sql

* fix tests

* maybe fix e2e

* more e2e tests

* handle no exif row

* whoops

* update sql
This commit is contained in:
Mert 2024-12-10 16:22:37 -05:00 committed by GitHub
parent 60c783bbe9
commit 25ca3b1124
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 259 additions and 52 deletions

View file

@ -170,6 +170,22 @@ export interface AssetDuplicateResult {
distance: number;
}
export interface GetStatesOptions {
country?: string;
}
export interface GetCitiesOptions extends GetStatesOptions {
state?: string;
}
export interface GetCameraModelsOptions {
make?: string;
}
export interface GetCameraMakesOptions {
model?: string;
}
export interface ISearchRepository {
searchMetadata(pagination: SearchPaginationOptions, options: AssetSearchOptions): Paginated<AssetEntity>;
searchSmart(pagination: SearchPaginationOptions, options: SmartSearchOptions): Paginated<AssetEntity>;
@ -183,8 +199,8 @@ export interface ISearchRepository {
getDimensionSize(): Promise<number>;
setDimensionSize(dimSize: number): Promise<void>;
getCountries(userIds: string[]): Promise<Array<string | null>>;
getStates(userIds: string[], country?: string): Promise<Array<string | null>>;
getCities(userIds: string[], country?: string, state?: string): Promise<Array<string | null>>;
getCameraMakes(userIds: string[], model?: string): Promise<Array<string | null>>;
getCameraModels(userIds: string[], make?: string): Promise<Array<string | null>>;
getStates(userIds: string[], options: GetStatesOptions): Promise<Array<string | null>>;
getCities(userIds: string[], options: GetCitiesOptions): Promise<Array<string | null>>;
getCameraMakes(userIds: string[], options: GetCameraMakesOptions): Promise<Array<string | null>>;
getCameraModels(userIds: string[], options: GetCameraModelsOptions): Promise<Array<string | null>>;
}