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

@@ -544,6 +544,171 @@
]
}
},
"/search": {
"get": {
"operationId": "search",
"description": "",
"parameters": [
{
"name": "query",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "type",
"required": false,
"in": "query",
"schema": {
"enum": [
"IMAGE",
"VIDEO",
"AUDIO",
"OTHER"
],
"type": "string"
}
},
{
"name": "isFavorite",
"required": false,
"in": "query",
"schema": {
"type": "boolean"
}
},
{
"name": "exifInfo.city",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "exifInfo.state",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "exifInfo.country",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "exifInfo.make",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "exifInfo.model",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "smartInfo.objects",
"required": false,
"in": "query",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"name": "smartInfo.tags",
"required": false,
"in": "query",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchResponseDto"
}
}
}
}
},
"tags": [
"Search"
],
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"bearer": []
},
{
"cookie": []
}
]
}
},
"/search/config": {
"get": {
"operationId": "getSearchConfig",
"description": "",
"parameters": [],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchConfigResponseDto"
}
}
}
}
},
"tags": [
"Search"
],
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"bearer": []
},
{
"cookie": []
}
]
}
},
"/share": {
"get": {
"operationId": "getAllSharedLinks",
@@ -3554,13 +3719,6 @@
"url"
]
},
"SharedLinkType": {
"type": "string",
"enum": [
"ALBUM",
"INDIVIDUAL"
]
},
"AssetTypeEnum": {
"type": "string",
"enum": [
@@ -3871,6 +4029,130 @@
"owner"
]
},
"SearchFacetCountResponseDto": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"value": {
"type": "string"
}
},
"required": [
"count",
"value"
]
},
"SearchFacetResponseDto": {
"type": "object",
"properties": {
"fieldName": {
"type": "string"
},
"counts": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SearchFacetCountResponseDto"
}
}
},
"required": [
"fieldName",
"counts"
]
},
"SearchAlbumResponseDto": {
"type": "object",
"properties": {
"total": {
"type": "integer"
},
"count": {
"type": "integer"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AlbumResponseDto"
}
},
"facets": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SearchFacetResponseDto"
}
}
},
"required": [
"total",
"count",
"items",
"facets"
]
},
"SearchAssetResponseDto": {
"type": "object",
"properties": {
"total": {
"type": "integer"
},
"count": {
"type": "integer"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AssetResponseDto"
}
},
"facets": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SearchFacetResponseDto"
}
}
},
"required": [
"total",
"count",
"items",
"facets"
]
},
"SearchResponseDto": {
"type": "object",
"properties": {
"albums": {
"$ref": "#/components/schemas/SearchAlbumResponseDto"
},
"assets": {
"$ref": "#/components/schemas/SearchAssetResponseDto"
}
},
"required": [
"albums",
"assets"
]
},
"SearchConfigResponseDto": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
}
},
"required": [
"enabled"
]
},
"SharedLinkType": {
"type": "string",
"enum": [
"ALBUM",
"INDIVIDUAL"
]
},
"SharedLinkResponseDto": {
"type": "object",
"properties": {