MCPcopy Index your code
hub / github.com/cli/cli / StandardSearchString

Method StandardSearchString

pkg/search/query.go:119–129  ·  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

117// At the moment, the advanced search syntax is only available for searching
118// issues, and it's called advanced issue search.
119func (q Query) StandardSearchString() string {
120 qualifiers := formatQualifiers(q.Qualifiers, nil)
121 var keywords []string
122 if q.ImmutableKeywords != "" {
123 keywords = []string{q.ImmutableKeywords}
124 } else if ks := formatKeywords(q.Keywords); len(ks) > 0 {
125 keywords = ks
126 }
127 all := append(keywords, qualifiers...)
128 return strings.TrimSpace(strings.Join(all, " "))
129}
130
131// AdvancedIssueSearchString returns the string representation of the query
132// 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