diff --git a/Services/server/src/controllers/searchController.ts b/Services/server/src/controllers/searchController.ts index cc9db6f..77b35f4 100644 --- a/Services/server/src/controllers/searchController.ts +++ b/Services/server/src/controllers/searchController.ts @@ -23,17 +23,20 @@ export class SearchController extends Controller { bool: { must: search.AND?.map((v) => ({ [type[search.exact || v.exact ? 1 : 0]]: { [v.field]: v.value }, - })).concat({ - [["match", "prefix"][search.recursive ? 1 : 0]]: { - path: search.path?.join("/") || "", - }, - }), + })), should: search.OR?.map((v) => ({ [type[search.exact || v.exact ? 1 : 0]]: { [v.field]: v.value }, })), must_not: { match: { hidden: true }, }, + filter: [ + { + [["match", "prefix"][search.recursive ? 1 : 0]]: { + path: search.path?.join("/") || "", + }, + }, + ], }, }, size: 10000,