mirror of
https://github.com/immich-app/immich.git
synced 2025-12-25 09:14:58 +03:00
fix(server): penalize null geodata fields when searching places (#8408)
This commit is contained in:
@@ -214,10 +214,10 @@ export class SearchRepository implements ISearchRepository {
|
||||
.orWhere(`f_unaccent("alternateNames") %>> f_unaccent(:placeName)`)
|
||||
.orderBy(
|
||||
`
|
||||
COALESCE(f_unaccent(name) <->>> f_unaccent(:placeName), 0) +
|
||||
COALESCE(f_unaccent("admin2Name") <->>> f_unaccent(:placeName), 0) +
|
||||
COALESCE(f_unaccent("admin1Name") <->>> f_unaccent(:placeName), 0) +
|
||||
COALESCE(f_unaccent("alternateNames") <->>> f_unaccent(:placeName), 0)
|
||||
COALESCE(f_unaccent(name) <->>> f_unaccent(:placeName), 0.1) +
|
||||
COALESCE(f_unaccent("admin2Name") <->>> f_unaccent(:placeName), 0.1) +
|
||||
COALESCE(f_unaccent("admin1Name") <->>> f_unaccent(:placeName), 0.1) +
|
||||
COALESCE(f_unaccent("alternateNames") <->>> f_unaccent(:placeName), 0.1)
|
||||
`,
|
||||
)
|
||||
.setParameters({ placeName })
|
||||
|
||||
Reference in New Issue
Block a user