[BUG] Suggest people when typing a name not finding people #1482

Closed
opened 2026-02-05 02:02:00 +03:00 by OVERLORD · 25 comments
Owner

Originally created by @eygraber on GitHub (Oct 19, 2023).

The bug

When I am typing in a person's name, only some of the existing names are suggested (neither of them correct).

For example, if I type 'R' then two names that start with 'Ra' are suggested, but neither are the one that I'm looking for. If I then type 'i' then there are no suggestions shown.

The OS that Immich Server is running on

Ubuntu 22.04

Version of Immich Server

1.82.1

Version of Immich Mobile App

N/A

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

services:
  immich-server:
    user: 1000:1001
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "immich" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  immich-microservices:
    user: 1000:1001
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.yml
    #   service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes:
      - /disks/storage/immich/volumes/geocoding:/usr/src/app/.reverse-geocoding-dump
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  immich-machine-learning:
    user: 1000:1001
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - /disks/storage/immich/volumes/model-cache:/cache
    env_file:
      - .env
    restart: always

  immich-web:
    container_name: immich_web
    image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release}
    env_file:
      - .env
    restart: always

  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd
    environment:
      - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
      - TYPESENSE_DATA_DIR=/data
      # remove this to get debug messages
      - GLOG_minloglevel=1
    volumes:
      - /disks/storage/immich/volumes/tsdata:/data
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
    restart: always

  database:
    user: 1000:1001
    container_name: immich_postgres
    image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - /disks/storage/immich/volumes/pgdata:/var/lib/postgresql/data
    restart: always

  immich-proxy:
    container_name: immich_proxy
    image: ghcr.io/immich-app/immich-proxy:${IMMICH_VERSION:-release}
    environment:
      # Make sure these values get passed through from the env file
      - IMMICH_SERVER_URL
      - IMMICH_WEB_URL
    ports:
      - 2283:8080
    depends_on:
      - immich-server
      - immich-web
    restart: always

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

PUID=1000
GUID=1001

# The location where your uploaded files are stored
UPLOAD_LOCATION=<...>

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secrets for postgres and typesense. You should change these to random passwords
TYPESENSE_API_KEY=<...>
DB_PASSWORD=<...>

TZ=America/New_York

# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis

Reproduction steps

1. Start typing a name

Additional information

No response

Originally created by @eygraber on GitHub (Oct 19, 2023). ### The bug When I am typing in a person's name, only some of the existing names are suggested (neither of them correct). For example, if I type 'R' then two names that start with 'Ra' are suggested, but neither are the one that I'm looking for. If I then type 'i' then there are no suggestions shown. ### The OS that Immich Server is running on Ubuntu 22.04 ### Version of Immich Server 1.82.1 ### Version of Immich Mobile App N/A ### Platform with the issue - [ ] Server - [X] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML version: "3.8" services: immich-server: user: 1000:1001 container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} command: [ "start.sh", "immich" ] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - .env depends_on: - redis - database - typesense restart: always immich-microservices: user: 1000:1001 container_name: immich_microservices image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} # extends: # file: hwaccel.yml # service: hwaccel command: [ "start.sh", "microservices" ] volumes: - /disks/storage/immich/volumes/geocoding:/usr/src/app/.reverse-geocoding-dump - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - .env depends_on: - redis - database - typesense restart: always immich-machine-learning: user: 1000:1001 container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} volumes: - /disks/storage/immich/volumes/model-cache:/cache env_file: - .env restart: always immich-web: container_name: immich_web image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release} env_file: - .env restart: always typesense: container_name: immich_typesense image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd environment: - TYPESENSE_API_KEY=${TYPESENSE_API_KEY} - TYPESENSE_DATA_DIR=/data # remove this to get debug messages - GLOG_minloglevel=1 volumes: - /disks/storage/immich/volumes/tsdata:/data restart: always redis: container_name: immich_redis image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3 restart: always database: user: 1000:1001 container_name: immich_postgres image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441 env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - /disks/storage/immich/volumes/pgdata:/var/lib/postgresql/data restart: always immich-proxy: container_name: immich_proxy image: ghcr.io/immich-app/immich-proxy:${IMMICH_VERSION:-release} environment: # Make sure these values get passed through from the env file - IMMICH_SERVER_URL - IMMICH_WEB_URL ports: - 2283:8080 depends_on: - immich-server - immich-web restart: always ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables PUID=1000 GUID=1001 # The location where your uploaded files are stored UPLOAD_LOCATION=<...> # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secrets for postgres and typesense. You should change these to random passwords TYPESENSE_API_KEY=<...> DB_PASSWORD=<...> TZ=America/New_York # The values below this line do not need to be changed ################################################################################### DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich_redis ``` ### Reproduction steps ```bash 1. Start typing a name ``` ### Additional information _No response_
Author
Owner

