From 04cce6b35eeef38a722c78000a54ea60fac7c4e5 Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Sun, 31 Aug 2025 15:36:31 +0100 Subject: [PATCH] docs(search): improve `Searcher.URL` method docs Signed-off-by: Babak K. Shandiz --- pkg/search/searcher.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/search/searcher.go b/pkg/search/searcher.go index 6d0cccfc4..3fe69fd2a 100644 --- a/pkg/search/searcher.go +++ b/pkg/search/searcher.go @@ -263,11 +263,18 @@ func (s searcher) search(query Query, result interface{}) (*http.Response, error return resp, nil } +// URL returns URL to the global search in web GUI (i.e. github.com/search). func (s searcher) URL(query Query) string { path := fmt.Sprintf("https://%s/search", s.host) qs := url.Values{} qs.Set("type", query.Kind) + + // TODO(babakks): currently, the global search GUI does not support the + // advanced issue search syntax (even for the issues/PRs tab on the + // sidebar). When the GUI is updated, we can use feature detection, and, if + // available, use the advanced search syntax. qs.Set("q", query.String()) + if query.Order != "" { qs.Set(orderKey, query.Order) }