refactor: change from word match to wildcard

This commit is contained in:
Methapon2001 2024-07-30 14:10:07 +07:00
parent 6375a449e6
commit 17205fc2bc

View file

@ -49,14 +49,11 @@ export class LogController extends Controller {
? [
{
bool: {
should: [
{
multi_match: {
query: search,
fields: ["method", "logType", "endpoint", "host", "responseCode"],
},
},
],
should: ["method", "logType", "endpoint", "host", "responseCode"].map(
(v) => ({
wildcard: { [v]: "*" + search + "*" },
}),
),
},
},
]