@martabal commented on GitHub (Oct 20, 2023):

Hello, just to understand your issue : Do you have more than 20 people whose names begin with the letter 'R,' and do you also have people with names starting with 'Ri' ?

@martabal commented on GitHub (Oct 20, 2023): Hello, just to understand your issue : Do you have more than 20 people whose names begin with the letter 'R,' and do you also have people with names starting with 'Ri' ?
Author
Owner

@eygraber commented on GitHub (Oct 20, 2023):

It's possible that there's more than 20 people whose names start with the letter 'R', but I can't easily count because there's no way to order by name.

I do have names that start with 'Ri'

@eygraber commented on GitHub (Oct 20, 2023): It's possible that there's more than 20 people whose names start with the letter 'R', but I can't easily count because there's no way to order by name. I do have names that start with 'Ri'
Author
Owner

@martabal commented on GitHub (Oct 20, 2023):

Does it suggest 5 people ?

@martabal commented on GitHub (Oct 20, 2023): Does it suggest 5 people ?
Author
Owner

@martabal commented on GitHub (Oct 20, 2023):

Sorry, from what you wrote there no people suggested when you type 'Rai', but do you have people names starting with 'Rai'?

@martabal commented on GitHub (Oct 20, 2023): Sorry, from what you wrote there no people suggested when you type 'Rai', but do you have people names starting with 'Rai'?
Author
Owner

@eygraber commented on GitHub (Oct 20, 2023):

If I type 'R' it shows me two results, both of which start with 'Ra' even though there are more names that start with 'R'. If I type 'Ri' it shows me no results even though there are names that start with 'Ri'

@eygraber commented on GitHub (Oct 20, 2023): If I type 'R' it shows me two results, both of which start with 'Ra' even though there are more names that start with 'R'. If I type 'Ri' it shows me no results even though there are names that start with 'Ri'
Author
Owner

@martabal commented on GitHub (Oct 20, 2023):

I can't reproduce it, can you help me figure this out ? Before typing a name, open the network tab in your developper tools (right click on your page > Inspect > Network). Then type 'R', then 'Ri'. You should see 2 requests.

@martabal commented on GitHub (Oct 20, 2023): I can't reproduce it, can you help me figure this out ? Before typing a name, open the network tab in your developper tools (right click on your page > Inspect > Network). Then type 'R', then 'Ri'. You should see 2 requests.
Author
Owner

@akropp commented on GitHub (Oct 20, 2023):

This is happening to me too. Some names will appear as suggestions, but other names never do. If I type the full name and hit enter, it will ask if I want to merge it with the correct person.

@akropp commented on GitHub (Oct 20, 2023): This is happening to me too. Some names will appear as suggestions, but other names never do. If I type the full name and hit enter, it will ask if I want to merge it with the correct person.
Author
Owner

@martabal commented on GitHub (Oct 21, 2023):

I improved a bit the functionality with #4566, but since I couldn't reproduce your issues, I would be interested if you could test my changes 😄

