diff --git a/pkg/cmd/pr/shared/params.go b/pkg/cmd/pr/shared/params.go index 742b3795b..9504ecef4 100644 --- a/pkg/cmd/pr/shared/params.go +++ b/pkg/cmd/pr/shared/params.go @@ -228,7 +228,7 @@ func SearchQueryBuild(options FilterOptions, advancedIssueSearchSyntax bool) str if advancedIssueSearchSyntax { q = query.AdvancedIssueSearchString() } else { - q = query.String() + q = query.StandardSearchString() } if options.Search != "" { diff --git a/pkg/cmd/repo/list/http.go b/pkg/cmd/repo/list/http.go index 0508c6d80..d896c9224 100644 --- a/pkg/cmd/repo/list/http.go +++ b/pkg/cmd/repo/list/http.go @@ -213,5 +213,5 @@ func searchQuery(owner string, filter FilterOptions) string { }, } - return q.String() + return q.StandardSearchString() } diff --git a/pkg/search/query.go b/pkg/search/query.go index 92eb1fcd6..0419e359a 100644 --- a/pkg/search/query.go +++ b/pkg/search/query.go @@ -101,7 +101,7 @@ type Qualifiers struct { // // At the moment, the advanced search syntax is only available for searching // issues, and it's called advanced issue search. -func (q Query) String() string { +func (q Query) StandardSearchString() string { qualifiers := formatQualifiers(q.Qualifiers, nil) keywords := formatKeywords(q.Keywords) all := append(keywords, qualifiers...) diff --git a/pkg/search/query_test.go b/pkg/search/query_test.go index 457c17b86..7c20e5348 100644 --- a/pkg/search/query_test.go +++ b/pkg/search/query_test.go @@ -8,7 +8,7 @@ import ( var trueBool = true -func TestQueryString(t *testing.T) { +func TestStandardSearchString(t *testing.T) { tests := []struct { name string query Query @@ -73,7 +73,7 @@ func TestQueryString(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - assert.Equal(t, tt.out, tt.query.String()) + assert.Equal(t, tt.out, tt.query.StandardSearchString()) }) } } diff --git a/pkg/search/searcher.go b/pkg/search/searcher.go index 7097d2fe8..5cc94ac9e 100644 --- a/pkg/search/searcher.go +++ b/pkg/search/searcher.go @@ -220,7 +220,7 @@ func (s searcher) search(query Query, result interface{}) (*http.Response, error } if !features.AdvancedIssueSearchAPI { - qs.Set("q", query.String()) + qs.Set("q", query.StandardSearchString()) } else { qs.Set("q", query.AdvancedIssueSearchString()) @@ -230,7 +230,7 @@ func (s searcher) search(query Query, result interface{}) (*http.Response, error } } } else { - qs.Set("q", query.String()) + qs.Set("q", query.StandardSearchString()) } if query.Order != "" { @@ -278,7 +278,7 @@ func (s searcher) URL(query Query) string { // 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()) + qs.Set("q", query.StandardSearchString()) if query.Order != "" { qs.Set(orderKey, query.Order)