fix: opensearch searches not using input query
Alan Pearce alan@alanpearce.eu
Fri, 12 Jul 2024 21:10:47 +0200
2 files changed, 3 insertions(+), 5 deletions(-)
M internal/config/config.go → internal/config/config.go
@@ -35,10 +35,8 @@ func (u *URL) JoinPath(elems ...string) *URL { return &URL{u.URL.JoinPath(elems...)} } -func (u *URL) AddQuery(key, value string) *URL { - q := u.URL.Query() - q.Add(key, value) - u.RawQuery = q.Encode() +func (u *URL) AddRawQuery(key, value string) *URL { + u.RawQuery = key + "=" + value return u }
M internal/server/mux.go → internal/server/mux.go
@@ -295,7 +295,7 @@ Template: cfg.Web.BaseURL.JoinPath( source.Importer.String(), source.Key, "search", - ).AddQuery("query", "{searchTerms}"), + ).AddRawQuery("query", "{searchTerms}"), }, } enc := xml.NewEncoder(w)