If it does not work, could you record a video showing the issue with the network tab and/or provide your docker logs (don't forget to hide your personal informations) ?

@martabal commented on GitHub (Oct 21, 2023): I improved a bit the functionality with #4566, but since I couldn't reproduce your issues, I would be interested if you could test my changes :smile: If it does not work, could you record a video showing the issue with the network tab and/or provide your docker logs (don't forget to hide your personal informations) ?
Author
Owner

@eygraber commented on GitHub (Oct 21, 2023):

When I type 'R' I see a request made to /api/search/person?name=R which returns an array of two objects corresponding to the two results I see. Then I type 'i' and I see no request made. In fact, after the first request, no matter what I type after the 'R' I don't see any other requests made.

If I erase the input, and type 'D' then I get back two results (even though there should be more than two), and if I then type an 'a', no request is made.

@eygraber commented on GitHub (Oct 21, 2023): When I type 'R' I see a request made to `/api/search/person?name=R` which returns an array of two objects corresponding to the two results I see. Then I type 'i' and I see no request made. In fact, after the first request, no matter what I type after the 'R' I don't see any other requests made. If I erase the input, and type 'D' then I get back two results (even though there should be more than two), and if I then type an 'a', no request is made.
Author
Owner

@martabal commented on GitHub (Oct 21, 2023):

In fact, after the first request, no matter what I type after the 'R' I don't see any other requests made.

It makes sense, the server returns only an array of maximum 20 objects. If it returns less than 20 objects it does not make a new API request, if it returns 20 objects, it makes a new API request with the new letter.

If the server returns only 2 objects, it means it's a server side issue. Does the person you're looking for (the one whose name starts with 'Ri') have special characters in his name or something unusual ?

@martabal commented on GitHub (Oct 21, 2023): > In fact, after the first request, no matter what I type after the 'R' I don't see any other requests made. It makes sense, the server returns only an array of maximum 20 objects. If it returns less than 20 objects it does not make a new API request, if it returns 20 objects, it makes a new API request with the new letter. If the server returns only 2 objects, it means it's a server side issue. Does the person you're looking for (the one whose name starts with 'Ri') have special characters in his name or something unusual ?
Author
Owner

@eygraber commented on GitHub (Oct 22, 2023):

Nope, nothing unusual, just regular ASCII in all of my names

@eygraber commented on GitHub (Oct 22, 2023): Nope, nothing unusual, just regular ASCII in all of my names
Author
Owner

@martabal commented on GitHub (Oct 22, 2023):

Do you have errors in your server logs ?

I improved a bit the functionality with #4566, but since I couldn't reproduce your issues, I would be interested if you could test my changes 😄

Did you test it ? (You just have to replace the release tag by pr-4566)

If none of these worked, it may be worth to try re-running the recognize faces job

@martabal commented on GitHub (Oct 22, 2023): Do you have errors in your server logs ? > I improved a bit the functionality with #4566, but since I couldn't reproduce your issues, I would be interested if you could test my changes 😄 Did you test it ? (You just have to replace the `release` tag by `pr-4566`) If none of these worked, it may be worth to try re-running the recognize faces job
Author
Owner

@eygraber commented on GitHub (Oct 22, 2023):

There are no errors in the server logs, using pr-4566 didn't work, and I already re-ran the recognize faces job.

I can try checking in postgres to see if the correct data is present. Do you know what query I should use to check for that?

@eygraber commented on GitHub (Oct 22, 2023): There are no errors in the server logs, using `pr-4566` didn't work, and I already re-ran the recognize faces job. I can try checking in postgres to see if the correct data is present. Do you know what query I should use to check for that?
Author
Owner

@eygraber commented on GitHub (Oct 22, 2023):

Running SELECT COUNT(*) FROM person WHERE name LIKE 'R%'; returns 31 so there are definitely names that should be getting returned. I'm not sure how the data is actually loaded, but the data is there in the db.

@eygraber commented on GitHub (Oct 22, 2023): Running `SELECT COUNT(*) FROM person WHERE name LIKE 'R%';` returns 31 so there are definitely names that should be getting returned. I'm not sure how the data is actually loaded, but the data is there in the db.
Author
Owner

@martabal commented on GitHub (Oct 22, 2023):

First, you need to get your user id with :

SELECT users.id from users WHERE users.email='<your_user_email>'

Then edit the following sql query and replace <your_user_id> with the user id returned.

SELECT "person"."id" AS "person_id", "person"."createdAt" AS "person_createdAt", "person"."updatedAt" AS "person_updatedAt", "person"."ownerId" AS "person_ownerId", "person"."name" AS "person_name", "person"."birthDate" AS "person_birthDate", "person"."thumbnailPath" AS "person_thumbnailPath", "person"."faceAssetId" AS "person_faceAssetId", "person"."isHidden" AS "person_isHidden" FROM "person" "person" LEFT JOIN "asset_faces" "face" ON "face"."personId"="person"."id" WHERE "person"."ownerId'='<your_user_id>' AND LOWER("person"."name") LIKE 'ri%' LIMIT 20
@martabal commented on GitHub (Oct 22, 2023): First, you need to get your user id with : ```sql SELECT users.id from users WHERE users.email='<your_user_email>' ``` Then edit the following sql query and replace `<your_user_id>` with the user id returned. ```sql SELECT "person"."id" AS "person_id", "person"."createdAt" AS "person_createdAt", "person"."updatedAt" AS "person_updatedAt", "person"."ownerId" AS "person_ownerId", "person"."name" AS "person_name", "person"."birthDate" AS "person_birthDate", "person"."thumbnailPath" AS "person_thumbnailPath", "person"."faceAssetId" AS "person_faceAssetId", "person"."isHidden" AS "person_isHidden" FROM "person" "person" LEFT JOIN "asset_faces" "face" ON "face"."personId"="person"."id" WHERE "person"."ownerId'='<your_user_id>' AND LOWER("person"."name") LIKE 'ri%' LIMIT 20 ```
Author
Owner

@martabal commented on GitHub (Oct 22, 2023):

Ok I think I know what the problem is and I could reproduce it. I left a useless left join which could return multiple times the same person. But pr-4566 should have fixed it 🤔

Can you try this sql query ? :

SELECT "person"."id" AS "person_id", "person"."createdAt" AS "person_createdAt", "person"."updatedAt" AS "person_updatedAt", "person"."ownerId" AS "person_ownerId", "person"."name" AS "person_name", "person"."birthDate" AS "person_birthDate", "person"."thumbnailPath" AS "person_thumbnailPath", "person"."faceAssetId" AS "person_faceAssetId", "person"."isHidden" AS "person_isHidden" FROM "person" "person" LEFT JOIN "asset_faces" "face" ON "face"."personId"="person"."id" WHERE "person"."ownerId" = '<your_user_id>' AND LOWER("person"."name") LIKE 'ri%' AND "person"."isHidden" = false GROUP BY "person"."id" ORDER BY COUNT("face"."assetId") DESC LIMIT 20
@martabal commented on GitHub (Oct 22, 2023): Ok I think I know what the problem is and I could reproduce it. I left a useless left join which could return multiple times the same person. But `pr-4566` should have fixed it :thinking: Can you try this sql query ? : ```sql SELECT "person"."id" AS "person_id", "person"."createdAt" AS "person_createdAt", "person"."updatedAt" AS "person_updatedAt", "person"."ownerId" AS "person_ownerId", "person"."name" AS "person_name", "person"."birthDate" AS "person_birthDate", "person"."thumbnailPath" AS "person_thumbnailPath", "person"."faceAssetId" AS "person_faceAssetId", "person"."isHidden" AS "person_isHidden" FROM "person" "person" LEFT JOIN "asset_faces" "face" ON "face"."personId"="person"."id" WHERE "person"."ownerId" = '<your_user_id>' AND LOWER("person"."name") LIKE 'ri%' AND "person"."isHidden" = false GROUP BY "person"."id" ORDER BY COUNT("face"."assetId") DESC LIMIT 20 ```
Author
Owner

@eygraber commented on GitHub (Oct 22, 2023):

That query returned the correct results. Not sure why pr-4566 didn't work. Did I need to do something other than:

docker compose down
<update docker-compose.yml>
docker compose up
@eygraber commented on GitHub (Oct 22, 2023): That query returned the correct results. Not sure why `pr-4566` didn't work. Did I need to do something other than: ``` docker compose down <update docker-compose.yml> docker compose up ```
Author
Owner

@martabal commented on GitHub (Oct 22, 2023):

Yeah should be good. To make sure it works, you should see the asset count below the person name.

@martabal commented on GitHub (Oct 22, 2023): Yeah should be good. To make sure it works, you should see the asset count below the person name.
Author
Owner

@WinnerOK commented on GitHub (Oct 22, 2023):

Hi everyone. I am also facing this issue. I don't see any name suggestions in IOS app (neither names in English nor in Cyrillic)

Ping me if you need to test anything.

@WinnerOK commented on GitHub (Oct 22, 2023): Hi everyone. I am also facing this issue. I don't see any name suggestions in IOS app (neither names in English nor in Cyrillic) Ping me if you need to test anything.
Author
Owner

@martabal commented on GitHub (Oct 22, 2023):

Hi everyone. I am also facing this issue. I don't see any name suggestions in IOS app (neither names in English nor in Cyrillic)

Ping me if you need to test anything.

It's only on the web

@martabal commented on GitHub (Oct 22, 2023): > Hi everyone. I am also facing this issue. I don't see any name suggestions in IOS app (neither names in English nor in Cyrillic) > > Ping me if you need to test anything. It's only on the web
Author
Owner

@WinnerOK commented on GitHub (Oct 22, 2023):

Hi everyone. I am also facing this issue. I don't see any name suggestions in IOS app (neither names in English nor in Cyrillic)
Ping me if you need to test anything.

It's only on the web

Do you mean this issue is only for web and I should create a separate for mobile?

Or you mean that name suggestions work only in web?

@WinnerOK commented on GitHub (Oct 22, 2023): > > Hi everyone. I am also facing this issue. I don't see any name suggestions in IOS app (neither names in English nor in Cyrillic) > > Ping me if you need to test anything. > > It's only on the web Do you mean this issue is only for web and I should create a separate for mobile? Or you mean that name suggestions work only in web?
Author
Owner

@martabal commented on GitHub (Oct 22, 2023):

The mobile app has no name suggestion when typing a person name. Don't create a new issue, but if it has not be done, you can open a Feature Request.

The name suggestion is only a feature available on the web.

@martabal commented on GitHub (Oct 22, 2023): The mobile app has no name suggestion when typing a person name. Don't create a new issue, but if it has not be done, you can open a Feature Request. The name suggestion is only a feature available on the web.
Author
Owner

@eygraber commented on GitHub (Oct 24, 2023):

@martabal just tried again with pr-4566 and it worked (I must've forgot to pull last time). That being said, I'd much prefer if the search was a prefix search. It seems odd to me that I type 'R' and none of the 5 results start with an 'R' because there are other people with a higher asset count that have an 'r' somewhere in their name.

@eygraber commented on GitHub (Oct 24, 2023): @martabal just tried again with `pr-4566` and it worked (I must've forgot to pull last time). That being said, I'd much prefer if the search was a prefix search. It seems odd to me that I type 'R' and none of the 5 results start with an 'R' because there are other people with a higher asset count that have an 'r' somewhere in their name.
Author
Owner

@martabal commented on GitHub (Oct 24, 2023):

Yeah I changed to use the same UX as the App-Which-Must-Not-Be-Named.

@martabal commented on GitHub (Oct 24, 2023): Yeah I changed to use the same UX as the _App-Which-Must-Not-Be-Named_.
Author
Owner

@martabal commented on GitHub (Oct 24, 2023):

I changed it to return people which has the letter/word you're typing in the prefix of their first name or last name

@martabal commented on GitHub (Oct 24, 2023): I changed it to return people which has the letter/word you're typing in the prefix of their first name or last name
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1482