feat(server)!: search via typesense (#1778)

* build: add typesense to docker

* feat(server): typesense search

* feat(web): search

* fix(web): show api error response message

* chore: search tests

* chore: regenerate open api

* fix: disable typesense on e2e

* fix: number properties for open api (dart)

* fix: e2e test

* fix: change lat/lng from floats to typesense geopoint

* dev: Add smartInfo relation to findAssetById to be able to query against it

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Jason Rasmussen
2023-03-02 21:47:08 -05:00
committed by GitHub
parent 1cc184ed10
commit 0aaeab124d
87 changed files with 3638 additions and 77 deletions

View File

@@ -17,3 +17,5 @@ ENABLE_MAPBOX=false
# WEB
MAPBOX_KEY=
VITE_SERVER_ENDPOINT=http://localhost:2283/api
TYPESENSE_ENABLED=false

View File

@@ -23,6 +23,7 @@ services:
depends_on:
- redis
- database
- typesense
immich-machine-learning:
container_name: immich_machine_learning
@@ -64,6 +65,7 @@ services:
depends_on:
- database
- immich-server
- typesense
immich-web:
container_name: immich_web
@@ -89,6 +91,15 @@ services:
depends_on:
- immich-server
typesense:
container_name: immich_typesense
image: typesense/typesense:0.24.0
environment:
- TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
- TYPESENSE_DATA_DIR=/data
volumes:
- tsdata:/data
redis:
container_name: immich_redis
image: redis:6.2
@@ -129,3 +140,4 @@ services:
volumes:
pgdata:
model-cache:
tsdata:

View File

@@ -1,4 +1,4 @@
version: '3.8'
version: "3.8"
services:
immich-server-test:
@@ -9,7 +9,7 @@ services:
target: builder
command: npm run test:e2e
expose:
- '3000'
- "3000"
volumes:
- ../server:/usr/src/app
- /usr/src/app/node_modules
@@ -17,6 +17,7 @@ services:
- .env.test
environment:
- NODE_ENV=development
- TYPESENSE_ENABLED=false
depends_on:
- immich-redis-test
- immich-database-test

View File

@@ -4,7 +4,7 @@ services:
immich-server:
container_name: immich_server
image: altran1502/immich-server:release
entrypoint: [ "/bin/sh", "./start-server.sh" ]
entrypoint: ["/bin/sh", "./start-server.sh"]
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
env_file:
@@ -14,12 +14,13 @@ services:
depends_on:
- redis
- database
- typesense
restart: always
immich-microservices:
container_name: immich_microservices
image: altran1502/immich-server:release
entrypoint: [ "/bin/sh", "./start-microservices.sh" ]
entrypoint: ["/bin/sh", "./start-microservices.sh"]
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
env_file:
@@ -29,6 +30,7 @@ services:
depends_on:
- redis
- database
- typesense
restart: always
immich-machine-learning:
@@ -46,11 +48,20 @@ services:
immich-web:
container_name: immich_web
image: altran1502/immich-web:release
entrypoint: [ "/bin/sh", "./entrypoint.sh" ]
entrypoint: ["/bin/sh", "./entrypoint.sh"]
env_file:
- .env
restart: always
typesense:
container_name: immich_typesense
image: typesense/typesense:0.24.0
environment:
- TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
- TYPESENSE_DATA_DIR=/data
volumes:
- tsdata:/data
redis:
container_name: immich_redis
image: redis:6.2
@@ -88,3 +99,4 @@ services:
volumes:
pgdata:
model-cache:
tsdata:

View File

@@ -30,6 +30,13 @@ REDIS_HOSTNAME=immich_redis
UPLOAD_LOCATION=absolute_location_on_your_machine_where_you_want_to_store_the_backup
###################################################################################
# Typesense
###################################################################################
TYPESENSE_API_KEY=some-random-text
# TYPESENSE_ENABLED=false
###################################################################################
# Reverse Geocoding
#
@@ -76,4 +83,4 @@ IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003
# Examples: http://localhost:3001, http://immich-api.example.com, etc
####################################################################################
#IMMICH_API_URL_EXTERNAL=http://localhost:3001
#IMMICH_API_URL_EXTERNAL=http://localhost:3001