~alanpearce/searchix

a5f58bc7fe205b8ff84f6b654513e40bfbc61ae9 — Alan Pearce 4 months ago 9440d2f
fix: opensearch searches not using input query
2 files changed, 3 insertions(+), 5 deletions(-)

M internal/config/config.go
M internal/server/mux.go
M internal/config/config.go => internal/config/config.go +2 -4
@@ 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 +1 -1
@@ 295,7 295,7 @@ func NewMux(
						source.Importer.String(),
						source.Key,
						"search",
					).AddQuery("query", "{searchTerms}"),
					).AddRawQuery("query", "{searchTerms}"),
				},
			}
			enc := xml.NewEncoder(w)