diff --git a/.gitignore b/.gitignore index 7f7bde97..1f042521 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,7 @@ vendor/ # local build -algolia \ No newline at end of file +algolia + +# Ignore docs directory +docs/ \ No newline at end of file diff --git a/Makefile b/Makefile index 18ca53fb..25566f01 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ VARIATION ?= old ifeq ($(VARIATION),old) DOCS_FOLDER = docs DOCS_GENERATED_PATH = app_data/cli/commands -DOCS_REPO_URL = https://github.com/algolia/doc.git +DOCS_REPO_URL = git@github.com:algolia/doc.git DOCS_BRANCH = master DOCS_EXTENSION = yml else ifeq ($(VARIATION),new) diff --git a/pkg/cmd/apikeys/create/create.go b/pkg/cmd/apikeys/create/create.go index aac5f274..b9f55ccc 100644 --- a/pkg/cmd/apikeys/create/create.go +++ b/pkg/cmd/apikeys/create/create.go @@ -61,42 +61,41 @@ func NewCreateCmd(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co } cmd.Flags().StringSliceVar(&opts.ACL, "acl", nil, heredoc.Docf(` - ACL of the API Key. - - %[1]ssearch%[1]s: allowed to perform search operations. - %[1]sbrowse%[1]s: allowed to retrieve all index data with the browse endpoint. - %[1]saddObject%[1]s: allowed to add or update a records in the index. - %[1]sdeleteObject%[1]s: allowed to delete an existing record. - %[1]slistIndexes%[1]s: allowed to get a list of all existing indices. - %[1]sdeleteIndex%[1]s: allowed to delete an index. - %[1]ssettings%[1]s: allowed to read all index settings. - %[1]seditSettings%[1]s: allowed to update all index settings. - %[1]sanalytics%[1]s: allowed to retrieve data with the Analytics API. - %[1]srecommendation%[1]s: allowed to interact with the Recommendation API. - %[1]susage%[1]s: allowed to retrieve data with the Usage API. - %[1]slogs%[1]s: allowed to query the logs. - %[1]sseeUnretrievableAttributes%[1]s: allowed to retrieve unretrievableAttributes for all operations that return records. + API key's ACL. + + %[1]ssearch%[1]s: can perform search operations. + %[1]sbrowse%[1]s: can retrieve all index data with the browse endpoint. + %[1]saddObject%[1]s: can add or update records in the index. + %[1]sdeleteObject%[1]s: can delete an existing record. + %[1]slistIndexes%[1]s: can get a list of all indices. + %[1]sdeleteIndex%[1]s: can delete an index. + %[1]ssettings%[1]s: can read all index settings. + %[1]seditSettings%[1]s: can update all index settings. + %[1]sanalytics%[1]s: can retrieve data with the Analytics API. + %[1]srecommendation%[1]s: can interact with the Recommendation API. + %[1]susage%[1]s: can retrieve data with the Usage API. + %[1]slogs%[1]s: can query the logs. + %[1]sseeUnretrievableAttributes%[1]s: can retrieve unretrievableAttributes for all operations that return records. `, "`")) cmd.Flags().StringSliceVarP(&opts.Indices, "indices", "i", nil, heredoc.Docf(` - Specify the list of targeted indices. - You can target all indices starting with a prefix or ending with a suffix using the %[1]s*%[1]s character. - For example, %[1]sdev_*%[1]s matches all indices starting with %[1]sdev_%[1]s and %[1]s*_dev%[1]s matches all indices ending with %[1]s_dev%[1]s. + Index names or patterns that this API key can access. By default, an API key can access all indices in the same application. + + You can use leading and trailing wildcard characters (%[1]s*%[1]s). + For example, %[1]sdev_*%[1]s matches all indices starting with %[1]sdev_%[1]s. %[1]s*_dev%[1]s matches all indices ending with %[1]s_dev%[1]s. %[1]s*_products_*%[1]s matches all indices containing %[1]sproducts%[1]s. `, "`")) cmd.Flags().DurationVarP(&opts.Validity, "validity", "u", 0, heredoc.Doc(` - How long this API key is valid, in seconds. - A value of 0 means the API key doesn’t expire.`, + Duration (in seconds) after which the API key expires. By default (a value of 0), API keys don't expire.`, )) cmd.Flags().StringSliceVarP(&opts.Referers, "referers", "r", nil, heredoc.Docf(` Specify the list of referrers that can perform an operation. - You can use the %[1]s*%[1]s (asterisk) character as a wildcard to match subdomains, or all pages of a website. + You can use the wildcard character (%[1]s*%[1]s) to match subdomains or entire websites. `, "`")) cmd.Flags().StringVarP(&opts.Description, "description", "d", "", heredoc.Doc(` - Specify a description of the API key. - Used for informative purposes only. It has no impact on the functionality of the API key.`, + Describe an API key to help you identify its uses.`, )) _ = cmd.RegisterFlagCompletionFunc("indices", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { @@ -130,7 +129,7 @@ func NewCreateCmd(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co "usage": "retrieve data with the Usage API", "logs": "query the logs", "seeUnretrievableAttributes": "retrieve unretrievableAttributes for all operations that return records", - }, "allowed to")) + }, "can")) return cmd } diff --git a/pkg/cmd/apikeys/delete/delete.go b/pkg/cmd/apikeys/delete/delete.go index 05eccfc1..2406b96d 100644 --- a/pkg/cmd/apikeys/delete/delete.go +++ b/pkg/cmd/apikeys/delete/delete.go @@ -36,7 +36,7 @@ func NewDeleteCmd(f *cmdutil.Factory, runF func(*DeleteOptions) error) *cobra.Co cmd := &cobra.Command{ Use: "delete ", - Short: "Delete API key", + Short: "Deletes the API key", Args: validators.ExactArgs(1), Annotations: map[string]string{ "acls": "admin", @@ -58,7 +58,7 @@ func NewDeleteCmd(f *cmdutil.Factory, runF func(*DeleteOptions) error) *cobra.Co }, } - cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "skip confirmation prompt") + cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "Skip the delete API key confirmation prompt") return cmd } diff --git a/pkg/cmd/apikeys/get/get.go b/pkg/cmd/apikeys/get/get.go index 78d5ed9f..3f89f9e1 100644 --- a/pkg/cmd/apikeys/get/get.go +++ b/pkg/cmd/apikeys/get/get.go @@ -37,7 +37,7 @@ func NewGetCmd(f *cmdutil.Factory, runF func(*GetOptions) error) *cobra.Command cmd := &cobra.Command{ Use: "get ", - Short: "Get API key", + Short: "Get the API key", Long: heredoc.Doc(` Get the details of a given API Key (ACLs, description, indexes, and other attributes). `), diff --git a/pkg/cmd/apikeys/list/list.go b/pkg/cmd/apikeys/list/list.go index e8cf28d4..c9f0e2ee 100644 --- a/pkg/cmd/apikeys/list/list.go +++ b/pkg/cmd/apikeys/list/list.go @@ -40,7 +40,7 @@ func NewListCmd(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman Annotations: map[string]string{ "acls": "admin", }, - Short: "List API keys", + Short: "Lists all API keys associated with your Algolia application, including their permissions and restrictions.", RunE: func(cmd *cobra.Command, args []string) error { if runF != nil { return runF(opts) diff --git a/pkg/cmd/crawler/crawl/crawl.go b/pkg/cmd/crawler/crawl/crawl.go index c04306ea..7ac8331a 100644 --- a/pkg/cmd/crawler/crawl/crawl.go +++ b/pkg/cmd/crawler/crawl/crawl.go @@ -39,7 +39,7 @@ func NewCrawlCmd(f *cmdutil.Factory, runF func(*CrawlOptions) error) *cobra.Comm ValidArgsFunction: cmdutil.CrawlerIDs(opts.CrawlerClient), Short: "Crawl specific URLs", Long: heredoc.Doc(` - Immediately crawl the given URLs. + Immediately crawl these URLs. The generated records are pushed to the live index if there's no ongoing reindex, and to the temporary index otherwise. `), Example: heredoc.Doc(` @@ -71,9 +71,9 @@ func NewCrawlCmd(f *cmdutil.Factory, runF func(*CrawlOptions) error) *cobra.Comm _ = cmd.MarkFlagRequired("urls") cmd.Flags().BoolVarP(&opts.Save, "save", "s", false, heredoc.Doc(` - When true, the given URLs are added to the extraUrls list of your configuration (unless already present in startUrls or sitemaps). - When false, the URLs aren't saved in the configuration. - When unspecified, the URLs are added to the extraUrls list of your configuration, but only if they haven't been indexed during the last reindex, and they aren't already present in startUrls or sitemaps. + When true, the URLs are added to your %[1]sextraUrls%[1]s (unless present in %[1]sstartUrls%[1]s or %[1]ssitemaps%[1]s). + When false, the URLs aren't added. + When unspecified, the URLs are added to your %[1]sextraUrls%[1]s (unless present in %[1]sstartUrls%[1]s or %[1]ssitemaps%[1]s or they weren't indexed during the preceding reindex). `)) return cmd diff --git a/pkg/cmd/crawler/pause/pause.go b/pkg/cmd/crawler/pause/pause.go index 766a9f3a..b604e3bd 100644 --- a/pkg/cmd/crawler/pause/pause.go +++ b/pkg/cmd/crawler/pause/pause.go @@ -35,7 +35,7 @@ func NewPauseCmd(f *cmdutil.Factory, runF func(*PauseOptions) error) *cobra.Comm ValidArgsFunction: cmdutil.CrawlerIDs(opts.CrawlerClient), Short: "Pause one or multiple crawlers", Long: heredoc.Doc(` - Request the specified crawler to pause its execution. + Pauses the specified crawler. `), Example: heredoc.Doc(` # Pause the crawler with the ID "my-crawler" diff --git a/pkg/cmd/crawler/reindex/reindex.go b/pkg/cmd/crawler/reindex/reindex.go index a4dc25cf..543ed7c6 100644 --- a/pkg/cmd/crawler/reindex/reindex.go +++ b/pkg/cmd/crawler/reindex/reindex.go @@ -33,7 +33,7 @@ func NewReindexCmd(f *cmdutil.Factory, runF func(*ReindexOptions) error) *cobra. Use: "reindex ...", Args: cobra.MinimumNArgs(1), ValidArgsFunction: cmdutil.CrawlerIDs(opts.CrawlerClient), - Short: "Reindex one or multiple crawlers", + Short: "Reindexes the specified crawlers", Long: heredoc.Doc(` Request the specified crawler to start (or restart) crawling. `), diff --git a/pkg/cmd/crawler/run/run.go b/pkg/cmd/crawler/run/run.go index 9429f068..2bd81e4b 100644 --- a/pkg/cmd/crawler/run/run.go +++ b/pkg/cmd/crawler/run/run.go @@ -33,10 +33,10 @@ func NewRunCmd(f *cmdutil.Factory, runF func(*RunOptions) error) *cobra.Command Use: "run ", Args: cobra.ExactArgs(1), ValidArgsFunction: cmdutil.CrawlerIDs(opts.CrawlerClient), - Short: "Run a crawler", + Short: "Start or resume a crawler", Long: heredoc.Doc(` - Unpause the specified crawler. If a crawl was previously ongoing, it will be resumed. - Otherwise, the crawler will go into the active state and wait for the next schedule. + Unpause the specified crawler. + Previously ongoing crawls will be resumed. Otherwise, the crawler waits for its next scheduled run. `), Example: heredoc.Doc(` # Run the crawler with the ID "my-crawler" diff --git a/pkg/cmd/crawler/test/test.go b/pkg/cmd/crawler/test/test.go index b01a0d53..91544ada 100644 --- a/pkg/cmd/crawler/test/test.go +++ b/pkg/cmd/crawler/test/test.go @@ -42,10 +42,9 @@ func NewTestCmd(f *cmdutil.Factory, runF func(*TestOptions) error) *cobra.Comman Use: "test --url [-F ]", Args: cobra.ExactArgs(1), ValidArgsFunction: cmdutil.CrawlerIDs(opts.CrawlerClient), - Short: "Test a URL on a crawler", + Short: "Tests a URL with the crawler's configuration and shows the extracted records.", Long: heredoc.Doc(` - Test an URL against the given crawler's configuration and see what will be processed. - You can also override parts of the configuration to try your changes before updating the configuration. + You can override parts of the configuration to test your changes before updating the configuration. `), Example: heredoc.Doc(` # Test the URL "https://www.example.com" against the crawler with the ID "my-crawler" diff --git a/pkg/cmd/dictionary/entries/browse/browse.go b/pkg/cmd/dictionary/entries/browse/browse.go index 8c1d40c4..05b19a80 100644 --- a/pkg/cmd/dictionary/entries/browse/browse.go +++ b/pkg/cmd/dictionary/entries/browse/browse.go @@ -28,7 +28,7 @@ type BrowseOptions struct { PrintFlags *cmdutil.PrintFlags } -// DictionaryEntry can be plural, compound or stopword entry. +// DictionaryEntry can be plural, compound, or stop word entry. type DictionaryEntry struct { Type shared.EntryType Word string `json:"word,omitempty"` @@ -63,7 +63,7 @@ func NewBrowseCmd(f *cmdutil.Factory, runF func(*BrowseOptions) error) *cobra.Co This command retrieves all entries from the specified %s dictionaries. `, cs.Bold("custom")), Example: heredoc.Doc(` - # Retrieve all entries from the "stopwords" dictionary (doesn't include default stopwords) + # Retrieve all entries from the "stopwords" dictionary (not including the Algolia default stop words) $ algolia dictionary entries browse stopwords # Retrieve all entries from the "stopwords" and "plurals" dictionaries @@ -72,7 +72,7 @@ func NewBrowseCmd(f *cmdutil.Factory, runF func(*BrowseOptions) error) *cobra.Co # Retrieve all entries from all dictionaries $ algolia dictionary entries browse --all - # Retrieve all entries from the "stopwords" dictionaries (including default stopwords) + # Retrieve all entries from the "stopwords" dictionaries (including the Algolia default stop words) $ algolia dictionary entries browse stopwords --include-defaults `), RunE: func(cmd *cobra.Command, args []string) error { @@ -120,7 +120,7 @@ func runBrowseCmd(opts *BrowseOptions) error { pageCount := 0 maxPages := 1 - // implement infinite pagination + // Infinite pagination for pageCount < maxPages { res, err := client.SearchDictionaryEntries(dictionary, "", opt.HitsPerPage(1000), opt.Page(pageCount)) if err != nil { @@ -131,13 +131,13 @@ func runBrowseCmd(opts *BrowseOptions) error { data, err := json.Marshal(res.Hits) if err != nil { - return fmt.Errorf("cannot unmarshal dictionary entries: error while marshalling original dictionary entries: %v", err) + return fmt.Errorf("can't unmarshal dictionary entries: error while marshalling original dictionary entries: %v", err) } var entries []DictionaryEntry err = json.Unmarshal(data, &entries) if err != nil { - return fmt.Errorf("cannot unmarshal dictionary entries: error while unmarshalling original dictionary entries: %v", err) + return fmt.Errorf("can't unmarshal dictionary entries: error while unmarshalling original dictionary entries: %v", err) } if len(entries) != 0 { @@ -146,12 +146,12 @@ func runBrowseCmd(opts *BrowseOptions) error { for _, entry := range entries { if opts.IncludeDefaultStopwords { - // print all entries (default stopwords included) + // Print all entries (inlcuding the default Algolia stop words) if err = p.Print(opts.IO, entry); err != nil { return err } } else if entry.Type == shared.CustomEntryType { - // print only custom entries + // Print only custom entries if err = p.Print(opts.IO, entry); err != nil { return err } @@ -161,12 +161,12 @@ func runBrowseCmd(opts *BrowseOptions) error { pageCount++ } - // in case no entry is found in all the dictionaries + // If no entry is found in all the dictionaries if hasNoEntries { if _, err = fmt.Fprintf(opts.IO.Out, "%s No entries found.\n\n", cs.WarningIcon()); err != nil { return err } - // go to the next dictionary + // Go to the next dictionary break } } diff --git a/pkg/cmd/dictionary/entries/clear/clear.go b/pkg/cmd/dictionary/entries/clear/clear.go index 7c8513a5..54617320 100644 --- a/pkg/cmd/dictionary/entries/clear/clear.go +++ b/pkg/cmd/dictionary/entries/clear/clear.go @@ -97,8 +97,8 @@ func NewClearCmd(f *cmdutil.Factory, runF func(*ClearOptions) error) *cobra.Comm }, } - cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "skip confirmation prompt") - cmd.Flags().BoolVarP(&opts.All, "all", "a", false, "clear all dictionaries") + cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "Skip the clear dictionary entry confirmation prompt") + cmd.Flags().BoolVarP(&opts.All, "all", "a", false, "Clear all dictionaries") return cmd } diff --git a/pkg/cmd/dictionary/entries/delete/delete.go b/pkg/cmd/dictionary/entries/delete/delete.go index 357f56df..81e8f425 100644 --- a/pkg/cmd/dictionary/entries/delete/delete.go +++ b/pkg/cmd/dictionary/entries/delete/delete.go @@ -78,7 +78,7 @@ func NewDeleteCmd(f *cmdutil.Factory, runF func(*DeleteOptions) error) *cobra.Co cmd.Flags().StringSliceVarP(&opts.ObjectIDs, "object-ids", "", nil, "Object IDs to delete") _ = cmd.MarkFlagRequired("object-ids") - cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "skip confirmation prompt") + cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "Skip the delete dictionary entry confirmation prompt") return cmd } diff --git a/pkg/cmd/dictionary/entries/entries.go b/pkg/cmd/dictionary/entries/entries.go index 106e82f9..00127541 100644 --- a/pkg/cmd/dictionary/entries/entries.go +++ b/pkg/cmd/dictionary/entries/entries.go @@ -10,11 +10,11 @@ import ( "github.com/algolia/cli/pkg/cmdutil" ) -// NewEntriesCmd returns a new command for dictionaries' entries. +// NewEntriesCmd returns a new command for dictionary entries. func NewEntriesCmd(f *cmdutil.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "entries", - Short: "Manage your Algolia dictionaries entries", + Short: "Manage your Algolia dictionary entries", } cmd.AddCommand(clear.NewClearCmd(f, nil)) diff --git a/pkg/cmd/dictionary/entries/import/import.go b/pkg/cmd/dictionary/entries/import/import.go index 84a0b9d8..c2b249a4 100644 --- a/pkg/cmd/dictionary/entries/import/import.go +++ b/pkg/cmd/dictionary/entries/import/import.go @@ -60,10 +60,10 @@ func NewImportCmd(f *cmdutil.Factory, runF func(*ImportOptions) error) *cobra.Co The file must contains one single JSON object per line (newline delimited JSON objects - ndjson format: https://ndjson.org/). `), Example: heredoc.Doc(` - # Import entries from the "entries.ndjson" file to "stopwords" dictionary + # Import entries from the "entries.ndjson" file to the "stopwords" dictionary $ algolia dictionary import stopwords -F entries.ndjson - # Import entries from the "entries.ndjson" file to "plurals" dictionary and continue importing entries even if some entries are invalid + # Import entries from the "entries.ndjson" file to the "plurals" dictionary and continue importing entries even if some entries are invalid $ algolia dictionary import plurals -F entries.ndjson --continue-on-errors `), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/pkg/cmd/dictionary/settings/set/set.go b/pkg/cmd/dictionary/settings/set/set.go index 877349f3..96417baa 100644 --- a/pkg/cmd/dictionary/settings/set/set.go +++ b/pkg/cmd/dictionary/settings/set/set.go @@ -41,16 +41,16 @@ func NewSetCmd(f *cmdutil.Factory, runF func(*SetOptions) error) *cobra.Command Long: heredoc.Doc(` Set the dictionary settings. - For now, the only setting available is to enable/disable the standard entries for the stopwords dictionary. + You can turn the standard stop words dictionary on or off. `), Example: heredoc.Doc(` - # Disable standard entries for English and French + # Tuen off standard entries for English and French $ algolia dictionary settings set --disable-standard-entries en,fr - # Enable standard entries for English and French languages + # Enable standard entries for English and French $ algolia dictionary settings set --enable-standard-entries en,fr - # Disable standard entries for English and French languages and enable standard entries for Spanish language. + # Turn off standard entries for English and French and enable standard entries for Spanish. $ algolia dictionary settings set --disable-standard-entries en,fr --enable-standard-entries es # Reset standard entries to their default values @@ -62,12 +62,12 @@ func NewSetCmd(f *cmdutil.Factory, runF func(*SetOptions) error) *cobra.Command return cmdutil.FlagErrorf("Either --disable-standard-entries and/or --enable-standard-entries or --reset-standard-entries must be set") } - // Check that the user is not resetting standard entries and trying to disable or enable standard entries at the same time + // Check that the user isn't resetting standard entries and trying to turn standard entries on or off at the same time if opts.ResetStandardEntries && (len(opts.DisableStandardEntries) > 0 || len(opts.EnableStandardEntries) > 0) { return cmdutil.FlagErrorf("You cannot reset standard entries and disable or enable standard entries at the same time") } - // Check if the user is trying to disable and enable standard entries for the same languages at the same time + // Check if the user is trying to turn standard entries on or off for the same languages at the same time for _, disableLanguage := range opts.DisableStandardEntries { for _, enableLanguage := range opts.EnableStandardEntries { if disableLanguage == enableLanguage { @@ -84,8 +84,8 @@ func NewSetCmd(f *cmdutil.Factory, runF func(*SetOptions) error) *cobra.Command }, } - cmd.Flags().StringSliceVarP(&opts.DisableStandardEntries, "disable-standard-entries", "d", []string{}, "Disable standard entries for the given languages") - cmd.Flags().StringSliceVarP(&opts.EnableStandardEntries, "enable-standard-entries", "e", []string{}, "Enable standard entries for the given languages") + cmd.Flags().StringSliceVarP(&opts.DisableStandardEntries, "disable-standard-entries", "d", []string{}, "Turn off standard entries for these languages") + cmd.Flags().StringSliceVarP(&opts.EnableStandardEntries, "enable-standard-entries", "e", []string{}, "Turn on standard entries for these languages") cmd.Flags().BoolVarP(&opts.ResetStandardEntries, "reset-standard-entries", "r", false, "Reset standard entries to their default values") SupportedLanguages := make(map[string]string, len(LanguagesWithStopwordsSupport)) diff --git a/pkg/cmd/dictionary/settings/settings.go b/pkg/cmd/dictionary/settings/settings.go index 34240cf7..0d3d7f5b 100644 --- a/pkg/cmd/dictionary/settings/settings.go +++ b/pkg/cmd/dictionary/settings/settings.go @@ -12,7 +12,7 @@ import ( func NewSettingsCmd(f *cmdutil.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "settings", - Short: "Manage your Algolia dictionaries settings", + Short: "Manage your Algolia dictionary settings", } cmd.AddCommand(set.NewSetCmd(f, nil)) diff --git a/pkg/cmd/indices/clear/clear.go b/pkg/cmd/indices/clear/clear.go index 0bf68ef9..c91e08cf 100644 --- a/pkg/cmd/indices/clear/clear.go +++ b/pkg/cmd/indices/clear/clear.go @@ -41,9 +41,9 @@ func NewClearCmd(f *cmdutil.Factory, runF func(*ClearOptions) error) *cobra.Comm Annotations: map[string]string{ "acls": "deleteIndex", }, - Short: "Clear the specified index", + Short: "Remove all records from the specified index but don't delete the index.", Long: heredoc.Doc(` - Clear the objects of an index without affecting its settings. + Remove an indices record without affecting its settings. `), Example: heredoc.Doc(` # Clear the index named "MOVIES" @@ -67,7 +67,7 @@ func NewClearCmd(f *cmdutil.Factory, runF func(*ClearOptions) error) *cobra.Comm }, } - cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "skip confirmation prompt") + cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "Skip the clear index confirmation prompt") return cmd } diff --git a/pkg/cmd/indices/config/export/export.go b/pkg/cmd/indices/config/export/export.go index 2960ba15..3104fa92 100644 --- a/pkg/cmd/indices/config/export/export.go +++ b/pkg/cmd/indices/config/export/export.go @@ -37,13 +37,13 @@ func NewExportCmd(f *cmdutil.Factory) *cobra.Command { Export an index configuration (settings, synonyms, rules) to a file. `), Example: heredoc.Doc(` - # Export the config of the index 'MOVIES' to a .json in the current folder + # Export the config of the index 'MOVIES' to a .json filr in the current folder $ algolia index config export MOVIES - # Export the synonyms and rules of the index 'MOVIES' to a .json in the current folder + # Export the synonyms and rules of the index 'MOVIES' to a .json file in the current folder $ algolia index config export MOVIES --scope synonyms,rules - # Export the config of the index 'MOVIES' to a .json into 'exports' folder + # Export the config of the index 'MOVIES' to a .json file in the 'exports' folder $ algolia index config export MOVIES --directory exports `), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/pkg/cmd/indices/copy/copy.go b/pkg/cmd/indices/copy/copy.go index f10c8f92..a572ecfa 100644 --- a/pkg/cmd/indices/copy/copy.go +++ b/pkg/cmd/indices/copy/copy.go @@ -54,7 +54,7 @@ func NewCopyCmd(f *cmdutil.Factory, runF func(*CopyOptions) error) *cobra.Comman Make a copy of an index, including its records, settings, synonyms, and rules except for the "enableReRanking" setting. `), Example: heredoc.Doc(` - # Copy the records, settings, synonyms and rules from the "SERIES" index to the "MOVIES" index + # Copy the records, settings, synonyms, and rules from the "SERIES" index to the "MOVIES" index $ algolia indices copy SERIES MOVIES # Copy only the synonyms of the "SERIES" to the "MOVIES" index @@ -88,9 +88,9 @@ func NewCopyCmd(f *cmdutil.Factory, runF func(*CopyOptions) error) *cobra.Comman }, } - cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "skip confirmation prompt") - cmd.Flags().StringSliceVarP(&opts.Scope, "scope", "s", []string{}, "scope to copy (default: all)") - cmd.Flags().BoolVarP(&opts.Wait, "wait", "w", false, "wait for the operation to complete") + cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "Skip the copy index confirmation prompt") + cmd.Flags().StringSliceVarP(&opts.Scope, "scope", "s", []string{}, "Which index scopes to copy. Choose from settings, synonyms, and rules (default: all)") + cmd.Flags().BoolVarP(&opts.Wait, "wait", "w", false, "Wait for the operation to complete") _ = cmd.RegisterFlagCompletionFunc("scope", cmdutil.StringSliceCompletionFunc(map[string]string{ diff --git a/pkg/cmd/indices/delete/delete.go b/pkg/cmd/indices/delete/delete.go index 4f5dc26f..b5c5cd90 100644 --- a/pkg/cmd/indices/delete/delete.go +++ b/pkg/cmd/indices/delete/delete.go @@ -44,10 +44,13 @@ func NewDeleteCmd(f *cmdutil.Factory, runF func(*DeleteOptions) error) *cobra.Co Annotations: map[string]string{ "acls": "deleteIndex", }, - Short: "Delete one or multiple indices", + Short: "Deletes the specified index and all its settings.", Long: heredoc.Doc(` - Delete one or multiples indices. - This command permanently removes one or multiple indices from your application, and removes their metadata and configured settings. + Delete an index. + Deleting an index does not delete its analytics data. + If you try to delete a non-existing index, the operation is ignored without warning. + If the index you want to delete has replica indices, the replicas become independent indices. + If the index you want to delete is a replica index, you must first unlink it from its primary index before you can delete it. `), Example: heredoc.Doc(` # Delete the index named "MOVIES" @@ -82,7 +85,7 @@ func NewDeleteCmd(f *cmdutil.Factory, runF func(*DeleteOptions) error) *cobra.Co }, } - cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "skip confirmation prompt") + cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "Skip the delete index confirmation prompt") cmd.Flags(). BoolVarP(&opts.IncludeReplicas, "includeReplicas", "r", false, "delete replica indices too") diff --git a/pkg/cmd/indices/move/move.go b/pkg/cmd/indices/move/move.go index d95c451e..d0b94156 100644 --- a/pkg/cmd/indices/move/move.go +++ b/pkg/cmd/indices/move/move.go @@ -48,7 +48,7 @@ func NewMoveCmd(f *cmdutil.Factory, runF func(*MoveOptions) error) *cobra.Comman }, Short: "Move an index", Long: heredoc.Doc(` - Move the full content (objects, synonyms, rules, settings) of the given source index into the destination one, effectively deleting the source index. + Move the full source index (records, synonyms, rules, settings) to a destination index, effectively deleting the source. `), Example: heredoc.Doc(` # Move the "TEST_MOVIES" index to "DEV_MOVIES" @@ -73,8 +73,8 @@ func NewMoveCmd(f *cmdutil.Factory, runF func(*MoveOptions) error) *cobra.Comman }, } - cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "skip confirmation prompt") - cmd.Flags().BoolVarP(&opts.Wait, "wait", "w", false, "wait for the operation to complete") + cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "Skip the move index confirmation prompt") + cmd.Flags().BoolVarP(&opts.Wait, "wait", "w", false, "Wait for the operation to complete") return cmd } diff --git a/pkg/cmd/objects/browse/browse.go b/pkg/cmd/objects/browse/browse.go index 64affd93..6b2f46c2 100644 --- a/pkg/cmd/objects/browse/browse.go +++ b/pkg/cmd/objects/browse/browse.go @@ -43,21 +43,21 @@ func NewBrowseCmd(f *cmdutil.Factory) *cobra.Command { "runInWebCLI": "true", "acls": "browse", }, - Short: "Browse the index objects", + Short: "Browse records in an index.", Long: heredoc.Doc(` - This command browse the objects of the specified index. + This command browses records in the specified index. `), Example: heredoc.Doc(` - # Browse the objects from the "MOVIES" index + # Browse records in the "MOVIES" index $ algolia objects browse MOVIES - # Browse the objects from the "MOVIES" index and select which attributes to retrieve + # Browse records in the "MOVIES" index and select which attributes to retrieve $ algolia objects browse MOVIES --attributesToRetrieve title,overview - # Browse the objects from the "MOVIES" index with filters + # Browse records in the "MOVIES" index with filters $ algolia objects browse MOVIES --filters "genres:Drama" - # Browse the objects from the "MOVIES" and export the results to a new line delimited JSON (ndjson) file + # Browse records in the "MOVIES" and export the results to a new line delimited JSON (ndjson) file $ algolia objects browse MOVIES > movies.ndjson `), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/pkg/cmd/objects/delete/delete.go b/pkg/cmd/objects/delete/delete.go index 98eb712e..03bb7046 100644 --- a/pkg/cmd/objects/delete/delete.go +++ b/pkg/cmd/objects/delete/delete.go @@ -49,20 +49,20 @@ func NewDeleteCmd(f *cmdutil.Factory, runF func(*DeleteOptions) error) *cobra.Co Annotations: map[string]string{ "acls": "deleteObject", }, - Short: "Delete objects from an index", + Short: "Remove records from an index", Long: heredoc.Doc(` - This command deletes the objects from the specified index. + This command deletes records from the specified index. - You can either directly specify the objects to delete by theirs IDs and/or use the filters related flags to delete the matching objects. + You can specify the records to delete with their objectIDs or use the filter-related flags. `), Example: heredoc.Doc(` - # Delete one single object with the ID "1" from the "MOVIES" index + # Delete a record with the objectID "1" from the "MOVIES" index $ algolia objects delete MOVIES --object-ids 1 - # Delete multiple objects with the IDs "1" and "2" from the "MOVIES" index + # Delete records with the objectIDs "1" and "2" from the "MOVIES" index $ algolia objects delete MOVIES --object-ids 1,2 - # Delete all objects matching the filters "type:Scripted" from the "MOVIES" index + # Delete all records matching the filters "type:Scripted" from the "MOVIES" index $ algolia objects delete MOVIES --filters "type:Scripted" --confirm `), RunE: func(cmd *cobra.Command, args []string) error { @@ -92,11 +92,11 @@ func NewDeleteCmd(f *cmdutil.Factory, runF func(*DeleteOptions) error) *cobra.Co }, } - cmd.Flags().StringSliceVarP(&opts.ObjectIDs, "object-ids", "", nil, "Object IDs to delete") + cmd.Flags().StringSliceVarP(&opts.ObjectIDs, "object-ids", "", nil, "objectIDs to delete") cmdutil.AddDeleteByParamsFlags(cmd) - cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "skip confirmation prompt") - cmd.Flags().BoolVar(&opts.Wait, "wait", false, "wait for all the operations to complete before returning") + cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "Skip the delete record confirmation prompt") + cmd.Flags().BoolVar(&opts.Wait, "wait", false, "Wait for all the operations to complete before returning") return cmd } diff --git a/pkg/cmd/objects/import/import.go b/pkg/cmd/objects/import/import.go index 3fc2f555..0efeb118 100644 --- a/pkg/cmd/objects/import/import.go +++ b/pkg/cmd/objects/import/import.go @@ -45,19 +45,19 @@ func NewImportCmd(f *cmdutil.Factory) *cobra.Command { Annotations: map[string]string{ "acls": "addObject", }, - Short: "Import objects to the specified index", + Short: "Import records into an index", Long: heredoc.Doc(` - Import objects to the specified index from a file / the standard input. - The file must contains one single JSON object per line (newline delimited JSON objects - ndjson format: https://ndjson.org/). + Import records into the specified index from a file or the standard input. + The file must contain one JSON object per line (newline delimited JSON objects - ndjson format: https://ndjson.org/). `), Example: heredoc.Doc(` - # Import objects from the "data.ndjson" file to the "MOVIES" index + # Import records from the "data.ndjson" file into the "MOVIES" index $ algolia objects import MOVIES -F data.ndjson - # Import objects from the standard input to the "MOVIES" index + # Import records from the standard input into the "MOVIES" index $ cat data.ndjson | algolia objects import MOVIES -F - - # Browse the objects in the "SERIES" index and import them to the "MOVIES" index + # Browse records in the "SERIES" index and import them into the "MOVIES" index $ algolia objects browse SERIES | algolia objects import MOVIES -F - `), RunE: func(cmd *cobra.Command, args []string) error { @@ -72,10 +72,10 @@ func NewImportCmd(f *cmdutil.Factory) *cobra.Command { }, } - cmd.Flags().StringVarP(&file, "file", "F", "", "Read records to import from `file` (use \"-\" to read from standard input)") + cmd.Flags().StringVarP(&file, "file", "F", "", "Import records from a `file` (use \"-\" to read from standard input)") _ = cmd.MarkFlagRequired("file") - cmd.Flags().BoolVar(&opts.AutoGenerateObjectIDIfNotExist, "auto-generate-object-id-if-not-exist", false, "Automatically generate object ID if not exist") + cmd.Flags().BoolVar(&opts.AutoGenerateObjectIDIfNotExist, "auto-generate-object-id-if-not-exist", false, "Add objectID fields and values to imported records if they aren't present.") cmd.Flags().IntVarP(&opts.BatchSize, "batch-size", "b", 1000, "Specify the upload batch size") return cmd } diff --git a/pkg/cmd/objects/objects.go b/pkg/cmd/objects/objects.go index 43f6c67b..beb56883 100644 --- a/pkg/cmd/objects/objects.go +++ b/pkg/cmd/objects/objects.go @@ -15,7 +15,7 @@ import ( func NewObjectsCmd(f *cmdutil.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "objects", - Short: "Manage your indices' objects", + Short: "Manage records in your indices", } cmd.AddCommand(browse.NewBrowseCmd(f)) diff --git a/pkg/cmd/objects/update/update.go b/pkg/cmd/objects/update/update.go index cdf0da86..6e499cb3 100644 --- a/pkg/cmd/objects/update/update.go +++ b/pkg/cmd/objects/update/update.go @@ -52,23 +52,23 @@ func NewUpdateCmd(f *cmdutil.Factory, runF func(*UpdateOptions) error) *cobra.Co Annotations: map[string]string{ "acls": "addObject", }, - Short: "Update objects from a file to the specified index", + Short: "Update an index with records from a file", Long: heredoc.Doc(` - Update objects from a file to the specified index. + Update a specified index with records from a file. - The file must contains one single JSON object per line (newline delimited JSON objects - ndjson format: https://ndjson.org/). + The file must contains one JSON object per line (newline delimited JSON objects - ndjson format: https://ndjson.org/). `), Example: heredoc.Doc(` - # Update objects from the "objects.ndjson" file to the "MOVIES" index + # Update the "MOVIES" index with records from the "objects.ndjson" file $ algolia objects update MOVIES -F objects.ndjson - # Update objects from the "objects.ndjson" file to the "MOVIES" index and create the objects if they don't exist + # Update the "MOVIES" index with records from the "objects.ndjson" file and create the records if they don't exist $ algolia objects update MOVIES -F objects.ndjson --create-if-not-exists - # Update objects from the "objects.ndjson" file to the "MOVIES" index and wait for the operation to complete + # Update the "MOVIES" index with records from the "objects.ndjson" file and wait for the operation to complete $ algolia objects update MOVIES -F objects.ndjson --wait - # Update objects from the "objects.ndjson" file to the "MOVIES" index and continue updating objects even if some objects are invalid + # Update the "MOVIES" index with records from the "objects.ndjson" file and continue updating records even if some are invalid $ algolia objects update MOVIES -F objects.ndjson --continue-on-error `), RunE: func(cmd *cobra.Command, args []string) error { @@ -88,13 +88,13 @@ func NewUpdateCmd(f *cmdutil.Factory, runF func(*UpdateOptions) error) *cobra.Co }, } - cmd.Flags().StringVarP(&opts.File, "file", "F", "", "Read objects to update from `file` (use \"-\" to read from standard input)") + cmd.Flags().StringVarP(&opts.File, "file", "F", "", "Records to update from `file` (use \"-\" to use the standard input)") _ = cmd.MarkFlagRequired("file") - cmd.Flags().BoolVarP(&opts.CreateIfNotExists, "create-if-not-exists", "c", false, "If provided, updating a nonexistent object will create a new object with the objectID and the attributes defined in the object") + cmd.Flags().BoolVarP(&opts.CreateIfNotExists, "create-if-not-exists", "c", false, "If provided, updating a nonexistent record will create a new opne with the objectID and the attributes defined in the file") cmd.Flags().BoolVarP(&opts.Wait, "wait", "w", false, "Wait for the operation to complete before returning") - cmd.Flags().BoolVarP(&opts.ContinueOnError, "continue-on-error", "C", false, "Continue updating objects even if some objects are invalid.") + cmd.Flags().BoolVarP(&opts.ContinueOnError, "continue-on-error", "C", false, "Continue updating records even if some are invalid.") return cmd } diff --git a/pkg/cmd/open/open.go b/pkg/cmd/open/open.go index eb9473b1..80b157e7 100644 --- a/pkg/cmd/open/open.go +++ b/pkg/cmd/open/open.go @@ -77,28 +77,28 @@ func NewOpenCmd(f *cmdutil.Factory) *cobra.Command { } return openNames(), cobra.ShellCompDirectiveNoFileComp }, - Short: "Quickly open Algolia pages", - Long: `The open command provices shortcuts to quickly let you open pages to Algolia within your browser. 'algolia open --list' for a list of supported shortcuts.`, + Short: "Access Algolia support resources", + Long: `The open command provides links to Algolia support resources. 'algolia open --list' for a list of support links.`, Example: heredoc.Doc(` - # Display the list of supported shortcuts + # The support links $ algolia open --list - # Open the dashboard for the current application + # The Algolia dashboard for the current application $ algolia open dashboard - # Open the API reference + # The Algolia REST APIs $ algolia open api - # Open the documentation + # The Algolia documentation home page $ algolia open docs - # Open the CLI documentation + # The Algolia CLI documentation $ algolia open cli-docs - # Open the status page + # Algolia's status page $ algolia open status - # Open Algolia supported languages page + # Algolia's supported languages page $ algolia open languages `), RunE: func(cmd *cobra.Command, args []string) error { @@ -109,7 +109,7 @@ func NewOpenCmd(f *cmdutil.Factory) *cobra.Command { }, } - cmd.Flags().BoolP("list", "l", false, "List all supported shortcuts") + cmd.Flags().BoolP("list", "l", false, "List all support links") auth.DisableAuthCheck(cmd) diff --git a/pkg/cmd/profile/application.go b/pkg/cmd/profile/application.go index 6106692e..f3f44c85 100644 --- a/pkg/cmd/profile/application.go +++ b/pkg/cmd/profile/application.go @@ -16,7 +16,7 @@ func NewProfileCmd(f *cmdutil.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "profile", Aliases: []string{"profiles"}, - Short: "Manage your profiles", + Short: "Manage your Algolia CLI profiles", } auth.DisableAuthCheck(cmd) diff --git a/pkg/cmd/profile/remove/remove.go b/pkg/cmd/profile/remove/remove.go index 1e0e069d..7d0ef278 100644 --- a/pkg/cmd/profile/remove/remove.go +++ b/pkg/cmd/profile/remove/remove.go @@ -71,7 +71,7 @@ func NewRemoveCmd(f *cmdutil.Factory, runF func(*RemoveOptions) error) *cobra.Co }, } - cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "skip confirmation prompt") + cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "Skip the remove profile confirmation prompt") return cmd } diff --git a/pkg/cmd/rules/browse/browse.go b/pkg/cmd/rules/browse/browse.go index b6b13a00..65a497c0 100644 --- a/pkg/cmd/rules/browse/browse.go +++ b/pkg/cmd/rules/browse/browse.go @@ -38,7 +38,7 @@ func NewBrowseCmd(f *cmdutil.Factory) *cobra.Command { Use: "browse ", Args: validators.ExactArgs(1), ValidArgsFunction: cmdutil.IndexNames(opts.SearchClient), - Short: "List all the rules of an index", + Short: "List an indices' rules.", Annotations: map[string]string{ "runInWebCLI": "true", "acls": "settings", diff --git a/pkg/cmd/rules/delete/delete.go b/pkg/cmd/rules/delete/delete.go index 42fb9193..02f67459 100644 --- a/pkg/cmd/rules/delete/delete.go +++ b/pkg/cmd/rules/delete/delete.go @@ -47,7 +47,7 @@ func NewDeleteCmd(f *cmdutil.Factory, runF func(*DeleteOptions) error) *cobra.Co Annotations: map[string]string{ "acls": "editSettings", }, - Short: "Delete rules from an index", + Short: "Delete an indices' rules.", Long: heredoc.Doc(` This command deletes the rules from the specified index. `), @@ -77,9 +77,9 @@ func NewDeleteCmd(f *cmdutil.Factory, runF func(*DeleteOptions) error) *cobra.Co cmd.Flags().StringSliceVarP(&opts.RuleIDs, "rule-ids", "", nil, "Rule IDs to delete") _ = cmd.MarkFlagRequired("rule-ids") - cmd.Flags().BoolVar(&opts.ForwardToReplicas, "forward-to-replicas", false, "Forward the delete request to the replicas") + cmd.Flags().BoolVar(&opts.ForwardToReplicas, "forward-to-replicas", false, "Whether changes are applied to replica indices.") - cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "skip confirmation prompt") + cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "Skip the delete rule confirmation prompt") return cmd } diff --git a/pkg/cmd/rules/import/import.go b/pkg/cmd/rules/import/import.go index ce312c0a..eff2ea3b 100644 --- a/pkg/cmd/rules/import/import.go +++ b/pkg/cmd/rules/import/import.go @@ -49,10 +49,10 @@ func NewImportCmd(f *cmdutil.Factory, runF func(*ImportOptions) error) *cobra.Co Annotations: map[string]string{ "acls": "editSettings", }, - Short: "Import rules to the specified index", + Short: "Import Rules into an index.", Long: heredoc.Doc(` - Import rules to the specified index. - The file must contains one JSON rule per line (newline delimited JSON objects - ndjson format: https://ndjson.org/). + Import Rules into an index. + File imports must contain one JSON rule per line (newline delimited JSON objects - ndjson format: https://ndjson.org/). `), Example: heredoc.Doc(` # Import rules from the "rules.ndjson" file to the "MOVIES" index @@ -91,13 +91,13 @@ func NewImportCmd(f *cmdutil.Factory, runF func(*ImportOptions) error) *cobra.Co }, } - cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "skip confirmation prompt") + cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "Skip the rule import confirmation prompt.") - cmd.Flags().StringVarP(&file, "file", "F", "", "Read rules to import from `file` (use \"-\" to read from standard input)") + cmd.Flags().StringVarP(&file, "file", "F", "", "Import rules from a `file` (use \"-\" to read from standard input).") _ = cmd.MarkFlagRequired("file") - cmd.Flags().BoolVarP(&opts.ForwardToReplicas, "forward-to-replicas", "f", true, "Forward the rules to the index replicas") - cmd.Flags().BoolVarP(&opts.ClearExistingRules, "clear-existing-rules", "c", false, "Clear existing rules before importing new ones") + cmd.Flags().BoolVarP(&opts.ForwardToReplicas, "forward-to-replicas", "f", true, "Whether changes are applied to replica indices.") + cmd.Flags().BoolVarP(&opts.ClearExistingRules, "clear-existing-rules", "c", false, "Delete existing index rules before importing new ones.") return cmd } diff --git a/pkg/cmd/search/search.go b/pkg/cmd/search/search.go index 4132cfca..05d47064 100644 --- a/pkg/cmd/search/search.go +++ b/pkg/cmd/search/search.go @@ -37,28 +37,28 @@ func NewSearchCmd(f *cmdutil.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "search ", - Short: "Search the given index", + Short: "Search an index", Args: validators.ExactArgs(1), ValidArgsFunction: cmdutil.IndexNames(opts.SearchClient), - Long: `Search for objects in your index.`, + Long: `Search for records in your index.`, Annotations: map[string]string{ "runInWebCLI": "true", "acls": "search", }, Example: heredoc.Doc(` - # Search for objects in the "MOVIES" index matching the query "toy story" + # Search for records in the "MOVIES" index matching the query "toy story" $ algolia search MOVIES --query "toy story" - # Search for objects in the "MOVIES" index matching the query "toy story" with filters + # Search for records in the "MOVIES" index matching the query "toy story" with filters $ algolia search MOVIES --query "toy story" --filters "'(genres:Animation OR genres:Family) AND original_language:en'" - # Search for objects in the "MOVIES" index matching the query "toy story" while setting the number of hits per page and specifying the page to retrieve + # Search for records in the "MOVIES" index matching the query "toy story" while setting the number of hits per page and specifying the page to retrieve $ algolia search MOVIES --query "toy story" --hitsPerPage 2 --page 4 - # Search for objects in the "MOVIES" index matching the query "toy story" and export the response to a .json file + # Search for records in the "MOVIES" index matching the query "toy story" and export the response to a .json file $ algolia search MOVIES --query "toy story" > movies.json - # Search for objects in the "MOVIES" index matching the query "toy story" and only export the results to a .json file + # Search for records in the "MOVIES" index matching the query "toy story" and only export the results to a .json file $ algolia search MOVIES --query "toy story" --output="jsonpath={$.Hits}" > movies.json `), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/pkg/cmd/settings/import/import.go b/pkg/cmd/settings/import/import.go index 585c2597..366dab20 100644 --- a/pkg/cmd/settings/import/import.go +++ b/pkg/cmd/settings/import/import.go @@ -41,7 +41,7 @@ func NewImportCmd(f *cmdutil.Factory) *cobra.Command { Annotations: map[string]string{ "acls": "editSettings", }, - Short: "Import the index settings from the given file", + Short: "Import index settings from a file.", Example: heredoc.Doc(` # Import the settings from "settings.json" to the "MOVIES" index $ algolia settings import MOVIES -F settings.json @@ -60,7 +60,7 @@ func NewImportCmd(f *cmdutil.Factory) *cobra.Command { }, } - cmd.Flags().StringVarP(&settingsFile, "file", "F", "", "Read settings from `file` (use \"-\" to read from standard input)") + cmd.Flags().StringVarP(&settingsFile, "file", "F", "", "Import index settings from a `file` (use \"-\" to read from standard input).") _ = cmd.MarkFlagRequired("file") return cmd diff --git a/pkg/cmd/settings/set/set.go b/pkg/cmd/settings/set/set.go index 47e96724..b4c5a26b 100644 --- a/pkg/cmd/settings/set/set.go +++ b/pkg/cmd/settings/set/set.go @@ -40,7 +40,7 @@ func NewSetCmd(f *cmdutil.Factory) *cobra.Command { Annotations: map[string]string{ "acls": "editSettings", }, - Short: "Set the settings of the specified index.", + Short: "Specify index settings.", Example: heredoc.Doc(` # Set the typo tolerance to false on the MOVIES index $ algolia settings set MOVIES --typoTolerance="false" @@ -68,7 +68,7 @@ func NewSetCmd(f *cmdutil.Factory) *cobra.Command { }, } - cmd.Flags().BoolVarP(&opts.ForwardToReplicas, "forward-to-replicas", "f", false, "Forward the settings to the replicas") + cmd.Flags().BoolVarP(&opts.ForwardToReplicas, "forward-to-replicas", "f", false, "Whether changes are applied to replica indices.") cmdutil.AddIndexSettingsFlags(cmd) diff --git a/pkg/cmd/settings/settings.go b/pkg/cmd/settings/settings.go index f364e47a..b147d03a 100644 --- a/pkg/cmd/settings/settings.go +++ b/pkg/cmd/settings/settings.go @@ -13,7 +13,7 @@ import ( func NewSettingsCmd(f *cmdutil.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "settings", - Short: "Manage your Algolia settings", + Short: "Manage your Algolia index settings.", } cmd.AddCommand(get.NewGetCmd(f)) diff --git a/pkg/cmd/synonyms/browse/browse.go b/pkg/cmd/synonyms/browse/browse.go index 5cbe217f..c5569a76 100644 --- a/pkg/cmd/synonyms/browse/browse.go +++ b/pkg/cmd/synonyms/browse/browse.go @@ -37,16 +37,16 @@ func NewBrowseCmd(f *cmdutil.Factory) *cobra.Command { Use: "browse ", Args: validators.ExactArgs(1), ValidArgsFunction: cmdutil.IndexNames(opts.SearchClient), - Short: "List all the the synonyms of the given index", + Short: "List all the synonyms in this index", Annotations: map[string]string{ "runInWebCLI": "true", "acls": "settings", }, Example: heredoc.Doc(` - # List all the synonyms of the 'MOVIES' index + # List all the synonyms in the 'MOVIES' index $ algolia synonyms browse MOVIES - # List all the synonyms of the 'MOVIES' and save them to the 'synonyms.json' file + # List all the synonyms in the 'MOVIES' index and save them in the 'synonyms.json' file $ algolia synonyms browse MOVIES > synonyms.json `), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/pkg/cmd/synonyms/delete/delete.go b/pkg/cmd/synonyms/delete/delete.go index 7dcb1c82..baefdd5d 100644 --- a/pkg/cmd/synonyms/delete/delete.go +++ b/pkg/cmd/synonyms/delete/delete.go @@ -75,11 +75,11 @@ func NewDeleteCmd(f *cmdutil.Factory, runF func(*DeleteOptions) error) *cobra.Co }, } - cmd.Flags().StringSliceVarP(&opts.SynonymIDs, "synonym-ids", "", nil, "Synonym IDs to delete") + cmd.Flags().StringSliceVarP(&opts.SynonymIDs, "synonym-ids", "", nil, "Synonym IDs to delete.") _ = cmd.MarkFlagRequired("synonym-ids") - cmd.Flags().BoolVar(&opts.ForwardToReplicas, "forward-to-replicas", false, "Forward the delete request to the replicas") + cmd.Flags().BoolVar(&opts.ForwardToReplicas, "forward-to-replicas", false, "Whether changes are applied to replica indices.") - cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "skip confirmation prompt") + cmd.Flags().BoolVarP(&confirm, "confirm", "y", false, "Skip the delete synonym confirmation prompt.") return cmd } diff --git a/pkg/cmd/synonyms/import/import.go b/pkg/cmd/synonyms/import/import.go index 394d8a85..62cbc7a9 100644 --- a/pkg/cmd/synonyms/import/import.go +++ b/pkg/cmd/synonyms/import/import.go @@ -83,11 +83,11 @@ func NewImportCmd(f *cmdutil.Factory, runF func(*ImportOptions) error) *cobra.Co }, } - cmd.Flags().StringVarP(&file, "file", "F", "", "Read synonyms to import from `file` (use \"-\" to read from standard input)") + cmd.Flags().StringVarP(&file, "file", "F", "", "Import synonyms from a `file` (use \"-\" to read from standard input).") _ = cmd.MarkFlagRequired("file") - cmd.Flags().BoolVarP(&opts.ForwardToReplicas, "forward-to-replicas", "f", true, "Forward the synonyms to the replicas of the index") - cmd.Flags().BoolVarP(&opts.ReplaceExistingSynonyms, "replace-existing-synonyms", "r", false, "Replace existing synonyms in the index") + cmd.Flags().BoolVarP(&opts.ForwardToReplicas, "forward-to-replicas", "f", true, "Whether changes are applied to replica indices.") + cmd.Flags().BoolVarP(&opts.ReplaceExistingSynonyms, "replace-existing-synonyms", "r", false, "Replace existing synonyms in the index.") return cmd } diff --git a/pkg/cmd/synonyms/save/save.go b/pkg/cmd/synonyms/save/save.go index 9407b8c8..7780a23f 100644 --- a/pkg/cmd/synonyms/save/save.go +++ b/pkg/cmd/synonyms/save/save.go @@ -45,11 +45,11 @@ func NewSaveCmd(f *cmdutil.Factory, runF func(*SaveOptions) error) *cobra.Comman Annotations: map[string]string{ "acls": "editSettings", }, - Short: "Save a synonym to the given index", + Short: "Add a synonym to an index", Aliases: []string{"create", "edit"}, Long: heredoc.Doc(` - This command save a synonym to the specified index. - If the synonym doesn't exist yet, a new one is created. + This command adds a synonym to the specified index. + If the synonym doesn't exist, a new one is created. `), Example: heredoc.Doc(` # Save one standard synonym with ID "1" and "foo" and "bar" synonyms to the "MOVIES" index @@ -91,26 +91,26 @@ func NewSaveCmd(f *cmdutil.Factory, runF func(*SaveOptions) error) *cobra.Comman // Common cmd.Flags().StringVarP(&flags.SynonymID, "id", "i", "", "Synonym ID to save") - cmd.Flags().StringVarP(&flags.SynonymType, "type", "t", "", "Synonym type to save (default to regular)") + cmd.Flags().StringVarP(&flags.SynonymType, "type", "t", "", "Synonym type. One of altCorrection1, altCorrection2, oneWaySynonym, placeholder, synonym.") _ = cmd.RegisterFlagCompletionFunc("type", cmdutil.StringCompletionFunc(map[string]string{ shared.Regular: "(default) Used when you want a word or phrase to find its synonyms or the other way around.", shared.OneWay: "Used when you want a word or phrase to find its synonyms, but not the reverse.", - shared.AltCorrection1: "Used when you want records with an exact query match to rank higher than a synonym match. (will return matches with one typo)", - shared.AltCorrection2: "Used when you want records with an exact query match to rank higher than a synonym match. (will return matches with two typos)", - shared.Placeholder: "Used to place not-yet-defined “tokens” (that can take any value from a list of defined words).", + shared.AltCorrection1: "Used when you want records with an exact query match to rank higher than a synonym match. Will return matches with one typo.", + shared.AltCorrection2: "Used when you want records with an exact query match to rank higher than a synonym match. Will return matches with two typos.", + shared.Placeholder: "Used to place not-yet-defined tokens (that can take any value from a list of defined words).", })) - cmd.Flags().BoolVarP(&opts.ForwardToReplicas, "forward-to-replicas", "f", false, "Forward the save request to the replicas") + cmd.Flags().BoolVarP(&opts.ForwardToReplicas, "forward-to-replicas", "f", false, "Whether changes are applied to replica indices.") // Regular synonym - cmd.Flags().StringSliceVarP(&flags.Synonyms, "synonyms", "s", nil, "Synonyms to save") - // One way synonym - cmd.Flags().StringVarP(&flags.SynonymInput, "input", "n", "", "Word of phrases to appear in query strings (one way synonyms only)") + cmd.Flags().StringSliceVarP(&flags.Synonyms, "synonyms", "s", nil, "Words or phrases considered equivalent.") + // One-way synonym + cmd.Flags().StringVarP(&flags.SynonymInput, "input", "n", "", "Word or phrases to appear in query strings (one-way synonyms only).") // Placeholder synonym - cmd.Flags().StringVarP(&flags.SynonymPlaceholder, "placeholder", "l", "", "A single word, used as the basis for the below array of replacements (placeholder synonyms only)") - cmd.Flags().StringSliceVarP(&flags.SynonymReplacements, "replacements", "r", nil, "An list of replacements of the placeholder (placeholder synonyms only)") - // Alt correction synonym - cmd.Flags().StringVarP(&flags.SynonymWord, "word", "w", "", "A single word, used as the basis for the array of corrections (alt correction synonyms only)") - cmd.Flags().StringSliceVarP(&flags.SynonymCorrections, "corrections", "c", nil, "A list of corrections of the word (alt correction synonyms only)") + cmd.Flags().StringVarP(&flags.SynonymPlaceholder, "placeholder", "l", "", "Placeholder token to represent a synonym within records.") + cmd.Flags().StringSliceVarP(&flags.SynonymReplacements, "replacements", "r", nil, "Query words that will match the placeholder synonym token.") + // Alternative correction synonym + cmd.Flags().StringVarP(&flags.SynonymWord, "word", "w", "", "Word or phrase to appear in query strings (for altcorrection1 and altcorrection2).") + cmd.Flags().StringSliceVarP(&flags.SynonymCorrections, "corrections", "c", nil, "Words to be matched in records (alternative correction synonyms only).") return cmd } diff --git a/pkg/cmdutil/jsonpath_flags.go b/pkg/cmdutil/jsonpath_flags.go index cb2ad440..063e5aeb 100644 --- a/pkg/cmdutil/jsonpath_flags.go +++ b/pkg/cmdutil/jsonpath_flags.go @@ -11,8 +11,8 @@ import ( "github.com/algolia/cli/pkg/printers" ) -// templates are logically optional for specifying a format. -// this allows a user to specify a template format value +// Templates are logically optional for specifying a format. +// this lets a user specify a template format value // as --output=jsonpath= var jsonFormats = map[string]bool{ "jsonpath": true, @@ -24,13 +24,13 @@ var jsonFormats = map[string]bool{ // Given the following flag values, a printer can be requested that knows // how to handle printing based on these values. type JSONPathPrintFlags struct { - // indicates if it is OK to ignore missing keys for rendering + // Indicates if it's OK to ignore missing keys for rendering // an output template. AllowMissingKeys *bool TemplateArgument *string } -// AllowedFormats returns slice of string of allowed JSONPath printing format +// AllowedFormats returns slice of string of allowed JSONPath printing formats func (f *JSONPathPrintFlags) AllowedFormats() []string { formats := make([]string, 0, len(jsonFormats)) for format := range jsonFormats { @@ -103,12 +103,12 @@ func (f *JSONPathPrintFlags) ToPrinter(templateFormat string) (printers.Printer, // flags related to template printing to it func (f *JSONPathPrintFlags) AddFlags(c *cobra.Command) { if f.TemplateArgument != nil { - c.Flags().StringVar(f.TemplateArgument, "template", *f.TemplateArgument, "Template string or path to template file to use when --output=jsonpath, --output=jsonpath-file.") + c.Flags().StringVar(f.TemplateArgument, "template", *f.TemplateArgument, "Template string or path to the template file to use when --output=jsonpath, --output=jsonpath-file.") _ = c.Flags().SetAnnotation("template", "IsPrint", []string{"true"}) _ = c.MarkFlagFilename("template") } if f.AllowMissingKeys != nil { - c.Flags().BoolVar(f.AllowMissingKeys, "allow-missing-template-keys", *f.AllowMissingKeys, "If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.") + c.Flags().BoolVar(f.AllowMissingKeys, "allow-missing-template-keys", *f.AllowMissingKeys, "If true, ignore template errors caused by missing fields or map keys. This only applies to golang and jsonpath output formats.") _ = c.Flags().SetAnnotation("allow-missing-template-keys", "IsPrint", []string{"true"}) } } diff --git a/pkg/cmdutil/print_flags.go b/pkg/cmdutil/print_flags.go index 0dd2e233..b0cfb79e 100644 --- a/pkg/cmdutil/print_flags.go +++ b/pkg/cmdutil/print_flags.go @@ -80,7 +80,7 @@ func (f *PrintFlags) AddFlags(cmd *cobra.Command) { f.JSONPathPrintFlags.AddFlags(cmd) if f.OutputFormat != nil { - cmd.Flags().StringVarP(f.OutputFormat, "output", "o", *f.OutputFormat, fmt.Sprintf(`Output format. One of: (%s).`, strings.Join(f.AllowedFormats(), ", "))) + cmd.Flags().StringVarP(f.OutputFormat, "output", "o", *f.OutputFormat, fmt.Sprintf(`Output format. One of: %s.`, strings.Join(f.AllowedFormats(), ", "))) _ = cmd.Flags().SetAnnotation("output", "IsPrint", []string{"true"}) if f.OutputFlagSpecified == nil { f.OutputFlagSpecified = func() bool { diff --git a/pkg/cmdutil/spec_flags.go b/pkg/cmdutil/spec_flags.go index aa3c0d1b..5ffe03ed 100644 --- a/pkg/cmdutil/spec_flags.go +++ b/pkg/cmdutil/spec_flags.go @@ -251,30 +251,30 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntaxFeat cmd.Flags().Bool("allowTyposOnNumericTokens", true, heredoc.Doc(`Whether to allow typos on numbers in the search query. See: https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/`)) cmd.Flags().SetAnnotation("allowTyposOnNumericTokens", "Categories", []string{"Typos"}) - cmd.Flags().StringSlice("alternativesAsExact", []string{"ignorePlurals", "singleWordSynonym"}, heredoc.Doc(`Alternatives of query words that should be considered as exact matches by the Exact ranking criterion. + cmd.Flags().StringSlice("alternativesAsExact", []string{"ignorePlurals", "singleWordSynonym"}, heredoc.Doc(`Determine which plurals and synonyms should be considered as exact matches. See: https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/`)) cmd.Flags().SetAnnotation("alternativesAsExact", "Categories", []string{"Query strategy"}) - cmd.Flags().Bool("analytics", true, heredoc.Doc(`Whether this search will be included in Analytics. + cmd.Flags().Bool("analytics", true, heredoc.Doc(`Whether to include this query in Algolia's search analytics. See: https://www.algolia.com/doc/api-reference/api-parameters/analytics/`)) cmd.Flags().SetAnnotation("analytics", "Categories", []string{"Analytics"}) - cmd.Flags().StringSlice("analyticsTags", []string{}, heredoc.Doc(`Tags to apply to the query for segmenting analytics data. + cmd.Flags().StringSlice("analyticsTags", []string{}, heredoc.Doc(`Search analytics tags for query data segmentation. See: https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/`)) cmd.Flags().SetAnnotation("analyticsTags", "Categories", []string{"Analytics"}) - cmd.Flags().String("aroundLatLng", "", heredoc.Doc(`Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. + cmd.Flags().String("aroundLatLng", "", heredoc.Doc(`Coordinates for the center of a circle: expressed as a comma-separated string of latitude and longitude values. See: https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLng/`)) cmd.Flags().SetAnnotation("aroundLatLng", "Categories", []string{"Geo-Search"}) - cmd.Flags().Bool("aroundLatLngViaIP", false, heredoc.Doc(`Whether to obtain the coordinates from the request's IP address. + cmd.Flags().Bool("aroundLatLngViaIP", false, heredoc.Doc(`Whether to use the location computed from the user's IP address. See: https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLngViaIP/`)) cmd.Flags().SetAnnotation("aroundLatLngViaIP", "Categories", []string{"Geo-Search"}) aroundPrecision := NewJSONVar([]string{"integer", "array"}...) - cmd.Flags().Var(aroundPrecision, "aroundPrecision", heredoc.Doc(`Precision of a coordinate-based search in meters to group results with similar distances. + cmd.Flags().Var(aroundPrecision, "aroundPrecision", heredoc.Doc(`Groups similar distances into range bands. See: https://www.algolia.com/doc/api-reference/api-parameters/aroundPrecision/`)) cmd.Flags().SetAnnotation("aroundPrecision", "Categories", []string{"Geo-Search"}) aroundRadius := NewJSONVar([]string{"integer", "string"}...) cmd.Flags().Var(aroundRadius, "aroundRadius", heredoc.Doc(`Maximum radius for a search around a central location. See: https://www.algolia.com/doc/api-reference/api-parameters/aroundRadius/`)) cmd.Flags().SetAnnotation("aroundRadius", "Categories", []string{"Geo-Search"}) - cmd.Flags().Bool("attributeCriteriaComputedByMinProximity", false, heredoc.Doc(`Whether the best matching attribute should be determined by minimum proximity. + cmd.Flags().Bool("attributeCriteriaComputedByMinProximity", false, heredoc.Doc(`Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. See: https://www.algolia.com/doc/api-reference/api-parameters/attributeCriteriaComputedByMinProximity/`)) cmd.Flags().SetAnnotation("attributeCriteriaComputedByMinProximity", "Categories", []string{"Advanced"}) cmd.Flags().StringSlice("attributesToHighlight", []string{}, heredoc.Doc(`Attributes to highlight. @@ -289,7 +289,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippe cmd.Flags().Bool("clickAnalytics", false, heredoc.Doc(`Whether to include a queryID attribute in the response. See: https://www.algolia.com/doc/api-reference/api-parameters/clickAnalytics/`)) cmd.Flags().SetAnnotation("clickAnalytics", "Categories", []string{"Analytics"}) - cmd.Flags().String("cursor", "", heredoc.Doc(`Cursor to get the next page of the response.`)) + cmd.Flags().String("cursor", "", heredoc.Doc(`Cursor to get to the next page of the response.`)) cmd.Flags().StringSlice("customRanking", []string{}, heredoc.Doc(`Attributes to use as custom ranking. See: https://www.algolia.com/doc/api-reference/api-parameters/customRanking/`)) cmd.Flags().SetAnnotation("customRanking", "Categories", []string{"Ranking"}) @@ -306,7 +306,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleran cmd.Flags().Var(distinct, "distinct", heredoc.Doc(`Determines how many records of a group are included in the search results. See: https://www.algolia.com/doc/api-reference/api-parameters/distinct/`)) cmd.Flags().SetAnnotation("distinct", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("enableABTest", true, heredoc.Doc(`Whether to enable A/B testing for this search. + cmd.Flags().Bool("enableABTest", true, heredoc.Doc(`Whether to include this search in currently running A/B tests. See: https://www.algolia.com/doc/api-reference/api-parameters/enableABTest/`)) cmd.Flags().SetAnnotation("enableABTest", "Categories", []string{"Advanced"}) cmd.Flags().Bool("enablePersonalization", false, heredoc.Doc(`Whether to enable Personalization. @@ -325,13 +325,13 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQ cmd.Flags().Var(facetFilters, "facetFilters", heredoc.Doc(`Filter the search by facet values, so that only records with the same facet values are retrieved. See: https://www.algolia.com/doc/api-reference/api-parameters/facetFilters/`)) cmd.Flags().SetAnnotation("facetFilters", "Categories", []string{"Filtering"}) - cmd.Flags().Bool("facetingAfterDistinct", false, heredoc.Doc(`Whether faceting should be applied after deduplication with distinct. + cmd.Flags().Bool("facetingAfterDistinct", false, heredoc.Doc(`Whether to apply faceting after deduplication with distinct. See: https://www.algolia.com/doc/api-reference/api-parameters/facetingAfterDistinct/`)) cmd.Flags().SetAnnotation("facetingAfterDistinct", "Categories", []string{"Faceting"}) - cmd.Flags().StringSlice("facets", []string{}, heredoc.Doc(`Facets for which to retrieve facet values that match the search criteria and the number of matching facet values. + cmd.Flags().StringSlice("facets", []string{}, heredoc.Doc(`Retrieve the specified facets and their facet values. See: https://www.algolia.com/doc/api-reference/api-parameters/facets/`)) cmd.Flags().SetAnnotation("facets", "Categories", []string{"Faceting"}) - cmd.Flags().String("filters", "", heredoc.Doc(`Filter expression to only include items that match the filter criteria in the response. + cmd.Flags().String("filters", "", heredoc.Doc(`Only include items that match the filter. See: https://www.algolia.com/doc/api-reference/api-parameters/filters/`)) cmd.Flags().SetAnnotation("filters", "Categories", []string{"Filtering"}) cmd.Flags().Bool("getRankingInfo", false, heredoc.Doc(`Whether the search response should include detailed ranking information. @@ -355,7 +355,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/`)) cmd.Flags().String("keepDiacriticsOnCharacters", "", heredoc.Doc(`Characters for which diacritics should be preserved. See: https://www.algolia.com/doc/api-reference/api-parameters/keepDiacriticsOnCharacters/`)) cmd.Flags().SetAnnotation("keepDiacriticsOnCharacters", "Categories", []string{"Languages"}) - cmd.Flags().Int("length", 0, heredoc.Doc(`Number of hits to retrieve (used in combination with offset). + cmd.Flags().Int("length", 0, heredoc.Doc(`If you've specified an offset, this determines the number of hits to retrieve. See: https://www.algolia.com/doc/api-reference/api-parameters/length/`)) cmd.Flags().SetAnnotation("length", "Categories", []string{"Pagination"}) cmd.Flags().Int("maxFacetHits", 10, heredoc.Doc(`Maximum number of facet values to return when searching for facet values. @@ -373,42 +373,42 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typ cmd.Flags().Int("minWordSizefor2Typos", 8, heredoc.Doc(`Minimum number of characters a word in the search query must contain to accept matches with two typos. See: https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor2Typos/`)) cmd.Flags().SetAnnotation("minWordSizefor2Typos", "Categories", []string{"Typos"}) - cmd.Flags().Int("minimumAroundRadius", 0, heredoc.Doc(`Minimum radius (in meters) for a search around a location when aroundRadius isn't set. + cmd.Flags().Int("minimumAroundRadius", 0, heredoc.Doc(`If aroundRadius isn't set, defines a [minimum radius] for aroundLatLng and aroundLatLngViaIP (in meters). See: https://www.algolia.com/doc/api-reference/api-parameters/minimumAroundRadius/`)) cmd.Flags().SetAnnotation("minimumAroundRadius", "Categories", []string{"Geo-Search"}) cmd.Flags().String("mode", "keywordSearch", heredoc.Doc(`Search mode the index will use to query for results. One of: neuralSearch, keywordSearch. See: https://www.algolia.com/doc/api-reference/api-parameters/mode/`)) cmd.Flags().SetAnnotation("mode", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("naturalLanguages", []string{}, heredoc.Doc(`ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches). + cmd.Flags().StringSlice("naturalLanguages", []string{}, heredoc.Doc(`Change the default settings for several natural language parameters in a single operation: ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags, and ruleContexts. See: https://www.algolia.com/doc/api-reference/api-parameters/naturalLanguages/`)) cmd.Flags().SetAnnotation("naturalLanguages", "Categories", []string{"Languages"}) numericFilters := NewJSONVar([]string{"array", "string"}...) cmd.Flags().Var(numericFilters, "numericFilters", heredoc.Doc(`Filter by numeric facets. See: https://www.algolia.com/doc/api-reference/api-parameters/numericFilters/`)) cmd.Flags().SetAnnotation("numericFilters", "Categories", []string{"Filtering"}) - cmd.Flags().Int("offset", 0, heredoc.Doc(`Position of the first hit to retrieve. + cmd.Flags().Int("offset", 0, heredoc.Doc(`Out of the results list, indicate which one you want to show first. See: https://www.algolia.com/doc/api-reference/api-parameters/offset/`)) cmd.Flags().SetAnnotation("offset", "Categories", []string{"Pagination"}) optionalFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(optionalFilters, "optionalFilters", heredoc.Doc(`Filters to promote or demote records in the search results. + cmd.Flags().Var(optionalFilters, "optionalFilters", heredoc.Doc(`Create filters for ranking purposes. Records that match the filter will rank higher (or lower for a negative filter). See: https://www.algolia.com/doc/api-reference/api-parameters/optionalFilters/`)) cmd.Flags().SetAnnotation("optionalFilters", "Categories", []string{"Filtering"}) - cmd.Flags().StringSlice("optionalWords", []string{}, heredoc.Doc(`Words that should be considered optional when found in the query. + cmd.Flags().StringSlice("optionalWords", []string{}, heredoc.Doc(`If a search doesn't return enough results, you can increase the number of hits by setting these words as optional. See: https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/`)) cmd.Flags().SetAnnotation("optionalWords", "Categories", []string{"Query strategy"}) - cmd.Flags().Int("page", 0, heredoc.Doc(`Page of search results to retrieve. + cmd.Flags().Int("page", 0, heredoc.Doc(`Requested page of search results. Algolia uses page and hitsPerPage to control how search results are displayed (paginated). See: https://www.algolia.com/doc/api-reference/api-parameters/page/`)) cmd.Flags().SetAnnotation("page", "Categories", []string{"Pagination"}) - cmd.Flags().Bool("percentileComputation", true, heredoc.Doc(`Whether to include this search when calculating processing-time percentiles. + cmd.Flags().Bool("percentileComputation", true, heredoc.Doc(`Whether to include this query in the processing-time percentile computation. See: https://www.algolia.com/doc/api-reference/api-parameters/percentileComputation/`)) cmd.Flags().SetAnnotation("percentileComputation", "Categories", []string{"Advanced"}) - cmd.Flags().Int("personalizationImpact", 100, heredoc.Doc(`Impact that Personalization should have on this search. + cmd.Flags().Int("personalizationImpact", 100, heredoc.Doc(`Determines the impact of the Personalization feature on results: from 0 (none) to 100 (maximum). See: https://www.algolia.com/doc/api-reference/api-parameters/personalizationImpact/`)) cmd.Flags().SetAnnotation("personalizationImpact", "Categories", []string{"Personalization"}) - cmd.Flags().String("query", "", heredoc.Doc(`Search query. + cmd.Flags().String("query", "", heredoc.Doc(`The text to search for in the index. See: https://www.algolia.com/doc/api-reference/api-parameters/query/`)) cmd.Flags().SetAnnotation("query", "Categories", []string{"Search"}) - cmd.Flags().StringSlice("queryLanguages", []string{}, heredoc.Doc(`Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. + cmd.Flags().StringSlice("queryLanguages", []string{}, heredoc.Doc(`Define languages for which to apply language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. See: https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/`)) cmd.Flags().SetAnnotation("queryLanguages", "Categories", []string{"Languages"}) cmd.Flags().String("queryType", "prefixLast", heredoc.Doc(`Determines if and how query words are interpreted as prefixes. One of: prefixLast, prefixAll, prefixNone. @@ -436,13 +436,13 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/renderingContent/` cmd.Flags().Bool("replaceSynonymsInHighlight", false, heredoc.Doc(`Whether to replace a highlighted word with the matched synonym. See: https://www.algolia.com/doc/api-reference/api-parameters/replaceSynonymsInHighlight/`)) cmd.Flags().SetAnnotation("replaceSynonymsInHighlight", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("responseFields", []string{"*"}, heredoc.Doc(`Properties to include in the API response of search and browse requests. + cmd.Flags().StringSlice("responseFields", []string{"*"}, heredoc.Doc(`Properties to include in search and browse API responses. See: https://www.algolia.com/doc/api-reference/api-parameters/responseFields/`)) cmd.Flags().SetAnnotation("responseFields", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("restrictHighlightAndSnippetArrays", false, heredoc.Doc(`Whether to restrict highlighting and snippeting to items that at least partially matched the search query. + cmd.Flags().Bool("restrictHighlightAndSnippetArrays", false, heredoc.Doc(`Whether to restrict highlighting and snippeting to items that partially or fully matched the search query. See: https://www.algolia.com/doc/api-reference/api-parameters/restrictHighlightAndSnippetArrays/`)) cmd.Flags().SetAnnotation("restrictHighlightAndSnippetArrays", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("restrictSearchableAttributes", []string{}, heredoc.Doc(`Restricts a search to a subset of your searchable attributes. + cmd.Flags().StringSlice("restrictSearchableAttributes", []string{}, heredoc.Doc(`Restrict the query to look at only the specified searchable attributes. See: https://www.algolia.com/doc/api-reference/api-parameters/restrictSearchableAttributes/`)) cmd.Flags().SetAnnotation("restrictSearchableAttributes", "Categories", []string{"Filtering"}) cmd.Flags().StringSlice("ruleContexts", []string{}, heredoc.Doc(`Assigns a rule context to the search query. @@ -450,7 +450,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/ruleContexts/`)) cmd.Flags().SetAnnotation("ruleContexts", "Categories", []string{"Rules"}) semanticSearch := NewJSONVar([]string{}...) cmd.Flags().Var(semanticSearch, "semanticSearch", heredoc.Doc(`Settings for the semantic search part of NeuralSearch.`)) - cmd.Flags().String("similarQuery", "", heredoc.Doc(`Keywords to be used instead of the search query to conduct a more broader search. + cmd.Flags().String("similarQuery", "", heredoc.Doc(`Overrides the query parameter and performs a more generic search to find "similar" results. See: https://www.algolia.com/doc/api-reference/api-parameters/similarQuery/`)) cmd.Flags().SetAnnotation("similarQuery", "Categories", []string{"Search"}) cmd.Flags().String("snippetEllipsisText", "…", heredoc.Doc(`String used as an ellipsis indicator when a snippet is truncated. @@ -459,10 +459,10 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisTex cmd.Flags().String("sortFacetValuesBy", "count", heredoc.Doc(`Order in which to retrieve facet values. See: https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/`)) cmd.Flags().SetAnnotation("sortFacetValuesBy", "Categories", []string{"Faceting"}) - cmd.Flags().Bool("sumOrFiltersScores", false, heredoc.Doc(`Whether to sum all filter scores. + cmd.Flags().Bool("sumOrFiltersScores", false, heredoc.Doc(`How to calculate the filtering score. Whether to sum the scores of each matched filter or use the highest score of the filters. See: https://www.algolia.com/doc/api-reference/api-parameters/sumOrFiltersScores/`)) cmd.Flags().SetAnnotation("sumOrFiltersScores", "Categories", []string{"Filtering"}) - cmd.Flags().Bool("synonyms", true, heredoc.Doc(`Whether to take into account an index's synonyms for this search. + cmd.Flags().Bool("synonyms", true, heredoc.Doc(`Whether to use or disregard an index's synonyms for this search. See: https://www.algolia.com/doc/api-reference/api-parameters/synonyms/`)) cmd.Flags().SetAnnotation("synonyms", "Categories", []string{"Advanced"}) tagFilters := NewJSONVar([]string{"array", "string"}...) @@ -473,13 +473,13 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/`)) cmd.Flags().Var(typoTolerance, "typoTolerance", heredoc.Doc(`Whether typo tolerance is enabled and how it is applied. See: https://www.algolia.com/doc/api-reference/api-parameters/typoTolerance/`)) cmd.Flags().SetAnnotation("typoTolerance", "Categories", []string{"Typos"}) - cmd.Flags().String("userToken", "", heredoc.Doc(`Unique pseudonymous or anonymous user identifier. + cmd.Flags().String("userToken", "", heredoc.Doc(`Link the current search to a specific user with a user token (a unique pseudonymous or anonymous identifier). See: https://www.algolia.com/doc/api-reference/api-parameters/userToken/`)) cmd.Flags().SetAnnotation("userToken", "Categories", []string{"Personalization"}) } func AddDeleteByParamsFlags(cmd *cobra.Command) { - cmd.Flags().String("aroundLatLng", "", heredoc.Doc(`Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. + cmd.Flags().String("aroundLatLng", "", heredoc.Doc(`Coordinates for the center of a circle: expressed as a comma-separated string of latitude and longitude values. See: https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLng/`)) cmd.Flags().SetAnnotation("aroundLatLng", "Categories", []string{"Geo-Search"}) aroundRadius := NewJSONVar([]string{"integer", "string"}...) @@ -490,7 +490,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/aroundRadius/`)) cmd.Flags().Var(facetFilters, "facetFilters", heredoc.Doc(`Filter the search by facet values, so that only records with the same facet values are retrieved. See: https://www.algolia.com/doc/api-reference/api-parameters/facetFilters/`)) cmd.Flags().SetAnnotation("facetFilters", "Categories", []string{"Filtering"}) - cmd.Flags().String("filters", "", heredoc.Doc(`Filter expression to only include items that match the filter criteria in the response. + cmd.Flags().String("filters", "", heredoc.Doc(`Only include items that match the filter. See: https://www.algolia.com/doc/api-reference/api-parameters/filters/`)) cmd.Flags().SetAnnotation("filters", "Categories", []string{"Filtering"}) cmd.Flags().SetAnnotation("insideBoundingBox", "Categories", []string{"Geo-Search"}) @@ -518,10 +518,10 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/allowCompressionOf cmd.Flags().Bool("allowTyposOnNumericTokens", true, heredoc.Doc(`Whether to allow typos on numbers in the search query. See: https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/`)) cmd.Flags().SetAnnotation("allowTyposOnNumericTokens", "Categories", []string{"Typos"}) - cmd.Flags().StringSlice("alternativesAsExact", []string{"ignorePlurals", "singleWordSynonym"}, heredoc.Doc(`Alternatives of query words that should be considered as exact matches by the Exact ranking criterion. + cmd.Flags().StringSlice("alternativesAsExact", []string{"ignorePlurals", "singleWordSynonym"}, heredoc.Doc(`Determine which plurals and synonyms should be considered as exact matches. See: https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/`)) cmd.Flags().SetAnnotation("alternativesAsExact", "Categories", []string{"Query strategy"}) - cmd.Flags().Bool("attributeCriteriaComputedByMinProximity", false, heredoc.Doc(`Whether the best matching attribute should be determined by minimum proximity. + cmd.Flags().Bool("attributeCriteriaComputedByMinProximity", false, heredoc.Doc(`Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. See: https://www.algolia.com/doc/api-reference/api-parameters/attributeCriteriaComputedByMinProximity/`)) cmd.Flags().SetAnnotation("attributeCriteriaComputedByMinProximity", "Categories", []string{"Advanced"}) cmd.Flags().String("attributeForDistinct", "", heredoc.Doc(`Attribute that should be used to establish groups of results. @@ -599,7 +599,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/`)) cmd.Flags().Var(ignorePlurals, "ignorePlurals", heredoc.Doc(`Treat singular, plurals, and other forms of declensions as equivalent. See: https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/`)) cmd.Flags().SetAnnotation("ignorePlurals", "Categories", []string{"Languages"}) - cmd.Flags().StringSlice("indexLanguages", []string{}, heredoc.Doc(`Languages for language-specific processing steps, such as word detection and dictionary settings. + cmd.Flags().StringSlice("indexLanguages", []string{}, heredoc.Doc(`Define languages for which to apply language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. See: https://www.algolia.com/doc/api-reference/api-parameters/indexLanguages/`)) cmd.Flags().SetAnnotation("indexLanguages", "Categories", []string{"Languages"}) cmd.Flags().String("keepDiacriticsOnCharacters", "", heredoc.Doc(`Characters for which diacritics should be preserved. @@ -626,12 +626,12 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/mode/`)) cmd.Flags().StringSlice("numericAttributesForFiltering", []string{}, heredoc.Doc(`Numeric attributes that can be used as numerical filters. See: https://www.algolia.com/doc/api-reference/api-parameters/numericAttributesForFiltering/`)) cmd.Flags().SetAnnotation("numericAttributesForFiltering", "Categories", []string{"Performance"}) - cmd.Flags().StringSlice("optionalWords", []string{}, heredoc.Doc(`Words that should be considered optional when found in the query. + cmd.Flags().StringSlice("optionalWords", []string{}, heredoc.Doc(`If a search doesn't return enough results, you can increase the number of hits by setting these words as optional. See: https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/`)) cmd.Flags().SetAnnotation("optionalWords", "Categories", []string{"Query strategy"}) cmd.Flags().Int("paginationLimitedTo", 1000, heredoc.Doc(`Maximum number of search results that can be obtained through pagination. See: https://www.algolia.com/doc/api-reference/api-parameters/paginationLimitedTo/`)) - cmd.Flags().StringSlice("queryLanguages", []string{}, heredoc.Doc(`Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. + cmd.Flags().StringSlice("queryLanguages", []string{}, heredoc.Doc(`Define languages for which to apply language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. See: https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/`)) cmd.Flags().SetAnnotation("queryLanguages", "Categories", []string{"Languages"}) cmd.Flags().String("queryType", "prefixLast", heredoc.Doc(`Determines if and how query words are interpreted as prefixes. One of: prefixLast, prefixAll, prefixNone. @@ -662,10 +662,10 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/replaceSynonymsInH cmd.Flags().StringSlice("replicas", []string{}, heredoc.Doc(`Creates replica indices. See: https://www.algolia.com/doc/api-reference/api-parameters/replicas/`)) cmd.Flags().SetAnnotation("replicas", "Categories", []string{"Ranking"}) - cmd.Flags().StringSlice("responseFields", []string{"*"}, heredoc.Doc(`Properties to include in the API response of search and browse requests. + cmd.Flags().StringSlice("responseFields", []string{"*"}, heredoc.Doc(`Properties to include in search and browse API responses. See: https://www.algolia.com/doc/api-reference/api-parameters/responseFields/`)) cmd.Flags().SetAnnotation("responseFields", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("restrictHighlightAndSnippetArrays", false, heredoc.Doc(`Whether to restrict highlighting and snippeting to items that at least partially matched the search query. + cmd.Flags().Bool("restrictHighlightAndSnippetArrays", false, heredoc.Doc(`Whether to restrict highlighting and snippeting to items that partially or fully matched the search query. See: https://www.algolia.com/doc/api-reference/api-parameters/restrictHighlightAndSnippetArrays/`)) cmd.Flags().SetAnnotation("restrictHighlightAndSnippetArrays", "Categories", []string{"Highlighting and Snippeting"}) cmd.Flags().StringSlice("searchableAttributes", []string{}, heredoc.Doc(`Attributes used for searching. Attribute names are case-sensitive. @@ -705,30 +705,30 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntaxFeat cmd.Flags().Bool("allowTyposOnNumericTokens", true, heredoc.Doc(`Whether to allow typos on numbers in the search query. See: https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/`)) cmd.Flags().SetAnnotation("allowTyposOnNumericTokens", "Categories", []string{"Typos"}) - cmd.Flags().StringSlice("alternativesAsExact", []string{"ignorePlurals", "singleWordSynonym"}, heredoc.Doc(`Alternatives of query words that should be considered as exact matches by the Exact ranking criterion. + cmd.Flags().StringSlice("alternativesAsExact", []string{"ignorePlurals", "singleWordSynonym"}, heredoc.Doc(`Determine which plurals and synonyms should be considered as exact matches. See: https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/`)) cmd.Flags().SetAnnotation("alternativesAsExact", "Categories", []string{"Query strategy"}) - cmd.Flags().Bool("analytics", true, heredoc.Doc(`Whether this search will be included in Analytics. + cmd.Flags().Bool("analytics", true, heredoc.Doc(`Whether to include this query in Algolia's search analytics. See: https://www.algolia.com/doc/api-reference/api-parameters/analytics/`)) cmd.Flags().SetAnnotation("analytics", "Categories", []string{"Analytics"}) - cmd.Flags().StringSlice("analyticsTags", []string{}, heredoc.Doc(`Tags to apply to the query for segmenting analytics data. + cmd.Flags().StringSlice("analyticsTags", []string{}, heredoc.Doc(`Search analytics tags for query data segmentation. See: https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/`)) cmd.Flags().SetAnnotation("analyticsTags", "Categories", []string{"Analytics"}) - cmd.Flags().String("aroundLatLng", "", heredoc.Doc(`Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. + cmd.Flags().String("aroundLatLng", "", heredoc.Doc(`Coordinates for the center of a circle: a comma-separated string of latitude and longitude values. See: https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLng/`)) cmd.Flags().SetAnnotation("aroundLatLng", "Categories", []string{"Geo-Search"}) - cmd.Flags().Bool("aroundLatLngViaIP", false, heredoc.Doc(`Whether to obtain the coordinates from the request's IP address. + cmd.Flags().Bool("aroundLatLngViaIP", false, heredoc.Doc(`Whether to use the location computed from the user's IP address. See: https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLngViaIP/`)) cmd.Flags().SetAnnotation("aroundLatLngViaIP", "Categories", []string{"Geo-Search"}) aroundPrecision := NewJSONVar([]string{"integer", "array"}...) - cmd.Flags().Var(aroundPrecision, "aroundPrecision", heredoc.Doc(`Precision of a coordinate-based search in meters to group results with similar distances. + cmd.Flags().Var(aroundPrecision, "aroundPrecision", heredoc.Doc(`Groups similar distances into range bands. See: https://www.algolia.com/doc/api-reference/api-parameters/aroundPrecision/`)) cmd.Flags().SetAnnotation("aroundPrecision", "Categories", []string{"Geo-Search"}) aroundRadius := NewJSONVar([]string{"integer", "string"}...) cmd.Flags().Var(aroundRadius, "aroundRadius", heredoc.Doc(`Maximum radius for a search around a central location. See: https://www.algolia.com/doc/api-reference/api-parameters/aroundRadius/`)) cmd.Flags().SetAnnotation("aroundRadius", "Categories", []string{"Geo-Search"}) - cmd.Flags().Bool("attributeCriteriaComputedByMinProximity", false, heredoc.Doc(`Whether the best matching attribute should be determined by minimum proximity. + cmd.Flags().Bool("attributeCriteriaComputedByMinProximity", false, heredoc.Doc(`Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. See: https://www.algolia.com/doc/api-reference/api-parameters/attributeCriteriaComputedByMinProximity/`)) cmd.Flags().SetAnnotation("attributeCriteriaComputedByMinProximity", "Categories", []string{"Advanced"}) cmd.Flags().StringSlice("attributesToHighlight", []string{}, heredoc.Doc(`Attributes to highlight. @@ -759,7 +759,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleran cmd.Flags().Var(distinct, "distinct", heredoc.Doc(`Determines how many records of a group are included in the search results. See: https://www.algolia.com/doc/api-reference/api-parameters/distinct/`)) cmd.Flags().SetAnnotation("distinct", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("enableABTest", true, heredoc.Doc(`Whether to enable A/B testing for this search. + cmd.Flags().Bool("enableABTest", true, heredoc.Doc(`Whether to include this search in currently running A/B tests. See: https://www.algolia.com/doc/api-reference/api-parameters/enableABTest/`)) cmd.Flags().SetAnnotation("enableABTest", "Categories", []string{"Advanced"}) cmd.Flags().Bool("enablePersonalization", false, heredoc.Doc(`Whether to enable Personalization. @@ -781,10 +781,10 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/facetFilters/`)) cmd.Flags().Bool("facetingAfterDistinct", false, heredoc.Doc(`Whether faceting should be applied after deduplication with distinct. See: https://www.algolia.com/doc/api-reference/api-parameters/facetingAfterDistinct/`)) cmd.Flags().SetAnnotation("facetingAfterDistinct", "Categories", []string{"Faceting"}) - cmd.Flags().StringSlice("facets", []string{}, heredoc.Doc(`Facets for which to retrieve facet values that match the search criteria and the number of matching facet values. + cmd.Flags().StringSlice("facets", []string{}, heredoc.Doc(`Retrieve the specified facets and their facet values. See: https://www.algolia.com/doc/api-reference/api-parameters/facets/`)) cmd.Flags().SetAnnotation("facets", "Categories", []string{"Faceting"}) - cmd.Flags().String("filters", "", heredoc.Doc(`Filter expression to only include items that match the filter criteria in the response. + cmd.Flags().String("filters", "", heredoc.Doc(`Only include items that match the filter. See: https://www.algolia.com/doc/api-reference/api-parameters/filters/`)) cmd.Flags().SetAnnotation("filters", "Categories", []string{"Filtering"}) cmd.Flags().Bool("getRankingInfo", false, heredoc.Doc(`Whether the search response should include detailed ranking information. @@ -808,7 +808,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/`)) cmd.Flags().String("keepDiacriticsOnCharacters", "", heredoc.Doc(`Characters for which diacritics should be preserved. See: https://www.algolia.com/doc/api-reference/api-parameters/keepDiacriticsOnCharacters/`)) cmd.Flags().SetAnnotation("keepDiacriticsOnCharacters", "Categories", []string{"Languages"}) - cmd.Flags().Int("length", 0, heredoc.Doc(`Number of hits to retrieve (used in combination with offset). + cmd.Flags().Int("length", 0, heredoc.Doc(`If you've specified an offset, this determines the number of hits to retrieve. See: https://www.algolia.com/doc/api-reference/api-parameters/length/`)) cmd.Flags().SetAnnotation("length", "Categories", []string{"Pagination"}) cmd.Flags().Int("maxFacetHits", 10, heredoc.Doc(`Maximum number of facet values to return when searching for facet values. @@ -826,42 +826,42 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typ cmd.Flags().Int("minWordSizefor2Typos", 8, heredoc.Doc(`Minimum number of characters a word in the search query must contain to accept matches with two typos. See: https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor2Typos/`)) cmd.Flags().SetAnnotation("minWordSizefor2Typos", "Categories", []string{"Typos"}) - cmd.Flags().Int("minimumAroundRadius", 0, heredoc.Doc(`Minimum radius (in meters) for a search around a location when aroundRadius isn't set. + cmd.Flags().Int("minimumAroundRadius", 0, heredoc.Doc(`If aroundRadius isn't set, defines a [minimum radius] for aroundLatLng and aroundLatLngViaIP (in meters). See: https://www.algolia.com/doc/api-reference/api-parameters/minimumAroundRadius/`)) cmd.Flags().SetAnnotation("minimumAroundRadius", "Categories", []string{"Geo-Search"}) cmd.Flags().String("mode", "keywordSearch", heredoc.Doc(`Search mode the index will use to query for results. One of: neuralSearch, keywordSearch. See: https://www.algolia.com/doc/api-reference/api-parameters/mode/`)) cmd.Flags().SetAnnotation("mode", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("naturalLanguages", []string{}, heredoc.Doc(`ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches). + cmd.Flags().StringSlice("naturalLanguages", []string{}, heredoc.Doc(`Change the default settings for several natural language parameters in a single operation: ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags, and ruleContexts. See: https://www.algolia.com/doc/api-reference/api-parameters/naturalLanguages/`)) cmd.Flags().SetAnnotation("naturalLanguages", "Categories", []string{"Languages"}) numericFilters := NewJSONVar([]string{"array", "string"}...) cmd.Flags().Var(numericFilters, "numericFilters", heredoc.Doc(`Filter by numeric facets. See: https://www.algolia.com/doc/api-reference/api-parameters/numericFilters/`)) cmd.Flags().SetAnnotation("numericFilters", "Categories", []string{"Filtering"}) - cmd.Flags().Int("offset", 0, heredoc.Doc(`Position of the first hit to retrieve. + cmd.Flags().Int("offset", 0, heredoc.Doc(`Out of the results list, indicate which one you want to show first. See: https://www.algolia.com/doc/api-reference/api-parameters/offset/`)) cmd.Flags().SetAnnotation("offset", "Categories", []string{"Pagination"}) optionalFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(optionalFilters, "optionalFilters", heredoc.Doc(`Filters to promote or demote records in the search results. + cmd.Flags().Var(optionalFilters, "optionalFilters", heredoc.Doc(`Create filters for ranking purposes. Records that match the filter will rank higher (or lower for a negative filter). See: https://www.algolia.com/doc/api-reference/api-parameters/optionalFilters/`)) cmd.Flags().SetAnnotation("optionalFilters", "Categories", []string{"Filtering"}) - cmd.Flags().StringSlice("optionalWords", []string{}, heredoc.Doc(`Words that should be considered optional when found in the query. + cmd.Flags().StringSlice("optionalWords", []string{}, heredoc.Doc(`If a search doesn't return enough results, you can increase the number of hits by setting these words as optional. See: https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/`)) cmd.Flags().SetAnnotation("optionalWords", "Categories", []string{"Query strategy"}) - cmd.Flags().Int("page", 0, heredoc.Doc(`Page of search results to retrieve. + cmd.Flags().Int("page", 0, heredoc.Doc(`Requested page of search results. Algolia uses page and hitsPerPage to control how search results are displayed (paginated). See: https://www.algolia.com/doc/api-reference/api-parameters/page/`)) cmd.Flags().SetAnnotation("page", "Categories", []string{"Pagination"}) - cmd.Flags().Bool("percentileComputation", true, heredoc.Doc(`Whether to include this search when calculating processing-time percentiles. + cmd.Flags().Bool("percentileComputation", true, heredoc.Doc(`Whether to include this query in the processing-time percentile computation. See: https://www.algolia.com/doc/api-reference/api-parameters/percentileComputation/`)) cmd.Flags().SetAnnotation("percentileComputation", "Categories", []string{"Advanced"}) - cmd.Flags().Int("personalizationImpact", 100, heredoc.Doc(`Impact that Personalization should have on this search. + cmd.Flags().Int("personalizationImpact", 100, heredoc.Doc(`Determines the impact of the Personalization feature on results: from 0 (none) to 100 (maximum). See: https://www.algolia.com/doc/api-reference/api-parameters/personalizationImpact/`)) cmd.Flags().SetAnnotation("personalizationImpact", "Categories", []string{"Personalization"}) - cmd.Flags().String("query", "", heredoc.Doc(`Search query. + cmd.Flags().String("query", "", heredoc.Doc(`The text to search for in the index. See: https://www.algolia.com/doc/api-reference/api-parameters/query/`)) cmd.Flags().SetAnnotation("query", "Categories", []string{"Search"}) - cmd.Flags().StringSlice("queryLanguages", []string{}, heredoc.Doc(`Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. + cmd.Flags().StringSlice("queryLanguages", []string{}, heredoc.Doc(`Define languages for which to apply language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. See: https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/`)) cmd.Flags().SetAnnotation("queryLanguages", "Categories", []string{"Languages"}) cmd.Flags().String("queryType", "prefixLast", heredoc.Doc(`Determines if and how query words are interpreted as prefixes. One of: prefixLast, prefixAll, prefixNone. @@ -889,13 +889,13 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/renderingContent/` cmd.Flags().Bool("replaceSynonymsInHighlight", false, heredoc.Doc(`Whether to replace a highlighted word with the matched synonym. See: https://www.algolia.com/doc/api-reference/api-parameters/replaceSynonymsInHighlight/`)) cmd.Flags().SetAnnotation("replaceSynonymsInHighlight", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("responseFields", []string{"*"}, heredoc.Doc(`Properties to include in the API response of search and browse requests. + cmd.Flags().StringSlice("responseFields", []string{"*"}, heredoc.Doc(`Properties to include in search and browse API responses. See: https://www.algolia.com/doc/api-reference/api-parameters/responseFields/`)) cmd.Flags().SetAnnotation("responseFields", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("restrictHighlightAndSnippetArrays", false, heredoc.Doc(`Whether to restrict highlighting and snippeting to items that at least partially matched the search query. + cmd.Flags().Bool("restrictHighlightAndSnippetArrays", false, heredoc.Doc(`Whether to restrict highlighting and snippeting to items that partially or fully matched the search query. See: https://www.algolia.com/doc/api-reference/api-parameters/restrictHighlightAndSnippetArrays/`)) cmd.Flags().SetAnnotation("restrictHighlightAndSnippetArrays", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("restrictSearchableAttributes", []string{}, heredoc.Doc(`Restricts a search to a subset of your searchable attributes. + cmd.Flags().StringSlice("restrictSearchableAttributes", []string{}, heredoc.Doc(`Restrict the query to look at only the specified searchable attributes. See: https://www.algolia.com/doc/api-reference/api-parameters/restrictSearchableAttributes/`)) cmd.Flags().SetAnnotation("restrictSearchableAttributes", "Categories", []string{"Filtering"}) cmd.Flags().StringSlice("ruleContexts", []string{}, heredoc.Doc(`Assigns a rule context to the search query. @@ -903,7 +903,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/ruleContexts/`)) cmd.Flags().SetAnnotation("ruleContexts", "Categories", []string{"Rules"}) semanticSearch := NewJSONVar([]string{}...) cmd.Flags().Var(semanticSearch, "semanticSearch", heredoc.Doc(`Settings for the semantic search part of NeuralSearch.`)) - cmd.Flags().String("similarQuery", "", heredoc.Doc(`Keywords to be used instead of the search query to conduct a more broader search. + cmd.Flags().String("similarQuery", "", heredoc.Doc(`Overrides the query parameter and performs a more generic search to find "similar" results. See: https://www.algolia.com/doc/api-reference/api-parameters/similarQuery/`)) cmd.Flags().SetAnnotation("similarQuery", "Categories", []string{"Search"}) cmd.Flags().String("snippetEllipsisText", "…", heredoc.Doc(`String used as an ellipsis indicator when a snippet is truncated. @@ -912,10 +912,10 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisTex cmd.Flags().String("sortFacetValuesBy", "count", heredoc.Doc(`Order in which to retrieve facet values. See: https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/`)) cmd.Flags().SetAnnotation("sortFacetValuesBy", "Categories", []string{"Faceting"}) - cmd.Flags().Bool("sumOrFiltersScores", false, heredoc.Doc(`Whether to sum all filter scores. + cmd.Flags().Bool("sumOrFiltersScores", false, heredoc.Doc(`How to calculate the filtering score. Whether to sum the scores of each matched filter or use the highest score of the filters. See: https://www.algolia.com/doc/api-reference/api-parameters/sumOrFiltersScores/`)) cmd.Flags().SetAnnotation("sumOrFiltersScores", "Categories", []string{"Filtering"}) - cmd.Flags().Bool("synonyms", true, heredoc.Doc(`Whether to take into account an index's synonyms for this search. + cmd.Flags().Bool("synonyms", true, heredoc.Doc(`Whether to use or disregard an index's synonyms for this search. See: https://www.algolia.com/doc/api-reference/api-parameters/synonyms/`)) cmd.Flags().SetAnnotation("synonyms", "Categories", []string{"Advanced"}) tagFilters := NewJSONVar([]string{"array", "string"}...) @@ -926,7 +926,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/`)) cmd.Flags().Var(typoTolerance, "typoTolerance", heredoc.Doc(`Whether typo tolerance is enabled and how it is applied. See: https://www.algolia.com/doc/api-reference/api-parameters/typoTolerance/`)) cmd.Flags().SetAnnotation("typoTolerance", "Categories", []string{"Typos"}) - cmd.Flags().String("userToken", "", heredoc.Doc(`Unique pseudonymous or anonymous user identifier. + cmd.Flags().String("userToken", "", heredoc.Doc(`Link the current search to a specific user with a user token (a unique pseudonymous or anonymous identifier). See: https://www.algolia.com/doc/api-reference/api-parameters/userToken/`)) cmd.Flags().SetAnnotation("userToken", "Categories", []string{"Personalization"}) }