From bd7818b67e16f740396e2e3190eb0aee2f5950c9 Mon Sep 17 00:00:00 2001 From: Boris Date: Fri, 15 Nov 2024 19:57:40 +0300 Subject: [PATCH] fix wildcard for filters --- modules/router/router.go | 4 ++-- modules/version/version.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/router/router.go b/modules/router/router.go index 91f643a..bbb5610 100644 --- a/modules/router/router.go +++ b/modules/router/router.go @@ -653,7 +653,7 @@ func (rt *Router) ApiHandler(w http.ResponseWriter, r *http.Request) { for _, f := range request.Search.Filters { if f.Operation == "is" { - filters += `{ "wildcard": {"` + f.Field + `": {"value": "` + f.Value + `" } } },` + filters += `{ "wildcard": {"` + f.Field + `.keyword": {"value": "` + f.Value + `" } } },` } else if f.Operation == "exists" { filters += `{ "exists": {"field":"` + f.Field + `" } },` } else if f.Operation == "is_not" { @@ -747,7 +747,7 @@ func (rt *Router) ApiHandler(w http.ResponseWriter, r *http.Request) { for _, f := range request.Search.Filters { if f.Operation == "is" { - filters += `{ "wildcard": {"` + f.Field + `": {"value": "` + f.Value + `" } } },` + filters += `{ "wildcard": {"` + f.Field + `.keyword": {"value": "` + f.Value + `" } } },` } else if f.Operation == "exists" { filters += `{ "exists": {"field":"` + f.Field + `" } },` } else if f.Operation == "is_not" { diff --git a/modules/version/version.go b/modules/version/version.go index ad72379..a3f675d 100644 --- a/modules/version/version.go +++ b/modules/version/version.go @@ -13,4 +13,4 @@ package version -var Version = "extractor/v0.2.14" +var Version = "extractor/v0.2.15"