Merge branch 'feat/search-under' into development

This commit is contained in:
Methapon2001 2024-01-12 10:56:55 +07:00
commit 59dab45f51
No known key found for this signature in database
GPG key ID: 849924FEF46BD132
2 changed files with 7 additions and 1 deletions

View file

@ -23,7 +23,11 @@ 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 },
})),

View file

@ -10,4 +10,6 @@ export interface Search {
exact?: boolean;
}[];
exact?: boolean;
recursive?: boolean;
path?: string[];
}