You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7e6e3b7
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: pkg/cmd/brand.go
+20-2Lines changed: 20 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -154,20 +154,38 @@ var brandRetrieveSimplified = cli.Command{
154
154
155
155
varbrandSearch= cli.Command{
156
156
Name: "search",
157
-
Usage: "Search brands by name or domain and get back up to 10 lightweight matches\n(domain, name, logo). Name matches rank ahead of domain matches; within each\ngroup the most popular brands come first: by Tranco rank, then market cap for\nbrands outside the Tranco list, with text relevance breaking ties. Matching is\nprefix-based with no typo tolerance, so it is suited to autocomplete. Only\nbrands already in the Context.dev index are returned — use /brand/retrieve to\nfetch (and index) a specific domain. Free on Pro and Scale plans; costs 1 credit\nper request on the Free and Starter plans.",
157
+
Usage: "Search indexed brands by name or domain",
158
158
Suggest: true,
159
159
Flags: []cli.Flag{
160
160
&requestflag.Flag[string]{
161
161
Name: "query",
162
-
Usage: "Search term, matched against brand names and domains by prefix (e.g. 'nike', 'nike.com', 'nik').",
162
+
Usage: "Search term, matched against the fields selected by queryBy (e.g. 'nike', 'nike.com', 'nik').",
163
163
Required: true,
164
164
QueryPath: "query",
165
165
},
166
+
&requestflag.Flag[bool]{
167
+
Name: "autocomplete",
168
+
Usage: "Whether the search term matches by prefix, so partial words match as they are typed (e.g. 'nik' matches Nike). Set to false to match whole words only.",
169
+
Default: true,
170
+
QueryPath: "autocomplete",
171
+
},
172
+
&requestflag.Flag[[]string]{
173
+
Name: "query-by",
174
+
Usage: "Fields to match the search term against, as a comma-separated list or repeated parameter: 'name', 'domain', or both. Defaults to both.",
175
+
Default: []string{"name", "domain"},
176
+
QueryPath: "queryBy",
177
+
},
166
178
&requestflag.Flag[[]string]{
167
179
Name: "tag",
168
180
Usage: "Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.",
169
181
QueryPath: "tags",
170
182
},
183
+
&requestflag.Flag[int64]{
184
+
Name: "typo-tolerance",
185
+
Usage: "Maximum number of typos tolerated when matching, from 0 to 2. Defaults to 0 (no typo tolerance).",
0 commit comments