MCPcopy Create free account
hub / github.com/cli/cli / StandardSearchString

Method StandardSearchString

pkg/search/query.go:126–136  ·  view source on GitHub ↗

String returns the string representation of the query which can be used with the legacy search backend, which is used in global search GUI (i.e. github.com/search), or Pull Requests tab (in repositories). Note that this is a common query format that can be used to search for various entity types (e.

()

Source from the content-addressed store, hash-verified

124// At the moment, the advanced search syntax is only available for searching
125// issues, and it's called advanced issue search.
126func (q Query) StandardSearchString() string {
127 qualifiers := formatQualifiers(q.Qualifiers, nil)
128 var keywords []string
129 if q.ImmutableKeywords != "" {
130 keywords = []string{q.ImmutableKeywords}
131 } else if ks := formatKeywords(q.Keywords); len(ks) > 0 {
132 keywords = ks
133 }
134 all := append(keywords, qualifiers...)
135 return strings.TrimSpace(strings.Join(all, " "))
136}
137
138// AdvancedIssueSearchString returns the string representation of the query
139// compatible with the advanced issue search syntax. The query can be used in

Callers 5

searchQueryFunction · 0.95
SearchQueryBuildFunction · 0.95
TestStandardSearchStringFunction · 0.80
searchMethod · 0.80
URLMethod · 0.80

Calls 3

formatQualifiersFunction · 0.85
formatKeywordsFunction · 0.85
JoinMethod · 0.80

Tested by 1

TestStandardSearchStringFunction · 0.64