From e21d2969c2cfef77ba9f7f21fa1d5f4422f27738 Mon Sep 17 00:00:00 2001 From: Kai Welke Date: Thu, 25 Apr 2024 11:53:05 +0200 Subject: [PATCH 1/5] fix: descriptions --- pkg/cmdutil/spec_flags.go | 432 +++++++++++++++++++------------------- pkg/gen/gen_flags.go | 50 ++++- 2 files changed, 260 insertions(+), 222 deletions(-) diff --git a/pkg/cmdutil/spec_flags.go b/pkg/cmdutil/spec_flags.go index cf5007d6..54ea27a2 100644 --- a/pkg/cmdutil/spec_flags.go +++ b/pkg/cmdutil/spec_flags.go @@ -242,482 +242,482 @@ var SearchParamsObject = []string{ } func AddBrowseParamsObjectFlags(cmd *cobra.Command) { - cmd.Flags().Bool("advancedSyntax", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntax/`)) + cmd.Flags().Bool("advancedSyntax", false, heredoc.Doc(`Whether to support phrase matching and excluding words from search queries.`)) cmd.Flags().SetAnnotation("advancedSyntax", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("advancedSyntaxFeatures", []string{"exactPhrase", "excludeWords"}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntaxFeatures/`)) + cmd.Flags().StringSlice("advancedSyntaxFeatures", []string{"exactPhrase", "excludeWords"}, heredoc.Doc(`Advanced search syntax features you want to support.`)) cmd.Flags().SetAnnotation("advancedSyntaxFeatures", "Categories", []string{"Query strategy"}) - cmd.Flags().Bool("allowTyposOnNumericTokens", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/`)) + cmd.Flags().Bool("allowTyposOnNumericTokens", true, heredoc.Doc(`Whether to allow typos on numbers in the search query.`)) cmd.Flags().SetAnnotation("allowTyposOnNumericTokens", "Categories", []string{"Typos"}) - cmd.Flags().StringSlice("alternativesAsExact", []string{"ignorePlurals", "singleWordSynonym"}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/`)) + 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().SetAnnotation("alternativesAsExact", "Categories", []string{"Query strategy"}) - cmd.Flags().Bool("analytics", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/analytics/`)) + cmd.Flags().Bool("analytics", true, heredoc.Doc(`Whether this search will be included in Analytics.`)) cmd.Flags().SetAnnotation("analytics", "Categories", []string{"Analytics"}) - cmd.Flags().StringSlice("analyticsTags", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/`)) + cmd.Flags().StringSlice("analyticsTags", []string{}, heredoc.Doc(`Tags to apply to the query for segmenting analytics data.`)) cmd.Flags().SetAnnotation("analyticsTags", "Categories", []string{"Analytics"}) - cmd.Flags().String("aroundLatLng", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLng/`)) + 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().SetAnnotation("aroundLatLng", "Categories", []string{"Geo-Search"}) - cmd.Flags().Bool("aroundLatLngViaIP", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLngViaIP/`)) + cmd.Flags().Bool("aroundLatLngViaIP", false, heredoc.Doc(`Whether to obtain the coordinates from the request's IP address.`)) cmd.Flags().SetAnnotation("aroundLatLngViaIP", "Categories", []string{"Geo-Search"}) aroundPrecision := NewJSONVar([]string{"integer", "array"}...) - cmd.Flags().Var(aroundPrecision, "aroundPrecision", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/aroundPrecision/`)) + cmd.Flags().Var(aroundPrecision, "aroundPrecision", heredoc.Doc(`Precision of a coordinate-based search in meters to group results with similar distances.`)) cmd.Flags().SetAnnotation("aroundPrecision", "Categories", []string{"Geo-Search"}) aroundRadius := NewJSONVar([]string{"integer", "string"}...) - cmd.Flags().Var(aroundRadius, "aroundRadius", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/aroundRadius/`)) + cmd.Flags().Var(aroundRadius, "aroundRadius", heredoc.Doc(`Maximum radius for a search around a central location.`)) cmd.Flags().SetAnnotation("aroundRadius", "Categories", []string{"Geo-Search"}) - cmd.Flags().Bool("attributeCriteriaComputedByMinProximity", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/attributeCriteriaComputedByMinProximity/`)) + cmd.Flags().Bool("attributeCriteriaComputedByMinProximity", false, heredoc.Doc(`Whether the best matching attribute should be determined by minimum proximity.`)) cmd.Flags().SetAnnotation("attributeCriteriaComputedByMinProximity", "Categories", []string{"Advanced"}) - cmd.Flags().StringSlice("attributesToHighlight", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/`)) + cmd.Flags().StringSlice("attributesToHighlight", []string{}, heredoc.Doc(`Attributes to highlight.`)) cmd.Flags().SetAnnotation("attributesToHighlight", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("attributesToRetrieve", []string{"*"}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/attributesToRetrieve/`)) + cmd.Flags().StringSlice("attributesToRetrieve", []string{"*"}, heredoc.Doc(`Attributes to include in the API response.`)) cmd.Flags().SetAnnotation("attributesToRetrieve", "Categories", []string{"Attributes"}) - cmd.Flags().StringSlice("attributesToSnippet", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/`)) + cmd.Flags().StringSlice("attributesToSnippet", []string{}, heredoc.Doc(`Attributes for which to enable snippets.`)) cmd.Flags().SetAnnotation("attributesToSnippet", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().Bool("clickAnalytics", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/clickAnalytics/`)) + cmd.Flags().Bool("clickAnalytics", false, heredoc.Doc(`Whether to include a queryID attribute in the response.`)) cmd.Flags().SetAnnotation("clickAnalytics", "Categories", []string{"Analytics"}) - cmd.Flags().String("cursor", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/cursor/`)) - cmd.Flags().StringSlice("customRanking", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/customRanking/`)) + cmd.Flags().String("cursor", "", heredoc.Doc(`Cursor to get the next page of the response.`)) + cmd.Flags().StringSlice("customRanking", []string{}, heredoc.Doc(`Attributes to use as custom ranking.`)) cmd.Flags().SetAnnotation("customRanking", "Categories", []string{"Ranking"}) - cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/decompoundQuery/`)) + cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`Whether to split compound words into their building blocks.`)) cmd.Flags().SetAnnotation("decompoundQuery", "Categories", []string{"Languages"}) - cmd.Flags().StringSlice("disableExactOnAttributes", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/disableExactOnAttributes/`)) + cmd.Flags().StringSlice("disableExactOnAttributes", []string{}, heredoc.Doc(`Searchable attributes for which you want to turn off the Exact ranking criterion.`)) cmd.Flags().SetAnnotation("disableExactOnAttributes", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("disableTypoToleranceOnAttributes", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnAttributes/`)) + cmd.Flags().StringSlice("disableTypoToleranceOnAttributes", []string{}, heredoc.Doc(`Attributes for which you want to turn off typo tolerance.`)) cmd.Flags().SetAnnotation("disableTypoToleranceOnAttributes", "Categories", []string{"Typos"}) distinct := NewJSONVar([]string{"boolean", "integer"}...) - cmd.Flags().Var(distinct, "distinct", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/distinct/`)) + cmd.Flags().Var(distinct, "distinct", heredoc.Doc(`Determines how many records of a group are included in the search results.`)) cmd.Flags().SetAnnotation("distinct", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("enableABTest", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/enableABTest/`)) + cmd.Flags().Bool("enableABTest", true, heredoc.Doc(`Whether to enable A/B testing for this search.`)) cmd.Flags().SetAnnotation("enableABTest", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("enablePersonalization", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/enablePersonalization/`)) + cmd.Flags().Bool("enablePersonalization", false, heredoc.Doc(`Whether to enable Personalization.`)) cmd.Flags().SetAnnotation("enablePersonalization", "Categories", []string{"Personalization"}) - cmd.Flags().Bool("enableReRanking", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/enableReRanking/`)) + cmd.Flags().Bool("enableReRanking", true, heredoc.Doc(`Whether this search will use Dynamic Re-Ranking.`)) cmd.Flags().SetAnnotation("enableReRanking", "Categories", []string{"Filtering"}) - cmd.Flags().Bool("enableRules", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/enableRules/`)) + cmd.Flags().Bool("enableRules", true, heredoc.Doc(`Whether to enable rules.`)) cmd.Flags().SetAnnotation("enableRules", "Categories", []string{"Rules"}) - cmd.Flags().String("exactOnSingleWordQuery", "attribute", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/ One of: (attribute, none, word).`)) + cmd.Flags().String("exactOnSingleWordQuery", "attribute", heredoc.Doc(`Determines how the Exact ranking criterion is computed when the search query has only one word. One of: attribute, none, word.`)) cmd.Flags().SetAnnotation("exactOnSingleWordQuery", "Categories", []string{"Query strategy"}) facetFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(facetFilters, "facetFilters", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/facetFilters/`)) + cmd.Flags().Var(facetFilters, "facetFilters", heredoc.Doc(`Filter the search by facet values, so that only records with the same facet values are retrieved.`)) cmd.Flags().SetAnnotation("facetFilters", "Categories", []string{"Filtering"}) - cmd.Flags().Bool("facetingAfterDistinct", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/facetingAfterDistinct/`)) + cmd.Flags().Bool("facetingAfterDistinct", false, heredoc.Doc(`Whether faceting should be applied after deduplication with distinct.`)) cmd.Flags().SetAnnotation("facetingAfterDistinct", "Categories", []string{"Faceting"}) - cmd.Flags().StringSlice("facets", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/facets/`)) + 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().SetAnnotation("facets", "Categories", []string{"Faceting"}) - cmd.Flags().String("filters", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/filters/`)) + cmd.Flags().String("filters", "", heredoc.Doc(`Filter expression to only include items that match the filter criteria in the response.`)) cmd.Flags().SetAnnotation("filters", "Categories", []string{"Filtering"}) - cmd.Flags().Bool("getRankingInfo", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/getRankingInfo/`)) + cmd.Flags().Bool("getRankingInfo", false, heredoc.Doc(`Whether the search response should include detailed ranking information.`)) cmd.Flags().SetAnnotation("getRankingInfo", "Categories", []string{"Advanced"}) - cmd.Flags().String("highlightPostTag", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/highlightPostTag/`)) + cmd.Flags().String("highlightPostTag", "", heredoc.Doc(`HTML tag to insert after the highlighted parts in all highlighted results and snippets.`)) cmd.Flags().SetAnnotation("highlightPostTag", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().String("highlightPreTag", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/`)) + cmd.Flags().String("highlightPreTag", "", heredoc.Doc(`HTML tag to insert before the highlighted parts in all highlighted results and snippets.`)) cmd.Flags().SetAnnotation("highlightPreTag", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().Int("hitsPerPage", 20, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/`)) + cmd.Flags().Int("hitsPerPage", 20, heredoc.Doc(`Number of hits per page.`)) cmd.Flags().SetAnnotation("hitsPerPage", "Categories", []string{"Pagination"}) ignorePlurals := NewJSONVar([]string{"array", "boolean"}...) - cmd.Flags().Var(ignorePlurals, "ignorePlurals", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/`)) + cmd.Flags().Var(ignorePlurals, "ignorePlurals", heredoc.Doc(`Treat singular, plurals, and other forms of declensions as equivalent.`)) cmd.Flags().SetAnnotation("ignorePlurals", "Categories", []string{"Languages"}) cmd.Flags().SetAnnotation("insideBoundingBox", "Categories", []string{"Geo-Search"}) cmd.Flags().SetAnnotation("insidePolygon", "Categories", []string{"Geo-Search"}) - cmd.Flags().String("keepDiacriticsOnCharacters", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/keepDiacriticsOnCharacters/`)) + cmd.Flags().String("keepDiacriticsOnCharacters", "", heredoc.Doc(`Characters for which diacritics should be preserved.`)) cmd.Flags().SetAnnotation("keepDiacriticsOnCharacters", "Categories", []string{"Languages"}) - cmd.Flags().Int("length", 0, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/length/`)) + cmd.Flags().Int("length", 0, heredoc.Doc(`Number of hits to retrieve (used in combination with offset).`)) cmd.Flags().SetAnnotation("length", "Categories", []string{"Pagination"}) - cmd.Flags().Int("maxFacetHits", 10, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits/`)) + cmd.Flags().Int("maxFacetHits", 10, heredoc.Doc(`Maximum number of facet values to return when searching for facet values.`)) cmd.Flags().SetAnnotation("maxFacetHits", "Categories", []string{"Advanced"}) - cmd.Flags().Int("maxValuesPerFacet", 100, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/`)) + cmd.Flags().Int("maxValuesPerFacet", 100, heredoc.Doc(`Maximum number of facet values to return for each facet.`)) cmd.Flags().SetAnnotation("maxValuesPerFacet", "Categories", []string{"Faceting"}) - cmd.Flags().Int("minProximity", 1, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/minProximity/`)) + cmd.Flags().Int("minProximity", 1, heredoc.Doc(`Minimum proximity score for two matching words.`)) cmd.Flags().SetAnnotation("minProximity", "Categories", []string{"Advanced"}) - cmd.Flags().Int("minWordSizefor1Typo", 4, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typo/`)) + cmd.Flags().Int("minWordSizefor1Typo", 4, heredoc.Doc(`Minimum number of characters a word in the search query must contain to accept matches with one typo.`)) cmd.Flags().SetAnnotation("minWordSizefor1Typo", "Categories", []string{"Typos"}) - cmd.Flags().Int("minWordSizefor2Typos", 8, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor2Typos/`)) + 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.`)) cmd.Flags().SetAnnotation("minWordSizefor2Typos", "Categories", []string{"Typos"}) - cmd.Flags().Int("minimumAroundRadius", 0, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/minimumAroundRadius/`)) + cmd.Flags().Int("minimumAroundRadius", 0, heredoc.Doc(`Minimum radius (in meters) for a search around a location when aroundRadius isn't set.`)) cmd.Flags().SetAnnotation("minimumAroundRadius", "Categories", []string{"Geo-Search"}) - cmd.Flags().String("mode", "keywordSearch", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/mode/ One of: (neuralSearch, keywordSearch).`)) + cmd.Flags().String("mode", "keywordSearch", heredoc.Doc(`Search mode the index will use to query for results. One of: neuralSearch, keywordSearch.`)) cmd.Flags().SetAnnotation("mode", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("naturalLanguages", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/naturalLanguages/`)) + 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().SetAnnotation("naturalLanguages", "Categories", []string{"Languages"}) numericFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(numericFilters, "numericFilters", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/numericFilters/`)) + cmd.Flags().Var(numericFilters, "numericFilters", heredoc.Doc(`Filter by numeric facets.`)) cmd.Flags().SetAnnotation("numericFilters", "Categories", []string{"Filtering"}) - cmd.Flags().Int("offset", 0, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/offset/`)) + cmd.Flags().Int("offset", 0, heredoc.Doc(`Position of the first hit to retrieve.`)) cmd.Flags().SetAnnotation("offset", "Categories", []string{"Pagination"}) optionalFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(optionalFilters, "optionalFilters", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/optionalFilters/`)) + cmd.Flags().Var(optionalFilters, "optionalFilters", heredoc.Doc(`Filters to promote or demote records in the search results.`)) cmd.Flags().SetAnnotation("optionalFilters", "Categories", []string{"Filtering"}) - cmd.Flags().StringSlice("optionalWords", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/`)) + cmd.Flags().StringSlice("optionalWords", []string{}, heredoc.Doc(`Words that should be considered optional when found in the query.`)) cmd.Flags().SetAnnotation("optionalWords", "Categories", []string{"Query strategy"}) - cmd.Flags().Int("page", 0, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/page/`)) + cmd.Flags().Int("page", 0, heredoc.Doc(`Page of search results to retrieve.`)) cmd.Flags().SetAnnotation("page", "Categories", []string{"Pagination"}) - cmd.Flags().Bool("percentileComputation", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/percentileComputation/`)) + cmd.Flags().Bool("percentileComputation", true, heredoc.Doc(`Whether to include this search when calculating processing-time percentiles.`)) cmd.Flags().SetAnnotation("percentileComputation", "Categories", []string{"Advanced"}) - cmd.Flags().Int("personalizationImpact", 100, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/personalizationImpact/`)) + cmd.Flags().Int("personalizationImpact", 100, heredoc.Doc(`Impact that Personalization should have on this search.`)) cmd.Flags().SetAnnotation("personalizationImpact", "Categories", []string{"Personalization"}) - cmd.Flags().String("query", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/query/`)) + cmd.Flags().String("query", "", heredoc.Doc(`Search query.`)) cmd.Flags().SetAnnotation("query", "Categories", []string{"Search"}) - cmd.Flags().StringSlice("queryLanguages", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/`)) + 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().SetAnnotation("queryLanguages", "Categories", []string{"Languages"}) - cmd.Flags().String("queryType", "prefixLast", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/queryType/ One of: (prefixLast, prefixAll, prefixNone).`)) + cmd.Flags().String("queryType", "prefixLast", heredoc.Doc(`Determines if and how query words are interpreted as prefixes. One of: prefixLast, prefixAll, prefixNone.`)) cmd.Flags().SetAnnotation("queryType", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("ranking", []string{"typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/ranking/`)) + cmd.Flags().StringSlice("ranking", []string{"typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"}, heredoc.Doc(`Determines the order in which Algolia returns your results.`)) cmd.Flags().SetAnnotation("ranking", "Categories", []string{"Ranking"}) reRankingApplyFilter := NewJSONVar([]string{"array", "string", "null"}...) - cmd.Flags().Var(reRankingApplyFilter, "reRankingApplyFilter", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/reRankingApplyFilter/`)) - cmd.Flags().Int("relevancyStrictness", 100, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/relevancyStrictness/`)) + cmd.Flags().Var(reRankingApplyFilter, "reRankingApplyFilter", heredoc.Doc(`Restrict Dynamic Re-Ranking to records that match these filters.`)) + cmd.Flags().Int("relevancyStrictness", 100, heredoc.Doc(`Relevancy threshold below which less relevant results aren't included in the results.`)) cmd.Flags().SetAnnotation("relevancyStrictness", "Categories", []string{"Ranking"}) removeStopWords := NewJSONVar([]string{"array", "boolean"}...) - cmd.Flags().Var(removeStopWords, "removeStopWords", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/removeStopWords/`)) + cmd.Flags().Var(removeStopWords, "removeStopWords", heredoc.Doc(`Removes stop words from the search query.`)) cmd.Flags().SetAnnotation("removeStopWords", "Categories", []string{"Languages"}) - cmd.Flags().String("removeWordsIfNoResults", "none", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/removeWordsIfNoResults/ One of: (none, lastWords, firstWords, allOptional).`)) + cmd.Flags().String("removeWordsIfNoResults", "none", heredoc.Doc(`Strategy for removing words from the query when it doesn't return any results. One of: none, lastWords, firstWords, allOptional.`)) cmd.Flags().SetAnnotation("removeWordsIfNoResults", "Categories", []string{"Query strategy"}) renderingContent := NewJSONVar([]string{}...) - cmd.Flags().Var(renderingContent, "renderingContent", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/renderingContent/`)) + cmd.Flags().Var(renderingContent, "renderingContent", heredoc.Doc(`Extra data that can be used in the search UI.`)) cmd.Flags().SetAnnotation("renderingContent", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("replaceSynonymsInHighlight", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/replaceSynonymsInHighlight/`)) + cmd.Flags().Bool("replaceSynonymsInHighlight", false, heredoc.Doc(`Whether to replace a highlighted word with the matched synonym.`)) cmd.Flags().SetAnnotation("replaceSynonymsInHighlight", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("responseFields", []string{"*"}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/responseFields/`)) + cmd.Flags().StringSlice("responseFields", []string{"*"}, heredoc.Doc(`Properties to include in the API response of search and browse requests.`)) cmd.Flags().SetAnnotation("responseFields", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("restrictHighlightAndSnippetArrays", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/restrictHighlightAndSnippetArrays/`)) + 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().SetAnnotation("restrictHighlightAndSnippetArrays", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("restrictSearchableAttributes", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/restrictSearchableAttributes/`)) + cmd.Flags().StringSlice("restrictSearchableAttributes", []string{}, heredoc.Doc(`Restricts a search to a subset of your searchable attributes.`)) cmd.Flags().SetAnnotation("restrictSearchableAttributes", "Categories", []string{"Filtering"}) - cmd.Flags().StringSlice("ruleContexts", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/ruleContexts/`)) + cmd.Flags().StringSlice("ruleContexts", []string{}, heredoc.Doc(`Assigns a rule context to the search query.`)) cmd.Flags().SetAnnotation("ruleContexts", "Categories", []string{"Rules"}) semanticSearch := NewJSONVar([]string{}...) - cmd.Flags().Var(semanticSearch, "semanticSearch", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/semanticSearch/`)) - cmd.Flags().String("similarQuery", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/similarQuery/`)) + 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().SetAnnotation("similarQuery", "Categories", []string{"Search"}) - cmd.Flags().String("snippetEllipsisText", "…", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisText/`)) + cmd.Flags().String("snippetEllipsisText", "…", heredoc.Doc(`String used as an ellipsis indicator when a snippet is truncated.`)) cmd.Flags().SetAnnotation("snippetEllipsisText", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().String("sortFacetValuesBy", "count", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/`)) + cmd.Flags().String("sortFacetValuesBy", "count", heredoc.Doc(`Order in which to retrieve facet values.`)) cmd.Flags().SetAnnotation("sortFacetValuesBy", "Categories", []string{"Faceting"}) - cmd.Flags().Bool("sumOrFiltersScores", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/sumOrFiltersScores/`)) + cmd.Flags().Bool("sumOrFiltersScores", false, heredoc.Doc(`Whether to sum all filter scores.`)) cmd.Flags().SetAnnotation("sumOrFiltersScores", "Categories", []string{"Filtering"}) - cmd.Flags().Bool("synonyms", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/synonyms/`)) + cmd.Flags().Bool("synonyms", true, heredoc.Doc(`Whether to take into account an index's synonyms for this search.`)) cmd.Flags().SetAnnotation("synonyms", "Categories", []string{"Advanced"}) tagFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(tagFilters, "tagFilters", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/`)) + cmd.Flags().Var(tagFilters, "tagFilters", heredoc.Doc(`Filter the search by values of the special _tags attribute.`)) cmd.Flags().SetAnnotation("tagFilters", "Categories", []string{"Filtering"}) typoTolerance := NewJSONVar([]string{"boolean", "string"}...) - cmd.Flags().Var(typoTolerance, "typoTolerance", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/typoTolerance/`)) + cmd.Flags().Var(typoTolerance, "typoTolerance", heredoc.Doc(`Whether typo tolerance is enabled and how it is applied.`)) cmd.Flags().SetAnnotation("typoTolerance", "Categories", []string{"Typos"}) - cmd.Flags().String("userToken", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/userToken/`)) + cmd.Flags().String("userToken", "", heredoc.Doc(`Unique pseudonymous or anonymous user identifier.`)) cmd.Flags().SetAnnotation("userToken", "Categories", []string{"Personalization"}) } func AddDeleteByParamsFlags(cmd *cobra.Command) { - cmd.Flags().String("aroundLatLng", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLng/`)) + 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().SetAnnotation("aroundLatLng", "Categories", []string{"Geo-Search"}) aroundRadius := NewJSONVar([]string{"integer", "string"}...) - cmd.Flags().Var(aroundRadius, "aroundRadius", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/aroundRadius/`)) + cmd.Flags().Var(aroundRadius, "aroundRadius", heredoc.Doc(`Maximum radius for a search around a central location.`)) cmd.Flags().SetAnnotation("aroundRadius", "Categories", []string{"Geo-Search"}) facetFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(facetFilters, "facetFilters", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/facetFilters/`)) + cmd.Flags().Var(facetFilters, "facetFilters", heredoc.Doc(`Filter the search by facet values, so that only records with the same facet values are retrieved.`)) cmd.Flags().SetAnnotation("facetFilters", "Categories", []string{"Filtering"}) - cmd.Flags().String("filters", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/filters/`)) + cmd.Flags().String("filters", "", heredoc.Doc(`Filter expression to only include items that match the filter criteria in the response.`)) cmd.Flags().SetAnnotation("filters", "Categories", []string{"Filtering"}) cmd.Flags().SetAnnotation("insideBoundingBox", "Categories", []string{"Geo-Search"}) cmd.Flags().SetAnnotation("insidePolygon", "Categories", []string{"Geo-Search"}) numericFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(numericFilters, "numericFilters", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/numericFilters/`)) + cmd.Flags().Var(numericFilters, "numericFilters", heredoc.Doc(`Filter by numeric facets.`)) cmd.Flags().SetAnnotation("numericFilters", "Categories", []string{"Filtering"}) tagFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(tagFilters, "tagFilters", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/`)) + cmd.Flags().Var(tagFilters, "tagFilters", heredoc.Doc(`Filter the search by values of the special _tags attribute.`)) cmd.Flags().SetAnnotation("tagFilters", "Categories", []string{"Filtering"}) } func AddIndexSettingsFlags(cmd *cobra.Command) { - cmd.Flags().Bool("advancedSyntax", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntax/`)) + cmd.Flags().Bool("advancedSyntax", false, heredoc.Doc(`Whether to support phrase matching and excluding words from search queries.`)) cmd.Flags().SetAnnotation("advancedSyntax", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("advancedSyntaxFeatures", []string{"exactPhrase", "excludeWords"}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntaxFeatures/`)) + cmd.Flags().StringSlice("advancedSyntaxFeatures", []string{"exactPhrase", "excludeWords"}, heredoc.Doc(`Advanced search syntax features you want to support.`)) cmd.Flags().SetAnnotation("advancedSyntaxFeatures", "Categories", []string{"Query strategy"}) - cmd.Flags().Bool("allowCompressionOfIntegerArray", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/allowCompressionOfIntegerArray/`)) + cmd.Flags().Bool("allowCompressionOfIntegerArray", false, heredoc.Doc(`Whether arrays with exclusively non-negative integers should be compressed for better performance.`)) cmd.Flags().SetAnnotation("allowCompressionOfIntegerArray", "Categories", []string{"Performance"}) - cmd.Flags().Bool("allowTyposOnNumericTokens", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/`)) + cmd.Flags().Bool("allowTyposOnNumericTokens", true, heredoc.Doc(`Whether to allow typos on numbers in the search query.`)) cmd.Flags().SetAnnotation("allowTyposOnNumericTokens", "Categories", []string{"Typos"}) - cmd.Flags().StringSlice("alternativesAsExact", []string{"ignorePlurals", "singleWordSynonym"}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/`)) + 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().SetAnnotation("alternativesAsExact", "Categories", []string{"Query strategy"}) - cmd.Flags().Bool("attributeCriteriaComputedByMinProximity", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/attributeCriteriaComputedByMinProximity/`)) + cmd.Flags().Bool("attributeCriteriaComputedByMinProximity", false, heredoc.Doc(`Whether the best matching attribute should be determined by minimum proximity.`)) cmd.Flags().SetAnnotation("attributeCriteriaComputedByMinProximity", "Categories", []string{"Advanced"}) - cmd.Flags().String("attributeForDistinct", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/attributeForDistinct/`)) - cmd.Flags().StringSlice("attributesForFaceting", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/`)) + cmd.Flags().String("attributeForDistinct", "", heredoc.Doc(`Attribute that should be used to establish groups of results.`)) + cmd.Flags().StringSlice("attributesForFaceting", []string{}, heredoc.Doc(`Attributes used for faceting.`)) cmd.Flags().SetAnnotation("attributesForFaceting", "Categories", []string{"Faceting"}) - cmd.Flags().StringSlice("attributesToHighlight", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/`)) + cmd.Flags().StringSlice("attributesToHighlight", []string{}, heredoc.Doc(`Attributes to highlight.`)) cmd.Flags().SetAnnotation("attributesToHighlight", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("attributesToRetrieve", []string{"*"}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/attributesToRetrieve/`)) + cmd.Flags().StringSlice("attributesToRetrieve", []string{"*"}, heredoc.Doc(`Attributes to include in the API response.`)) cmd.Flags().SetAnnotation("attributesToRetrieve", "Categories", []string{"Attributes"}) - cmd.Flags().StringSlice("attributesToSnippet", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/`)) + cmd.Flags().StringSlice("attributesToSnippet", []string{}, heredoc.Doc(`Attributes for which to enable snippets.`)) cmd.Flags().SetAnnotation("attributesToSnippet", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("attributesToTransliterate", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/attributesToTransliterate/`)) + cmd.Flags().StringSlice("attributesToTransliterate", []string{}, heredoc.Doc(`Attributes, for which you want to support Japanese transliteration.`)) cmd.Flags().SetAnnotation("attributesToTransliterate", "Categories", []string{"Languages"}) - cmd.Flags().StringSlice("camelCaseAttributes", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/camelCaseAttributes/`)) + cmd.Flags().StringSlice("camelCaseAttributes", []string{}, heredoc.Doc(`Attributes for which to split camel case words.`)) cmd.Flags().SetAnnotation("camelCaseAttributes", "Categories", []string{"Languages"}) customNormalization := NewJSONVar([]string{}...) - cmd.Flags().Var(customNormalization, "customNormalization", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/customNormalization/`)) + cmd.Flags().Var(customNormalization, "customNormalization", heredoc.Doc(`Characters and their normalized replacements.`)) cmd.Flags().SetAnnotation("customNormalization", "Categories", []string{"Languages"}) - cmd.Flags().StringSlice("customRanking", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/customRanking/`)) + cmd.Flags().StringSlice("customRanking", []string{}, heredoc.Doc(`Attributes to use as custom ranking.`)) cmd.Flags().SetAnnotation("customRanking", "Categories", []string{"Ranking"}) - cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/decompoundQuery/`)) + cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`Whether to split compound words into their building blocks.`)) cmd.Flags().SetAnnotation("decompoundQuery", "Categories", []string{"Languages"}) decompoundedAttributes := NewJSONVar([]string{}...) - cmd.Flags().Var(decompoundedAttributes, "decompoundedAttributes", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/decompoundedAttributes/`)) + cmd.Flags().Var(decompoundedAttributes, "decompoundedAttributes", heredoc.Doc(`Searchable attributes to which Algolia should apply word segmentation (decompounding).`)) cmd.Flags().SetAnnotation("decompoundedAttributes", "Categories", []string{"Languages"}) - cmd.Flags().StringSlice("disableExactOnAttributes", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/disableExactOnAttributes/`)) + cmd.Flags().StringSlice("disableExactOnAttributes", []string{}, heredoc.Doc(`Searchable attributes for which you want to turn off the Exact ranking criterion.`)) cmd.Flags().SetAnnotation("disableExactOnAttributes", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("disablePrefixOnAttributes", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/disablePrefixOnAttributes/`)) + cmd.Flags().StringSlice("disablePrefixOnAttributes", []string{}, heredoc.Doc(`Searchable attributes for which you want to turn off prefix matching.`)) cmd.Flags().SetAnnotation("disablePrefixOnAttributes", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("disableTypoToleranceOnAttributes", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnAttributes/`)) + cmd.Flags().StringSlice("disableTypoToleranceOnAttributes", []string{}, heredoc.Doc(`Attributes for which you want to turn off typo tolerance.`)) cmd.Flags().SetAnnotation("disableTypoToleranceOnAttributes", "Categories", []string{"Typos"}) - cmd.Flags().StringSlice("disableTypoToleranceOnWords", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnWords/`)) + cmd.Flags().StringSlice("disableTypoToleranceOnWords", []string{}, heredoc.Doc(`Words for which you want to turn off typo tolerance.`)) cmd.Flags().SetAnnotation("disableTypoToleranceOnWords", "Categories", []string{"Typos"}) distinct := NewJSONVar([]string{"boolean", "integer"}...) - cmd.Flags().Var(distinct, "distinct", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/distinct/`)) + cmd.Flags().Var(distinct, "distinct", heredoc.Doc(`Determines how many records of a group are included in the search results.`)) cmd.Flags().SetAnnotation("distinct", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("enablePersonalization", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/enablePersonalization/`)) + cmd.Flags().Bool("enablePersonalization", false, heredoc.Doc(`Whether to enable Personalization.`)) cmd.Flags().SetAnnotation("enablePersonalization", "Categories", []string{"Personalization"}) - cmd.Flags().Bool("enableReRanking", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/enableReRanking/`)) + cmd.Flags().Bool("enableReRanking", true, heredoc.Doc(`Whether this search will use Dynamic Re-Ranking.`)) cmd.Flags().SetAnnotation("enableReRanking", "Categories", []string{"Filtering"}) - cmd.Flags().Bool("enableRules", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/enableRules/`)) + cmd.Flags().Bool("enableRules", true, heredoc.Doc(`Whether to enable rules.`)) cmd.Flags().SetAnnotation("enableRules", "Categories", []string{"Rules"}) - cmd.Flags().String("exactOnSingleWordQuery", "attribute", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/ One of: (attribute, none, word).`)) + cmd.Flags().String("exactOnSingleWordQuery", "attribute", heredoc.Doc(`Determines how the Exact ranking criterion is computed when the search query has only one word. One of: attribute, none, word.`)) cmd.Flags().SetAnnotation("exactOnSingleWordQuery", "Categories", []string{"Query strategy"}) - cmd.Flags().String("highlightPostTag", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/highlightPostTag/`)) + cmd.Flags().String("highlightPostTag", "", heredoc.Doc(`HTML tag to insert after the highlighted parts in all highlighted results and snippets.`)) cmd.Flags().SetAnnotation("highlightPostTag", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().String("highlightPreTag", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/`)) + cmd.Flags().String("highlightPreTag", "", heredoc.Doc(`HTML tag to insert before the highlighted parts in all highlighted results and snippets.`)) cmd.Flags().SetAnnotation("highlightPreTag", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().Int("hitsPerPage", 20, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/`)) + cmd.Flags().Int("hitsPerPage", 20, heredoc.Doc(`Number of hits per page.`)) cmd.Flags().SetAnnotation("hitsPerPage", "Categories", []string{"Pagination"}) ignorePlurals := NewJSONVar([]string{"array", "boolean"}...) - cmd.Flags().Var(ignorePlurals, "ignorePlurals", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/`)) + cmd.Flags().Var(ignorePlurals, "ignorePlurals", heredoc.Doc(`Treat singular, plurals, and other forms of declensions as equivalent.`)) cmd.Flags().SetAnnotation("ignorePlurals", "Categories", []string{"Languages"}) - cmd.Flags().StringSlice("indexLanguages", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/indexLanguages/`)) + cmd.Flags().StringSlice("indexLanguages", []string{}, heredoc.Doc(`Languages for language-specific processing steps, such as word detection and dictionary settings.`)) cmd.Flags().SetAnnotation("indexLanguages", "Categories", []string{"Languages"}) - cmd.Flags().String("keepDiacriticsOnCharacters", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/keepDiacriticsOnCharacters/`)) + cmd.Flags().String("keepDiacriticsOnCharacters", "", heredoc.Doc(`Characters for which diacritics should be preserved.`)) cmd.Flags().SetAnnotation("keepDiacriticsOnCharacters", "Categories", []string{"Languages"}) - cmd.Flags().Int("maxFacetHits", 10, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits/`)) + cmd.Flags().Int("maxFacetHits", 10, heredoc.Doc(`Maximum number of facet values to return when searching for facet values.`)) cmd.Flags().SetAnnotation("maxFacetHits", "Categories", []string{"Advanced"}) - cmd.Flags().Int("maxValuesPerFacet", 100, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/`)) + cmd.Flags().Int("maxValuesPerFacet", 100, heredoc.Doc(`Maximum number of facet values to return for each facet.`)) cmd.Flags().SetAnnotation("maxValuesPerFacet", "Categories", []string{"Faceting"}) - cmd.Flags().Int("minProximity", 1, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/minProximity/`)) + cmd.Flags().Int("minProximity", 1, heredoc.Doc(`Minimum proximity score for two matching words.`)) cmd.Flags().SetAnnotation("minProximity", "Categories", []string{"Advanced"}) - cmd.Flags().Int("minWordSizefor1Typo", 4, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typo/`)) + cmd.Flags().Int("minWordSizefor1Typo", 4, heredoc.Doc(`Minimum number of characters a word in the search query must contain to accept matches with one typo.`)) cmd.Flags().SetAnnotation("minWordSizefor1Typo", "Categories", []string{"Typos"}) - cmd.Flags().Int("minWordSizefor2Typos", 8, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor2Typos/`)) + 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.`)) cmd.Flags().SetAnnotation("minWordSizefor2Typos", "Categories", []string{"Typos"}) - cmd.Flags().String("mode", "keywordSearch", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/mode/ One of: (neuralSearch, keywordSearch).`)) + cmd.Flags().String("mode", "keywordSearch", heredoc.Doc(`Search mode the index will use to query for results. One of: neuralSearch, keywordSearch.`)) cmd.Flags().SetAnnotation("mode", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("numericAttributesForFiltering", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/numericAttributesForFiltering/`)) + cmd.Flags().StringSlice("numericAttributesForFiltering", []string{}, heredoc.Doc(`Numeric attributes that can be used as numerical filters.`)) cmd.Flags().SetAnnotation("numericAttributesForFiltering", "Categories", []string{"Performance"}) - cmd.Flags().StringSlice("optionalWords", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/`)) + cmd.Flags().StringSlice("optionalWords", []string{}, heredoc.Doc(`Words that should be considered optional when found in the query.`)) cmd.Flags().SetAnnotation("optionalWords", "Categories", []string{"Query strategy"}) - cmd.Flags().Int("paginationLimitedTo", 1000, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/paginationLimitedTo/`)) - cmd.Flags().StringSlice("queryLanguages", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/`)) + cmd.Flags().Int("paginationLimitedTo", 1000, heredoc.Doc(`Maximum number of search results that can be obtained through pagination.`)) + 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().SetAnnotation("queryLanguages", "Categories", []string{"Languages"}) - cmd.Flags().String("queryType", "prefixLast", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/queryType/ One of: (prefixLast, prefixAll, prefixNone).`)) + cmd.Flags().String("queryType", "prefixLast", heredoc.Doc(`Determines if and how query words are interpreted as prefixes. One of: prefixLast, prefixAll, prefixNone.`)) cmd.Flags().SetAnnotation("queryType", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("ranking", []string{"typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/ranking/`)) + cmd.Flags().StringSlice("ranking", []string{"typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"}, heredoc.Doc(`Determines the order in which Algolia returns your results.`)) cmd.Flags().SetAnnotation("ranking", "Categories", []string{"Ranking"}) reRankingApplyFilter := NewJSONVar([]string{"array", "string", "null"}...) - cmd.Flags().Var(reRankingApplyFilter, "reRankingApplyFilter", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/reRankingApplyFilter/`)) - cmd.Flags().Int("relevancyStrictness", 100, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/relevancyStrictness/`)) + cmd.Flags().Var(reRankingApplyFilter, "reRankingApplyFilter", heredoc.Doc(`Restrict Dynamic Re-Ranking to records that match these filters.`)) + cmd.Flags().Int("relevancyStrictness", 100, heredoc.Doc(`Relevancy threshold below which less relevant results aren't included in the results.`)) cmd.Flags().SetAnnotation("relevancyStrictness", "Categories", []string{"Ranking"}) removeStopWords := NewJSONVar([]string{"array", "boolean"}...) - cmd.Flags().Var(removeStopWords, "removeStopWords", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/removeStopWords/`)) + cmd.Flags().Var(removeStopWords, "removeStopWords", heredoc.Doc(`Removes stop words from the search query.`)) cmd.Flags().SetAnnotation("removeStopWords", "Categories", []string{"Languages"}) - cmd.Flags().String("removeWordsIfNoResults", "none", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/removeWordsIfNoResults/ One of: (none, lastWords, firstWords, allOptional).`)) + cmd.Flags().String("removeWordsIfNoResults", "none", heredoc.Doc(`Strategy for removing words from the query when it doesn't return any results. One of: none, lastWords, firstWords, allOptional.`)) cmd.Flags().SetAnnotation("removeWordsIfNoResults", "Categories", []string{"Query strategy"}) renderingContent := NewJSONVar([]string{}...) - cmd.Flags().Var(renderingContent, "renderingContent", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/renderingContent/`)) + cmd.Flags().Var(renderingContent, "renderingContent", heredoc.Doc(`Extra data that can be used in the search UI.`)) cmd.Flags().SetAnnotation("renderingContent", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("replaceSynonymsInHighlight", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/replaceSynonymsInHighlight/`)) + cmd.Flags().Bool("replaceSynonymsInHighlight", false, heredoc.Doc(`Whether to replace a highlighted word with the matched synonym.`)) cmd.Flags().SetAnnotation("replaceSynonymsInHighlight", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("replicas", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/replicas/`)) + cmd.Flags().StringSlice("replicas", []string{}, heredoc.Doc(`Creates replica indices.`)) cmd.Flags().SetAnnotation("replicas", "Categories", []string{"Ranking"}) - cmd.Flags().StringSlice("responseFields", []string{"*"}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/responseFields/`)) + cmd.Flags().StringSlice("responseFields", []string{"*"}, heredoc.Doc(`Properties to include in the API response of search and browse requests.`)) cmd.Flags().SetAnnotation("responseFields", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("restrictHighlightAndSnippetArrays", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/restrictHighlightAndSnippetArrays/`)) + 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().SetAnnotation("restrictHighlightAndSnippetArrays", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("searchableAttributes", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/searchableAttributes/`)) + cmd.Flags().StringSlice("searchableAttributes", []string{}, heredoc.Doc(`Attributes used for searching. Attribute names are case-sensitive.`)) cmd.Flags().SetAnnotation("searchableAttributes", "Categories", []string{"Attributes"}) semanticSearch := NewJSONVar([]string{}...) - cmd.Flags().Var(semanticSearch, "semanticSearch", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/semanticSearch/`)) - cmd.Flags().String("separatorsToIndex", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/separatorsToIndex/`)) + cmd.Flags().Var(semanticSearch, "semanticSearch", heredoc.Doc(`Settings for the semantic search part of NeuralSearch.`)) + cmd.Flags().String("separatorsToIndex", "", heredoc.Doc(`Controls which separators are indexed.`)) cmd.Flags().SetAnnotation("separatorsToIndex", "Categories", []string{"Typos"}) - cmd.Flags().String("snippetEllipsisText", "…", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisText/`)) + cmd.Flags().String("snippetEllipsisText", "…", heredoc.Doc(`String used as an ellipsis indicator when a snippet is truncated.`)) cmd.Flags().SetAnnotation("snippetEllipsisText", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().String("sortFacetValuesBy", "count", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/`)) + cmd.Flags().String("sortFacetValuesBy", "count", heredoc.Doc(`Order in which to retrieve facet values.`)) cmd.Flags().SetAnnotation("sortFacetValuesBy", "Categories", []string{"Faceting"}) typoTolerance := NewJSONVar([]string{"boolean", "string"}...) - cmd.Flags().Var(typoTolerance, "typoTolerance", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/typoTolerance/`)) + cmd.Flags().Var(typoTolerance, "typoTolerance", heredoc.Doc(`Whether typo tolerance is enabled and how it is applied.`)) cmd.Flags().SetAnnotation("typoTolerance", "Categories", []string{"Typos"}) - cmd.Flags().StringSlice("unretrievableAttributes", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/unretrievableAttributes/`)) + cmd.Flags().StringSlice("unretrievableAttributes", []string{}, heredoc.Doc(`Attributes that can't be retrieved at query time.`)) cmd.Flags().SetAnnotation("unretrievableAttributes", "Categories", []string{"Attributes"}) userData := NewJSONVar([]string{}...) - cmd.Flags().Var(userData, "userData", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/userData/`)) + cmd.Flags().Var(userData, "userData", heredoc.Doc(`An object with custom data.`)) cmd.Flags().SetAnnotation("userData", "Categories", []string{"Advanced"}) } func AddSearchParamsObjectFlags(cmd *cobra.Command) { - cmd.Flags().Bool("advancedSyntax", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntax/`)) + cmd.Flags().Bool("advancedSyntax", false, heredoc.Doc(`Whether to support phrase matching and excluding words from search queries.`)) cmd.Flags().SetAnnotation("advancedSyntax", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("advancedSyntaxFeatures", []string{"exactPhrase", "excludeWords"}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntaxFeatures/`)) + cmd.Flags().StringSlice("advancedSyntaxFeatures", []string{"exactPhrase", "excludeWords"}, heredoc.Doc(`Advanced search syntax features you want to support.`)) cmd.Flags().SetAnnotation("advancedSyntaxFeatures", "Categories", []string{"Query strategy"}) - cmd.Flags().Bool("allowTyposOnNumericTokens", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/`)) + cmd.Flags().Bool("allowTyposOnNumericTokens", true, heredoc.Doc(`Whether to allow typos on numbers in the search query.`)) cmd.Flags().SetAnnotation("allowTyposOnNumericTokens", "Categories", []string{"Typos"}) - cmd.Flags().StringSlice("alternativesAsExact", []string{"ignorePlurals", "singleWordSynonym"}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/`)) + 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().SetAnnotation("alternativesAsExact", "Categories", []string{"Query strategy"}) - cmd.Flags().Bool("analytics", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/analytics/`)) + cmd.Flags().Bool("analytics", true, heredoc.Doc(`Whether this search will be included in Analytics.`)) cmd.Flags().SetAnnotation("analytics", "Categories", []string{"Analytics"}) - cmd.Flags().StringSlice("analyticsTags", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/`)) + cmd.Flags().StringSlice("analyticsTags", []string{}, heredoc.Doc(`Tags to apply to the query for segmenting analytics data.`)) cmd.Flags().SetAnnotation("analyticsTags", "Categories", []string{"Analytics"}) - cmd.Flags().String("aroundLatLng", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLng/`)) + 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().SetAnnotation("aroundLatLng", "Categories", []string{"Geo-Search"}) - cmd.Flags().Bool("aroundLatLngViaIP", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLngViaIP/`)) + cmd.Flags().Bool("aroundLatLngViaIP", false, heredoc.Doc(`Whether to obtain the coordinates from the request's IP address.`)) cmd.Flags().SetAnnotation("aroundLatLngViaIP", "Categories", []string{"Geo-Search"}) aroundPrecision := NewJSONVar([]string{"integer", "array"}...) - cmd.Flags().Var(aroundPrecision, "aroundPrecision", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/aroundPrecision/`)) + cmd.Flags().Var(aroundPrecision, "aroundPrecision", heredoc.Doc(`Precision of a coordinate-based search in meters to group results with similar distances.`)) cmd.Flags().SetAnnotation("aroundPrecision", "Categories", []string{"Geo-Search"}) aroundRadius := NewJSONVar([]string{"integer", "string"}...) - cmd.Flags().Var(aroundRadius, "aroundRadius", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/aroundRadius/`)) + cmd.Flags().Var(aroundRadius, "aroundRadius", heredoc.Doc(`Maximum radius for a search around a central location.`)) cmd.Flags().SetAnnotation("aroundRadius", "Categories", []string{"Geo-Search"}) - cmd.Flags().Bool("attributeCriteriaComputedByMinProximity", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/attributeCriteriaComputedByMinProximity/`)) + cmd.Flags().Bool("attributeCriteriaComputedByMinProximity", false, heredoc.Doc(`Whether the best matching attribute should be determined by minimum proximity.`)) cmd.Flags().SetAnnotation("attributeCriteriaComputedByMinProximity", "Categories", []string{"Advanced"}) - cmd.Flags().StringSlice("attributesToHighlight", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/`)) + cmd.Flags().StringSlice("attributesToHighlight", []string{}, heredoc.Doc(`Attributes to highlight.`)) cmd.Flags().SetAnnotation("attributesToHighlight", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("attributesToRetrieve", []string{"*"}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/attributesToRetrieve/`)) + cmd.Flags().StringSlice("attributesToRetrieve", []string{"*"}, heredoc.Doc(`Attributes to include in the API response.`)) cmd.Flags().SetAnnotation("attributesToRetrieve", "Categories", []string{"Attributes"}) - cmd.Flags().StringSlice("attributesToSnippet", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/`)) + cmd.Flags().StringSlice("attributesToSnippet", []string{}, heredoc.Doc(`Attributes for which to enable snippets.`)) cmd.Flags().SetAnnotation("attributesToSnippet", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().Bool("clickAnalytics", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/clickAnalytics/`)) + cmd.Flags().Bool("clickAnalytics", false, heredoc.Doc(`Whether to include a queryID attribute in the response.`)) cmd.Flags().SetAnnotation("clickAnalytics", "Categories", []string{"Analytics"}) - cmd.Flags().StringSlice("customRanking", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/customRanking/`)) + cmd.Flags().StringSlice("customRanking", []string{}, heredoc.Doc(`Attributes to use as custom ranking.`)) cmd.Flags().SetAnnotation("customRanking", "Categories", []string{"Ranking"}) - cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/decompoundQuery/`)) + cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`Whether to split compound words into their building blocks.`)) cmd.Flags().SetAnnotation("decompoundQuery", "Categories", []string{"Languages"}) - cmd.Flags().StringSlice("disableExactOnAttributes", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/disableExactOnAttributes/`)) + cmd.Flags().StringSlice("disableExactOnAttributes", []string{}, heredoc.Doc(`Searchable attributes for which you want to turn off the Exact ranking criterion.`)) cmd.Flags().SetAnnotation("disableExactOnAttributes", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("disableTypoToleranceOnAttributes", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnAttributes/`)) + cmd.Flags().StringSlice("disableTypoToleranceOnAttributes", []string{}, heredoc.Doc(`Attributes for which you want to turn off typo tolerance.`)) cmd.Flags().SetAnnotation("disableTypoToleranceOnAttributes", "Categories", []string{"Typos"}) distinct := NewJSONVar([]string{"boolean", "integer"}...) - cmd.Flags().Var(distinct, "distinct", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/distinct/`)) + cmd.Flags().Var(distinct, "distinct", heredoc.Doc(`Determines how many records of a group are included in the search results.`)) cmd.Flags().SetAnnotation("distinct", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("enableABTest", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/enableABTest/`)) + cmd.Flags().Bool("enableABTest", true, heredoc.Doc(`Whether to enable A/B testing for this search.`)) cmd.Flags().SetAnnotation("enableABTest", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("enablePersonalization", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/enablePersonalization/`)) + cmd.Flags().Bool("enablePersonalization", false, heredoc.Doc(`Whether to enable Personalization.`)) cmd.Flags().SetAnnotation("enablePersonalization", "Categories", []string{"Personalization"}) - cmd.Flags().Bool("enableReRanking", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/enableReRanking/`)) + cmd.Flags().Bool("enableReRanking", true, heredoc.Doc(`Whether this search will use Dynamic Re-Ranking.`)) cmd.Flags().SetAnnotation("enableReRanking", "Categories", []string{"Filtering"}) - cmd.Flags().Bool("enableRules", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/enableRules/`)) + cmd.Flags().Bool("enableRules", true, heredoc.Doc(`Whether to enable rules.`)) cmd.Flags().SetAnnotation("enableRules", "Categories", []string{"Rules"}) - cmd.Flags().String("exactOnSingleWordQuery", "attribute", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/ One of: (attribute, none, word).`)) + cmd.Flags().String("exactOnSingleWordQuery", "attribute", heredoc.Doc(`Determines how the Exact ranking criterion is computed when the search query has only one word. One of: attribute, none, word.`)) cmd.Flags().SetAnnotation("exactOnSingleWordQuery", "Categories", []string{"Query strategy"}) facetFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(facetFilters, "facetFilters", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/facetFilters/`)) + cmd.Flags().Var(facetFilters, "facetFilters", heredoc.Doc(`Filter the search by facet values, so that only records with the same facet values are retrieved.`)) cmd.Flags().SetAnnotation("facetFilters", "Categories", []string{"Filtering"}) - cmd.Flags().Bool("facetingAfterDistinct", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/facetingAfterDistinct/`)) + cmd.Flags().Bool("facetingAfterDistinct", false, heredoc.Doc(`Whether faceting should be applied after deduplication with distinct.`)) cmd.Flags().SetAnnotation("facetingAfterDistinct", "Categories", []string{"Faceting"}) - cmd.Flags().StringSlice("facets", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/facets/`)) + 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().SetAnnotation("facets", "Categories", []string{"Faceting"}) - cmd.Flags().String("filters", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/filters/`)) + cmd.Flags().String("filters", "", heredoc.Doc(`Filter expression to only include items that match the filter criteria in the response.`)) cmd.Flags().SetAnnotation("filters", "Categories", []string{"Filtering"}) - cmd.Flags().Bool("getRankingInfo", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/getRankingInfo/`)) + cmd.Flags().Bool("getRankingInfo", false, heredoc.Doc(`Whether the search response should include detailed ranking information.`)) cmd.Flags().SetAnnotation("getRankingInfo", "Categories", []string{"Advanced"}) - cmd.Flags().String("highlightPostTag", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/highlightPostTag/`)) + cmd.Flags().String("highlightPostTag", "", heredoc.Doc(`HTML tag to insert after the highlighted parts in all highlighted results and snippets.`)) cmd.Flags().SetAnnotation("highlightPostTag", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().String("highlightPreTag", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/`)) + cmd.Flags().String("highlightPreTag", "", heredoc.Doc(`HTML tag to insert before the highlighted parts in all highlighted results and snippets.`)) cmd.Flags().SetAnnotation("highlightPreTag", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().Int("hitsPerPage", 20, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/`)) + cmd.Flags().Int("hitsPerPage", 20, heredoc.Doc(`Number of hits per page.`)) cmd.Flags().SetAnnotation("hitsPerPage", "Categories", []string{"Pagination"}) ignorePlurals := NewJSONVar([]string{"array", "boolean"}...) - cmd.Flags().Var(ignorePlurals, "ignorePlurals", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/`)) + cmd.Flags().Var(ignorePlurals, "ignorePlurals", heredoc.Doc(`Treat singular, plurals, and other forms of declensions as equivalent.`)) cmd.Flags().SetAnnotation("ignorePlurals", "Categories", []string{"Languages"}) cmd.Flags().SetAnnotation("insideBoundingBox", "Categories", []string{"Geo-Search"}) cmd.Flags().SetAnnotation("insidePolygon", "Categories", []string{"Geo-Search"}) - cmd.Flags().String("keepDiacriticsOnCharacters", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/keepDiacriticsOnCharacters/`)) + cmd.Flags().String("keepDiacriticsOnCharacters", "", heredoc.Doc(`Characters for which diacritics should be preserved.`)) cmd.Flags().SetAnnotation("keepDiacriticsOnCharacters", "Categories", []string{"Languages"}) - cmd.Flags().Int("length", 0, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/length/`)) + cmd.Flags().Int("length", 0, heredoc.Doc(`Number of hits to retrieve (used in combination with offset).`)) cmd.Flags().SetAnnotation("length", "Categories", []string{"Pagination"}) - cmd.Flags().Int("maxFacetHits", 10, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits/`)) + cmd.Flags().Int("maxFacetHits", 10, heredoc.Doc(`Maximum number of facet values to return when searching for facet values.`)) cmd.Flags().SetAnnotation("maxFacetHits", "Categories", []string{"Advanced"}) - cmd.Flags().Int("maxValuesPerFacet", 100, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/`)) + cmd.Flags().Int("maxValuesPerFacet", 100, heredoc.Doc(`Maximum number of facet values to return for each facet.`)) cmd.Flags().SetAnnotation("maxValuesPerFacet", "Categories", []string{"Faceting"}) - cmd.Flags().Int("minProximity", 1, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/minProximity/`)) + cmd.Flags().Int("minProximity", 1, heredoc.Doc(`Minimum proximity score for two matching words.`)) cmd.Flags().SetAnnotation("minProximity", "Categories", []string{"Advanced"}) - cmd.Flags().Int("minWordSizefor1Typo", 4, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typo/`)) + cmd.Flags().Int("minWordSizefor1Typo", 4, heredoc.Doc(`Minimum number of characters a word in the search query must contain to accept matches with one typo.`)) cmd.Flags().SetAnnotation("minWordSizefor1Typo", "Categories", []string{"Typos"}) - cmd.Flags().Int("minWordSizefor2Typos", 8, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor2Typos/`)) + 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.`)) cmd.Flags().SetAnnotation("minWordSizefor2Typos", "Categories", []string{"Typos"}) - cmd.Flags().Int("minimumAroundRadius", 0, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/minimumAroundRadius/`)) + cmd.Flags().Int("minimumAroundRadius", 0, heredoc.Doc(`Minimum radius (in meters) for a search around a location when aroundRadius isn't set.`)) cmd.Flags().SetAnnotation("minimumAroundRadius", "Categories", []string{"Geo-Search"}) - cmd.Flags().String("mode", "keywordSearch", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/mode/ One of: (neuralSearch, keywordSearch).`)) + cmd.Flags().String("mode", "keywordSearch", heredoc.Doc(`Search mode the index will use to query for results. One of: neuralSearch, keywordSearch.`)) cmd.Flags().SetAnnotation("mode", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("naturalLanguages", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/naturalLanguages/`)) + 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().SetAnnotation("naturalLanguages", "Categories", []string{"Languages"}) numericFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(numericFilters, "numericFilters", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/numericFilters/`)) + cmd.Flags().Var(numericFilters, "numericFilters", heredoc.Doc(`Filter by numeric facets.`)) cmd.Flags().SetAnnotation("numericFilters", "Categories", []string{"Filtering"}) - cmd.Flags().Int("offset", 0, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/offset/`)) + cmd.Flags().Int("offset", 0, heredoc.Doc(`Position of the first hit to retrieve.`)) cmd.Flags().SetAnnotation("offset", "Categories", []string{"Pagination"}) optionalFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(optionalFilters, "optionalFilters", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/optionalFilters/`)) + cmd.Flags().Var(optionalFilters, "optionalFilters", heredoc.Doc(`Filters to promote or demote records in the search results.`)) cmd.Flags().SetAnnotation("optionalFilters", "Categories", []string{"Filtering"}) - cmd.Flags().StringSlice("optionalWords", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/`)) + cmd.Flags().StringSlice("optionalWords", []string{}, heredoc.Doc(`Words that should be considered optional when found in the query.`)) cmd.Flags().SetAnnotation("optionalWords", "Categories", []string{"Query strategy"}) - cmd.Flags().Int("page", 0, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/page/`)) + cmd.Flags().Int("page", 0, heredoc.Doc(`Page of search results to retrieve.`)) cmd.Flags().SetAnnotation("page", "Categories", []string{"Pagination"}) - cmd.Flags().Bool("percentileComputation", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/percentileComputation/`)) + cmd.Flags().Bool("percentileComputation", true, heredoc.Doc(`Whether to include this search when calculating processing-time percentiles.`)) cmd.Flags().SetAnnotation("percentileComputation", "Categories", []string{"Advanced"}) - cmd.Flags().Int("personalizationImpact", 100, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/personalizationImpact/`)) + cmd.Flags().Int("personalizationImpact", 100, heredoc.Doc(`Impact that Personalization should have on this search.`)) cmd.Flags().SetAnnotation("personalizationImpact", "Categories", []string{"Personalization"}) - cmd.Flags().String("query", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/query/`)) + cmd.Flags().String("query", "", heredoc.Doc(`Search query.`)) cmd.Flags().SetAnnotation("query", "Categories", []string{"Search"}) - cmd.Flags().StringSlice("queryLanguages", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/`)) + 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().SetAnnotation("queryLanguages", "Categories", []string{"Languages"}) - cmd.Flags().String("queryType", "prefixLast", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/queryType/ One of: (prefixLast, prefixAll, prefixNone).`)) + cmd.Flags().String("queryType", "prefixLast", heredoc.Doc(`Determines if and how query words are interpreted as prefixes. One of: prefixLast, prefixAll, prefixNone.`)) cmd.Flags().SetAnnotation("queryType", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("ranking", []string{"typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/ranking/`)) + cmd.Flags().StringSlice("ranking", []string{"typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"}, heredoc.Doc(`Determines the order in which Algolia returns your results.`)) cmd.Flags().SetAnnotation("ranking", "Categories", []string{"Ranking"}) reRankingApplyFilter := NewJSONVar([]string{"array", "string", "null"}...) - cmd.Flags().Var(reRankingApplyFilter, "reRankingApplyFilter", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/reRankingApplyFilter/`)) - cmd.Flags().Int("relevancyStrictness", 100, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/relevancyStrictness/`)) + cmd.Flags().Var(reRankingApplyFilter, "reRankingApplyFilter", heredoc.Doc(`Restrict Dynamic Re-Ranking to records that match these filters.`)) + cmd.Flags().Int("relevancyStrictness", 100, heredoc.Doc(`Relevancy threshold below which less relevant results aren't included in the results.`)) cmd.Flags().SetAnnotation("relevancyStrictness", "Categories", []string{"Ranking"}) removeStopWords := NewJSONVar([]string{"array", "boolean"}...) - cmd.Flags().Var(removeStopWords, "removeStopWords", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/removeStopWords/`)) + cmd.Flags().Var(removeStopWords, "removeStopWords", heredoc.Doc(`Removes stop words from the search query.`)) cmd.Flags().SetAnnotation("removeStopWords", "Categories", []string{"Languages"}) - cmd.Flags().String("removeWordsIfNoResults", "none", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/removeWordsIfNoResults/ One of: (none, lastWords, firstWords, allOptional).`)) + cmd.Flags().String("removeWordsIfNoResults", "none", heredoc.Doc(`Strategy for removing words from the query when it doesn't return any results. One of: none, lastWords, firstWords, allOptional.`)) cmd.Flags().SetAnnotation("removeWordsIfNoResults", "Categories", []string{"Query strategy"}) renderingContent := NewJSONVar([]string{}...) - cmd.Flags().Var(renderingContent, "renderingContent", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/renderingContent/`)) + cmd.Flags().Var(renderingContent, "renderingContent", heredoc.Doc(`Extra data that can be used in the search UI.`)) cmd.Flags().SetAnnotation("renderingContent", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("replaceSynonymsInHighlight", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/replaceSynonymsInHighlight/`)) + cmd.Flags().Bool("replaceSynonymsInHighlight", false, heredoc.Doc(`Whether to replace a highlighted word with the matched synonym.`)) cmd.Flags().SetAnnotation("replaceSynonymsInHighlight", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("responseFields", []string{"*"}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/responseFields/`)) + cmd.Flags().StringSlice("responseFields", []string{"*"}, heredoc.Doc(`Properties to include in the API response of search and browse requests.`)) cmd.Flags().SetAnnotation("responseFields", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("restrictHighlightAndSnippetArrays", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/restrictHighlightAndSnippetArrays/`)) + 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().SetAnnotation("restrictHighlightAndSnippetArrays", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("restrictSearchableAttributes", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/restrictSearchableAttributes/`)) + cmd.Flags().StringSlice("restrictSearchableAttributes", []string{}, heredoc.Doc(`Restricts a search to a subset of your searchable attributes.`)) cmd.Flags().SetAnnotation("restrictSearchableAttributes", "Categories", []string{"Filtering"}) - cmd.Flags().StringSlice("ruleContexts", []string{}, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/ruleContexts/`)) + cmd.Flags().StringSlice("ruleContexts", []string{}, heredoc.Doc(`Assigns a rule context to the search query.`)) cmd.Flags().SetAnnotation("ruleContexts", "Categories", []string{"Rules"}) semanticSearch := NewJSONVar([]string{}...) - cmd.Flags().Var(semanticSearch, "semanticSearch", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/semanticSearch/`)) - cmd.Flags().String("similarQuery", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/similarQuery/`)) + 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().SetAnnotation("similarQuery", "Categories", []string{"Search"}) - cmd.Flags().String("snippetEllipsisText", "…", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisText/`)) + cmd.Flags().String("snippetEllipsisText", "…", heredoc.Doc(`String used as an ellipsis indicator when a snippet is truncated.`)) cmd.Flags().SetAnnotation("snippetEllipsisText", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().String("sortFacetValuesBy", "count", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/`)) + cmd.Flags().String("sortFacetValuesBy", "count", heredoc.Doc(`Order in which to retrieve facet values.`)) cmd.Flags().SetAnnotation("sortFacetValuesBy", "Categories", []string{"Faceting"}) - cmd.Flags().Bool("sumOrFiltersScores", false, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/sumOrFiltersScores/`)) + cmd.Flags().Bool("sumOrFiltersScores", false, heredoc.Doc(`Whether to sum all filter scores.`)) cmd.Flags().SetAnnotation("sumOrFiltersScores", "Categories", []string{"Filtering"}) - cmd.Flags().Bool("synonyms", true, heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/synonyms/`)) + cmd.Flags().Bool("synonyms", true, heredoc.Doc(`Whether to take into account an index's synonyms for this search.`)) cmd.Flags().SetAnnotation("synonyms", "Categories", []string{"Advanced"}) tagFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(tagFilters, "tagFilters", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/`)) + cmd.Flags().Var(tagFilters, "tagFilters", heredoc.Doc(`Filter the search by values of the special _tags attribute.`)) cmd.Flags().SetAnnotation("tagFilters", "Categories", []string{"Filtering"}) typoTolerance := NewJSONVar([]string{"boolean", "string"}...) - cmd.Flags().Var(typoTolerance, "typoTolerance", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/typoTolerance/`)) + cmd.Flags().Var(typoTolerance, "typoTolerance", heredoc.Doc(`Whether typo tolerance is enabled and how it is applied.`)) cmd.Flags().SetAnnotation("typoTolerance", "Categories", []string{"Typos"}) - cmd.Flags().String("userToken", "", heredoc.Doc(`https://www.algolia.com/doc/api-reference/api-parameters/userToken/`)) + cmd.Flags().String("userToken", "", heredoc.Doc(`Unique pseudonymous or anonymous user identifier.`)) cmd.Flags().SetAnnotation("userToken", "Categories", []string{"Personalization"}) } diff --git a/pkg/gen/gen_flags.go b/pkg/gen/gen_flags.go index 5f17f700..4ed2fa43 100644 --- a/pkg/gen/gen_flags.go +++ b/pkg/gen/gen_flags.go @@ -9,6 +9,7 @@ import ( "fmt" "go/format" "io/ioutil" + "regexp" "strings" "text/template" @@ -44,7 +45,12 @@ func main() { // This is the script that generates the `flags.go` file from the // OpenAPI spec file. - specNames := []string{"searchParamsObject", "browseParamsObject", "indexSettings", "deleteByParams"} + specNames := []string{ + "searchParamsObject", + "browseParamsObject", + "indexSettings", + "deleteByParams", + } templateData, err := getTemplateData(specNames) if err != nil { panic(err) @@ -153,7 +159,7 @@ func getFlags(params map[string]*openapi3.Schema) *SpecFlags { // GetGoType returns the Go type for the given OpenAPI 3.0 schema. func GetGoType(param *openapi3.Schema) string { - var SpecTypeGoType = map[string]string{ + SpecTypeGoType := map[string]string{ "string": "string", "integer": "int", "number": "float64", @@ -176,7 +182,10 @@ func getFlag(name string, param *openapi3.Schema) *SpecFlag { var categories []string if param.ExtensionProps.Extensions["x-categories"] != nil { - json.Unmarshal(param.ExtensionProps.Extensions["x-categories"].(json.RawMessage), &categories) + json.Unmarshal( + param.ExtensionProps.Extensions["x-categories"].(json.RawMessage), + &categories, + ) } flag := &SpecFlag{ @@ -197,17 +206,46 @@ func getFlag(name string, param *openapi3.Schema) *SpecFlag { return flag } +// shortDescription returns the first sentence of the parameter description. +func shortDescription(description string) string { + // Handle sentences ending with a colon + s := strings.SplitAfter(description, ":\n") + s[0] = strings.Replace(s[0], ":\n", ".", 1) + + // Handle sentences ending with a period + s = strings.SplitAfter(s[0], ".\n") + + // Replace Markdown links + s[0] = ReplaceLinks(strings.TrimSpace(s[0])) + + return strings.ReplaceAll(s[0], "`", "") +} + +func ReplaceLinks(text string) string { + pattern := "\\[([^\\[\\]]*)\\]\\([^\\(\\)]*\\)" + re := regexp.MustCompile(pattern) + matches := re.FindAllStringSubmatch(text, -1) + + for _, match := range matches { + linkText := match[1] + text = strings.Replace(text, match[0], linkText, 1) + } + + return text +} + // getDescription returns the description for the given parameter. // It's basically the link to the parameter description in the Algolia API documentation, followed by the possible values if the parameter is an enum. func getDescription(name string, param *openapi3.Schema) string { - link := fmt.Sprintf("https://www.algolia.com/doc/api-reference/api-parameters/%s/", name) + description := shortDescription(param.Description) + // link := fmt.Sprintf("https://www.algolia.com/doc/api-reference/api-parameters/%s/", name) if param.Enum != nil { choices := make([]string, len(param.Enum)) for i, e := range param.Enum { choices[i] = e.(string) } - return fmt.Sprintf("%s One of: (%v).", link, strings.Join(choices, ", ")) + return fmt.Sprintf("%s One of: %v.", description, strings.Join(choices, ", ")) } - return link + return description } From 3ccbe74711aac2173b906323cfac0e0611c3f276 Mon Sep 17 00:00:00 2001 From: Kai Welke Date: Thu, 25 Apr 2024 11:59:14 +0200 Subject: [PATCH 2/5] Apply suggestions from code review --- pkg/gen/gen_flags.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/gen/gen_flags.go b/pkg/gen/gen_flags.go index 4ed2fa43..c690e2fd 100644 --- a/pkg/gen/gen_flags.go +++ b/pkg/gen/gen_flags.go @@ -222,8 +222,7 @@ func shortDescription(description string) string { } func ReplaceLinks(text string) string { - pattern := "\\[([^\\[\\]]*)\\]\\([^\\(\\)]*\\)" - re := regexp.MustCompile(pattern) + re := regexp.MustCompile("\\[([^\\[\\]]*)\\]\\([^\\(\\)]*\\)") matches := re.FindAllStringSubmatch(text, -1) for _, match := range matches { @@ -238,7 +237,6 @@ func ReplaceLinks(text string) string { // It's basically the link to the parameter description in the Algolia API documentation, followed by the possible values if the parameter is an enum. func getDescription(name string, param *openapi3.Schema) string { description := shortDescription(param.Description) - // link := fmt.Sprintf("https://www.algolia.com/doc/api-reference/api-parameters/%s/", name) if param.Enum != nil { choices := make([]string, len(param.Enum)) From af9bf964e18a89967a56a14de71f183499dd4972 Mon Sep 17 00:00:00 2001 From: Kai Welke Date: Thu, 25 Apr 2024 12:53:58 +0200 Subject: [PATCH 3/5] fix: simplify --- pkg/gen/gen_flags.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pkg/gen/gen_flags.go b/pkg/gen/gen_flags.go index c690e2fd..a4db17ec 100644 --- a/pkg/gen/gen_flags.go +++ b/pkg/gen/gen_flags.go @@ -209,16 +209,19 @@ func getFlag(name string, param *openapi3.Schema) *SpecFlag { // shortDescription returns the first sentence of the parameter description. func shortDescription(description string) string { // Handle sentences ending with a colon - s := strings.SplitAfter(description, ":\n") - s[0] = strings.Replace(s[0], ":\n", ".", 1) - + s := strings.Split(description, ":\n") // Handle sentences ending with a period - s = strings.SplitAfter(s[0], ".\n") + s = strings.Split(s[0], ".\n") // Replace Markdown links - s[0] = ReplaceLinks(strings.TrimSpace(s[0])) - - return strings.ReplaceAll(s[0], "`", "") + s[0] = ReplaceLinks(s[0]) + // Remove backticks + s[0] = strings.ReplaceAll(s[0], "`", "") + // End with period + if !strings.HasSuffix(s[0], ".") { + s[0] += "." + } + return strings.TrimSpace(s[0]) } func ReplaceLinks(text string) string { From 310948164092f57c716b864acda6e1d3616bbfea Mon Sep 17 00:00:00 2001 From: Kai Welke Date: Thu, 25 Apr 2024 12:57:11 +0200 Subject: [PATCH 4/5] fix: comments --- pkg/gen/gen_flags.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pkg/gen/gen_flags.go b/pkg/gen/gen_flags.go index a4db17ec..20ed7993 100644 --- a/pkg/gen/gen_flags.go +++ b/pkg/gen/gen_flags.go @@ -212,19 +212,17 @@ func shortDescription(description string) string { s := strings.Split(description, ":\n") // Handle sentences ending with a period s = strings.Split(s[0], ".\n") - - // Replace Markdown links - s[0] = ReplaceLinks(s[0]) - // Remove backticks + s[0] = replaceMarkdownLinks(s[0]) s[0] = strings.ReplaceAll(s[0], "`", "") - // End with period + if !strings.HasSuffix(s[0], ".") { s[0] += "." } + return strings.TrimSpace(s[0]) } -func ReplaceLinks(text string) string { +func replaceMarkdownLinks(text string) string { re := regexp.MustCompile("\\[([^\\[\\]]*)\\]\\([^\\(\\)]*\\)") matches := re.FindAllStringSubmatch(text, -1) @@ -236,8 +234,8 @@ func ReplaceLinks(text string) string { return text } -// getDescription returns the description for the given parameter. -// It's basically the link to the parameter description in the Algolia API documentation, followed by the possible values if the parameter is an enum. +// getDescription returns the short description for the given parameter. +// It's the first sentence of the parameter description followed by possible values if it's an enum. func getDescription(name string, param *openapi3.Schema) string { description := shortDescription(param.Description) From 12ab203b3b4c1cf10d3589e045e1b4a73cef00e2 Mon Sep 17 00:00:00 2001 From: Kai Welke Date: Fri, 26 Apr 2024 11:17:19 +0200 Subject: [PATCH 5/5] fix: add back links --- pkg/cmdutil/spec_flags.go | 627 +++++++++++++++++++++++++------------- pkg/gen/gen_flags.go | 18 +- 2 files changed, 434 insertions(+), 211 deletions(-) diff --git a/pkg/cmdutil/spec_flags.go b/pkg/cmdutil/spec_flags.go index 54ea27a2..d99db963 100644 --- a/pkg/cmdutil/spec_flags.go +++ b/pkg/cmdutil/spec_flags.go @@ -242,482 +242,691 @@ var SearchParamsObject = []string{ } func AddBrowseParamsObjectFlags(cmd *cobra.Command) { - cmd.Flags().Bool("advancedSyntax", false, heredoc.Doc(`Whether to support phrase matching and excluding words from search queries.`)) + cmd.Flags().Bool("advancedSyntax", false, heredoc.Doc(`Whether to support phrase matching and excluding words from search queries. +See: https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntax/`)) cmd.Flags().SetAnnotation("advancedSyntax", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("advancedSyntaxFeatures", []string{"exactPhrase", "excludeWords"}, heredoc.Doc(`Advanced search syntax features you want to support.`)) + cmd.Flags().StringSlice("advancedSyntaxFeatures", []string{"exactPhrase", "excludeWords"}, heredoc.Doc(`Advanced search syntax features you want to support. +See: https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntaxFeatures/`)) cmd.Flags().SetAnnotation("advancedSyntaxFeatures", "Categories", []string{"Query strategy"}) - cmd.Flags().Bool("allowTyposOnNumericTokens", true, heredoc.Doc(`Whether to allow typos on numbers in the search query.`)) + 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(`Alternatives of query words that should be considered as exact matches by the Exact ranking criterion. +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 this search will be included in 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(`Tags to apply to the query for segmenting analytics data. +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. +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 obtain the coordinates from the request'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(`Precision of a coordinate-based search in meters to group results with similar distances. +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.`)) + 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. +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.`)) + cmd.Flags().StringSlice("attributesToHighlight", []string{}, heredoc.Doc(`Attributes to highlight. +See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/`)) cmd.Flags().SetAnnotation("attributesToHighlight", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("attributesToRetrieve", []string{"*"}, heredoc.Doc(`Attributes to include in the API response.`)) + cmd.Flags().StringSlice("attributesToRetrieve", []string{"*"}, heredoc.Doc(`Attributes to include in the API response. +See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToRetrieve/`)) cmd.Flags().SetAnnotation("attributesToRetrieve", "Categories", []string{"Attributes"}) - cmd.Flags().StringSlice("attributesToSnippet", []string{}, heredoc.Doc(`Attributes for which to enable snippets.`)) + cmd.Flags().StringSlice("attributesToSnippet", []string{}, heredoc.Doc(`Attributes for which to enable snippets. +See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/`)) cmd.Flags().SetAnnotation("attributesToSnippet", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().Bool("clickAnalytics", false, heredoc.Doc(`Whether to include a queryID attribute in the response.`)) + 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().StringSlice("customRanking", []string{}, heredoc.Doc(`Attributes to use as custom ranking.`)) + 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"}) - cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`Whether to split compound words into their building blocks.`)) + cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`Whether to split compound words into their building blocks. +See: https://www.algolia.com/doc/api-reference/api-parameters/decompoundQuery/`)) cmd.Flags().SetAnnotation("decompoundQuery", "Categories", []string{"Languages"}) - cmd.Flags().StringSlice("disableExactOnAttributes", []string{}, heredoc.Doc(`Searchable attributes for which you want to turn off the Exact ranking criterion.`)) + cmd.Flags().StringSlice("disableExactOnAttributes", []string{}, heredoc.Doc(`Searchable attributes for which you want to turn off the Exact ranking criterion. +See: https://www.algolia.com/doc/api-reference/api-parameters/disableExactOnAttributes/`)) cmd.Flags().SetAnnotation("disableExactOnAttributes", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("disableTypoToleranceOnAttributes", []string{}, heredoc.Doc(`Attributes for which you want to turn off typo tolerance.`)) + cmd.Flags().StringSlice("disableTypoToleranceOnAttributes", []string{}, heredoc.Doc(`Attributes for which you want to turn off typo tolerance. +See: https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnAttributes/`)) cmd.Flags().SetAnnotation("disableTypoToleranceOnAttributes", "Categories", []string{"Typos"}) distinct := NewJSONVar([]string{"boolean", "integer"}...) - cmd.Flags().Var(distinct, "distinct", heredoc.Doc(`Determines how many records of a group are included in the search results.`)) + 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 enable A/B testing for this search. +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.`)) + cmd.Flags().Bool("enablePersonalization", false, heredoc.Doc(`Whether to enable Personalization. +See: https://www.algolia.com/doc/api-reference/api-parameters/enablePersonalization/`)) cmd.Flags().SetAnnotation("enablePersonalization", "Categories", []string{"Personalization"}) - cmd.Flags().Bool("enableReRanking", true, heredoc.Doc(`Whether this search will use Dynamic Re-Ranking.`)) + cmd.Flags().Bool("enableReRanking", true, heredoc.Doc(`Whether this search will use Dynamic Re-Ranking. +See: https://www.algolia.com/doc/api-reference/api-parameters/enableReRanking/`)) cmd.Flags().SetAnnotation("enableReRanking", "Categories", []string{"Filtering"}) - cmd.Flags().Bool("enableRules", true, heredoc.Doc(`Whether to enable rules.`)) + cmd.Flags().Bool("enableRules", true, heredoc.Doc(`Whether to enable rules. +See: https://www.algolia.com/doc/api-reference/api-parameters/enableRules/`)) cmd.Flags().SetAnnotation("enableRules", "Categories", []string{"Rules"}) - cmd.Flags().String("exactOnSingleWordQuery", "attribute", heredoc.Doc(`Determines how the Exact ranking criterion is computed when the search query has only one word. One of: attribute, none, word.`)) + cmd.Flags().String("exactOnSingleWordQuery", "attribute", heredoc.Doc(`Determines how the Exact ranking criterion is computed when the search query has only one word. One of: attribute, none, word. +See: https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/`)) cmd.Flags().SetAnnotation("exactOnSingleWordQuery", "Categories", []string{"Query strategy"}) facetFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(facetFilters, "facetFilters", heredoc.Doc(`Filter the search by facet values, so that only records with the same facet values are retrieved.`)) + 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 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(`Facets for which to retrieve facet values that match the search criteria and the number of matching 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(`Filter expression to only include items that match the filter criteria in the response. +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.`)) + cmd.Flags().Bool("getRankingInfo", false, heredoc.Doc(`Whether the search response should include detailed ranking information. +See: https://www.algolia.com/doc/api-reference/api-parameters/getRankingInfo/`)) cmd.Flags().SetAnnotation("getRankingInfo", "Categories", []string{"Advanced"}) - cmd.Flags().String("highlightPostTag", "", heredoc.Doc(`HTML tag to insert after the highlighted parts in all highlighted results and snippets.`)) + cmd.Flags().String("highlightPostTag", "", heredoc.Doc(`HTML tag to insert after the highlighted parts in all highlighted results and snippets. +See: https://www.algolia.com/doc/api-reference/api-parameters/highlightPostTag/`)) cmd.Flags().SetAnnotation("highlightPostTag", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().String("highlightPreTag", "", heredoc.Doc(`HTML tag to insert before the highlighted parts in all highlighted results and snippets.`)) + cmd.Flags().String("highlightPreTag", "", heredoc.Doc(`HTML tag to insert before the highlighted parts in all highlighted results and snippets. +See: https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/`)) cmd.Flags().SetAnnotation("highlightPreTag", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().Int("hitsPerPage", 20, heredoc.Doc(`Number of hits per page.`)) + cmd.Flags().Int("hitsPerPage", 20, heredoc.Doc(`Number of hits per page. +See: https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/`)) cmd.Flags().SetAnnotation("hitsPerPage", "Categories", []string{"Pagination"}) ignorePlurals := NewJSONVar([]string{"array", "boolean"}...) - cmd.Flags().Var(ignorePlurals, "ignorePlurals", heredoc.Doc(`Treat singular, plurals, and other forms of declensions as equivalent.`)) + 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().SetAnnotation("insideBoundingBox", "Categories", []string{"Geo-Search"}) cmd.Flags().SetAnnotation("insidePolygon", "Categories", []string{"Geo-Search"}) - cmd.Flags().String("keepDiacriticsOnCharacters", "", heredoc.Doc(`Characters for which diacritics should be preserved.`)) + 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(`Number of hits to retrieve (used in combination with offset). +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.`)) + cmd.Flags().Int("maxFacetHits", 10, heredoc.Doc(`Maximum number of facet values to return when searching for facet values. +See: https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits/`)) cmd.Flags().SetAnnotation("maxFacetHits", "Categories", []string{"Advanced"}) - cmd.Flags().Int("maxValuesPerFacet", 100, heredoc.Doc(`Maximum number of facet values to return for each facet.`)) + cmd.Flags().Int("maxValuesPerFacet", 100, heredoc.Doc(`Maximum number of facet values to return for each facet. +See: https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/`)) cmd.Flags().SetAnnotation("maxValuesPerFacet", "Categories", []string{"Faceting"}) - cmd.Flags().Int("minProximity", 1, heredoc.Doc(`Minimum proximity score for two matching words.`)) + cmd.Flags().Int("minProximity", 1, heredoc.Doc(`Minimum proximity score for two matching words. +See: https://www.algolia.com/doc/api-reference/api-parameters/minProximity/`)) cmd.Flags().SetAnnotation("minProximity", "Categories", []string{"Advanced"}) - cmd.Flags().Int("minWordSizefor1Typo", 4, heredoc.Doc(`Minimum number of characters a word in the search query must contain to accept matches with one typo.`)) + cmd.Flags().Int("minWordSizefor1Typo", 4, heredoc.Doc(`Minimum number of characters a word in the search query must contain to accept matches with one typo. +See: https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typo/`)) cmd.Flags().SetAnnotation("minWordSizefor1Typo", "Categories", []string{"Typos"}) - 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.`)) + 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(`Minimum radius (in meters) for a search around a location when aroundRadius isn't set. +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.`)) + 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(`ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches). +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.`)) + 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(`Position of the first hit to retrieve. +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(`Filters to promote or demote records in the search results. +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(`Words that should be considered optional when found in the query. +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(`Page of search results to retrieve. +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 search when calculating processing-time percentiles. +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(`Impact that Personalization should have on this search. +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(`Search query. +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(`Languages for 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.`)) + cmd.Flags().String("queryType", "prefixLast", heredoc.Doc(`Determines if and how query words are interpreted as prefixes. One of: prefixLast, prefixAll, prefixNone. +See: https://www.algolia.com/doc/api-reference/api-parameters/queryType/`)) cmd.Flags().SetAnnotation("queryType", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("ranking", []string{"typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"}, heredoc.Doc(`Determines the order in which Algolia returns your results.`)) + cmd.Flags().StringSlice("ranking", []string{"typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"}, heredoc.Doc(`Determines the order in which Algolia returns your results. +See: https://www.algolia.com/doc/api-reference/api-parameters/ranking/`)) cmd.Flags().SetAnnotation("ranking", "Categories", []string{"Ranking"}) reRankingApplyFilter := NewJSONVar([]string{"array", "string", "null"}...) cmd.Flags().Var(reRankingApplyFilter, "reRankingApplyFilter", heredoc.Doc(`Restrict Dynamic Re-Ranking to records that match these filters.`)) - cmd.Flags().Int("relevancyStrictness", 100, heredoc.Doc(`Relevancy threshold below which less relevant results aren't included in the results.`)) + cmd.Flags().Int("relevancyStrictness", 100, heredoc.Doc(`Relevancy threshold below which less relevant results aren't included in the results. +See: https://www.algolia.com/doc/api-reference/api-parameters/relevancyStrictness/`)) cmd.Flags().SetAnnotation("relevancyStrictness", "Categories", []string{"Ranking"}) removeStopWords := NewJSONVar([]string{"array", "boolean"}...) - cmd.Flags().Var(removeStopWords, "removeStopWords", heredoc.Doc(`Removes stop words from the search query.`)) + cmd.Flags().Var(removeStopWords, "removeStopWords", heredoc.Doc(`Removes stop words from the search query. +See: https://www.algolia.com/doc/api-reference/api-parameters/removeStopWords/`)) cmd.Flags().SetAnnotation("removeStopWords", "Categories", []string{"Languages"}) - cmd.Flags().String("removeWordsIfNoResults", "none", heredoc.Doc(`Strategy for removing words from the query when it doesn't return any results. One of: none, lastWords, firstWords, allOptional.`)) + cmd.Flags().String("removeWordsIfNoResults", "none", heredoc.Doc(`Strategy for removing words from the query when it doesn't return any results. One of: none, lastWords, firstWords, allOptional. +See: https://www.algolia.com/doc/api-reference/api-parameters/removeWordsIfNoResults/`)) cmd.Flags().SetAnnotation("removeWordsIfNoResults", "Categories", []string{"Query strategy"}) renderingContent := NewJSONVar([]string{}...) - cmd.Flags().Var(renderingContent, "renderingContent", heredoc.Doc(`Extra data that can be used in the search UI.`)) + cmd.Flags().Var(renderingContent, "renderingContent", heredoc.Doc(`Extra data that can be used in the search UI. +See: https://www.algolia.com/doc/api-reference/api-parameters/renderingContent/`)) cmd.Flags().SetAnnotation("renderingContent", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("replaceSynonymsInHighlight", false, heredoc.Doc(`Whether to replace a highlighted word with the matched synonym.`)) + 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 the API response of search and browse requests. +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 at least partially 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(`Restricts a search to a subset of your 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.`)) + cmd.Flags().StringSlice("ruleContexts", []string{}, heredoc.Doc(`Assigns a rule context to the search query. +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(`Keywords to be used instead of the search query to conduct a more broader search. +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.`)) + cmd.Flags().String("snippetEllipsisText", "…", heredoc.Doc(`String used as an ellipsis indicator when a snippet is truncated. +See: https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisText/`)) cmd.Flags().SetAnnotation("snippetEllipsisText", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().String("sortFacetValuesBy", "count", heredoc.Doc(`Order in which to retrieve facet values.`)) + 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(`Whether to sum all filter scores. +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 take into account 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"}...) - cmd.Flags().Var(tagFilters, "tagFilters", heredoc.Doc(`Filter the search by values of the special _tags attribute.`)) + cmd.Flags().Var(tagFilters, "tagFilters", heredoc.Doc(`Filter the search by values of the special _tags attribute. +See: https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/`)) cmd.Flags().SetAnnotation("tagFilters", "Categories", []string{"Filtering"}) typoTolerance := NewJSONVar([]string{"boolean", "string"}...) - cmd.Flags().Var(typoTolerance, "typoTolerance", heredoc.Doc(`Whether typo tolerance is enabled and how it is applied.`)) + 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(`Unique pseudonymous or anonymous user 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. +See: https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLng/`)) cmd.Flags().SetAnnotation("aroundLatLng", "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.`)) + 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"}) facetFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(facetFilters, "facetFilters", heredoc.Doc(`Filter the search by facet values, so that only records with the same facet values are retrieved.`)) + 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(`Filter expression to only include items that match the filter criteria in the response. +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"}) cmd.Flags().SetAnnotation("insidePolygon", "Categories", []string{"Geo-Search"}) numericFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(numericFilters, "numericFilters", heredoc.Doc(`Filter by numeric facets.`)) + 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"}) tagFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(tagFilters, "tagFilters", heredoc.Doc(`Filter the search by values of the special _tags attribute.`)) + cmd.Flags().Var(tagFilters, "tagFilters", heredoc.Doc(`Filter the search by values of the special _tags attribute. +See: https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/`)) cmd.Flags().SetAnnotation("tagFilters", "Categories", []string{"Filtering"}) } func AddIndexSettingsFlags(cmd *cobra.Command) { - cmd.Flags().Bool("advancedSyntax", false, heredoc.Doc(`Whether to support phrase matching and excluding words from search queries.`)) + cmd.Flags().Bool("advancedSyntax", false, heredoc.Doc(`Whether to support phrase matching and excluding words from search queries. +See: https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntax/`)) cmd.Flags().SetAnnotation("advancedSyntax", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("advancedSyntaxFeatures", []string{"exactPhrase", "excludeWords"}, heredoc.Doc(`Advanced search syntax features you want to support.`)) + cmd.Flags().StringSlice("advancedSyntaxFeatures", []string{"exactPhrase", "excludeWords"}, heredoc.Doc(`Advanced search syntax features you want to support. +See: https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntaxFeatures/`)) cmd.Flags().SetAnnotation("advancedSyntaxFeatures", "Categories", []string{"Query strategy"}) - cmd.Flags().Bool("allowCompressionOfIntegerArray", false, heredoc.Doc(`Whether arrays with exclusively non-negative integers should be compressed for better performance.`)) + cmd.Flags().Bool("allowCompressionOfIntegerArray", false, heredoc.Doc(`Whether arrays with exclusively non-negative integers should be compressed for better performance. +See: https://www.algolia.com/doc/api-reference/api-parameters/allowCompressionOfIntegerArray/`)) cmd.Flags().SetAnnotation("allowCompressionOfIntegerArray", "Categories", []string{"Performance"}) - cmd.Flags().Bool("allowTyposOnNumericTokens", true, heredoc.Doc(`Whether to allow typos on numbers in the search query.`)) + 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(`Alternatives of query words that should be considered as exact matches by the Exact ranking criterion. +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. +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.`)) - cmd.Flags().StringSlice("attributesForFaceting", []string{}, heredoc.Doc(`Attributes used for faceting.`)) + cmd.Flags().String("attributeForDistinct", "", heredoc.Doc(`Attribute that should be used to establish groups of results. +See: https://www.algolia.com/doc/api-reference/api-parameters/attributeForDistinct/`)) + cmd.Flags().StringSlice("attributesForFaceting", []string{}, heredoc.Doc(`Attributes used for faceting. +See: https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/`)) cmd.Flags().SetAnnotation("attributesForFaceting", "Categories", []string{"Faceting"}) - cmd.Flags().StringSlice("attributesToHighlight", []string{}, heredoc.Doc(`Attributes to highlight.`)) + cmd.Flags().StringSlice("attributesToHighlight", []string{}, heredoc.Doc(`Attributes to highlight. +See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/`)) cmd.Flags().SetAnnotation("attributesToHighlight", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("attributesToRetrieve", []string{"*"}, heredoc.Doc(`Attributes to include in the API response.`)) + cmd.Flags().StringSlice("attributesToRetrieve", []string{"*"}, heredoc.Doc(`Attributes to include in the API response. +See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToRetrieve/`)) cmd.Flags().SetAnnotation("attributesToRetrieve", "Categories", []string{"Attributes"}) - cmd.Flags().StringSlice("attributesToSnippet", []string{}, heredoc.Doc(`Attributes for which to enable snippets.`)) + cmd.Flags().StringSlice("attributesToSnippet", []string{}, heredoc.Doc(`Attributes for which to enable snippets. +See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/`)) cmd.Flags().SetAnnotation("attributesToSnippet", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("attributesToTransliterate", []string{}, heredoc.Doc(`Attributes, for which you want to support Japanese transliteration.`)) + cmd.Flags().StringSlice("attributesToTransliterate", []string{}, heredoc.Doc(`Attributes, for which you want to support Japanese transliteration. +See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToTransliterate/`)) cmd.Flags().SetAnnotation("attributesToTransliterate", "Categories", []string{"Languages"}) - cmd.Flags().StringSlice("camelCaseAttributes", []string{}, heredoc.Doc(`Attributes for which to split camel case words.`)) + cmd.Flags().StringSlice("camelCaseAttributes", []string{}, heredoc.Doc(`Attributes for which to split camel case words. +See: https://www.algolia.com/doc/api-reference/api-parameters/camelCaseAttributes/`)) cmd.Flags().SetAnnotation("camelCaseAttributes", "Categories", []string{"Languages"}) customNormalization := NewJSONVar([]string{}...) - cmd.Flags().Var(customNormalization, "customNormalization", heredoc.Doc(`Characters and their normalized replacements.`)) + cmd.Flags().Var(customNormalization, "customNormalization", heredoc.Doc(`Characters and their normalized replacements. +See: https://www.algolia.com/doc/api-reference/api-parameters/customNormalization/`)) cmd.Flags().SetAnnotation("customNormalization", "Categories", []string{"Languages"}) - cmd.Flags().StringSlice("customRanking", []string{}, heredoc.Doc(`Attributes to use as custom ranking.`)) + 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"}) - cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`Whether to split compound words into their building blocks.`)) + cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`Whether to split compound words into their building blocks. +See: https://www.algolia.com/doc/api-reference/api-parameters/decompoundQuery/`)) cmd.Flags().SetAnnotation("decompoundQuery", "Categories", []string{"Languages"}) decompoundedAttributes := NewJSONVar([]string{}...) - cmd.Flags().Var(decompoundedAttributes, "decompoundedAttributes", heredoc.Doc(`Searchable attributes to which Algolia should apply word segmentation (decompounding).`)) + cmd.Flags().Var(decompoundedAttributes, "decompoundedAttributes", heredoc.Doc(`Searchable attributes to which Algolia should apply word segmentation (decompounding). +See: https://www.algolia.com/doc/api-reference/api-parameters/decompoundedAttributes/`)) cmd.Flags().SetAnnotation("decompoundedAttributes", "Categories", []string{"Languages"}) - cmd.Flags().StringSlice("disableExactOnAttributes", []string{}, heredoc.Doc(`Searchable attributes for which you want to turn off the Exact ranking criterion.`)) + cmd.Flags().StringSlice("disableExactOnAttributes", []string{}, heredoc.Doc(`Searchable attributes for which you want to turn off the Exact ranking criterion. +See: https://www.algolia.com/doc/api-reference/api-parameters/disableExactOnAttributes/`)) cmd.Flags().SetAnnotation("disableExactOnAttributes", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("disablePrefixOnAttributes", []string{}, heredoc.Doc(`Searchable attributes for which you want to turn off prefix matching.`)) + cmd.Flags().StringSlice("disablePrefixOnAttributes", []string{}, heredoc.Doc(`Searchable attributes for which you want to turn off prefix matching. +See: https://www.algolia.com/doc/api-reference/api-parameters/disablePrefixOnAttributes/`)) cmd.Flags().SetAnnotation("disablePrefixOnAttributes", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("disableTypoToleranceOnAttributes", []string{}, heredoc.Doc(`Attributes for which you want to turn off typo tolerance.`)) + cmd.Flags().StringSlice("disableTypoToleranceOnAttributes", []string{}, heredoc.Doc(`Attributes for which you want to turn off typo tolerance. +See: https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnAttributes/`)) cmd.Flags().SetAnnotation("disableTypoToleranceOnAttributes", "Categories", []string{"Typos"}) - cmd.Flags().StringSlice("disableTypoToleranceOnWords", []string{}, heredoc.Doc(`Words for which you want to turn off typo tolerance.`)) + cmd.Flags().StringSlice("disableTypoToleranceOnWords", []string{}, heredoc.Doc(`Words for which you want to turn off typo tolerance. +See: https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnWords/`)) cmd.Flags().SetAnnotation("disableTypoToleranceOnWords", "Categories", []string{"Typos"}) distinct := NewJSONVar([]string{"boolean", "integer"}...) - cmd.Flags().Var(distinct, "distinct", heredoc.Doc(`Determines how many records of a group are included in the search results.`)) + 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("enablePersonalization", false, heredoc.Doc(`Whether to enable Personalization.`)) + cmd.Flags().Bool("enablePersonalization", false, heredoc.Doc(`Whether to enable Personalization. +See: https://www.algolia.com/doc/api-reference/api-parameters/enablePersonalization/`)) cmd.Flags().SetAnnotation("enablePersonalization", "Categories", []string{"Personalization"}) - cmd.Flags().Bool("enableReRanking", true, heredoc.Doc(`Whether this search will use Dynamic Re-Ranking.`)) + cmd.Flags().Bool("enableReRanking", true, heredoc.Doc(`Whether this search will use Dynamic Re-Ranking. +See: https://www.algolia.com/doc/api-reference/api-parameters/enableReRanking/`)) cmd.Flags().SetAnnotation("enableReRanking", "Categories", []string{"Filtering"}) - cmd.Flags().Bool("enableRules", true, heredoc.Doc(`Whether to enable rules.`)) + cmd.Flags().Bool("enableRules", true, heredoc.Doc(`Whether to enable rules. +See: https://www.algolia.com/doc/api-reference/api-parameters/enableRules/`)) cmd.Flags().SetAnnotation("enableRules", "Categories", []string{"Rules"}) - cmd.Flags().String("exactOnSingleWordQuery", "attribute", heredoc.Doc(`Determines how the Exact ranking criterion is computed when the search query has only one word. One of: attribute, none, word.`)) + cmd.Flags().String("exactOnSingleWordQuery", "attribute", heredoc.Doc(`Determines how the Exact ranking criterion is computed when the search query has only one word. One of: attribute, none, word. +See: https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/`)) cmd.Flags().SetAnnotation("exactOnSingleWordQuery", "Categories", []string{"Query strategy"}) - cmd.Flags().String("highlightPostTag", "", heredoc.Doc(`HTML tag to insert after the highlighted parts in all highlighted results and snippets.`)) + cmd.Flags().String("highlightPostTag", "", heredoc.Doc(`HTML tag to insert after the highlighted parts in all highlighted results and snippets. +See: https://www.algolia.com/doc/api-reference/api-parameters/highlightPostTag/`)) cmd.Flags().SetAnnotation("highlightPostTag", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().String("highlightPreTag", "", heredoc.Doc(`HTML tag to insert before the highlighted parts in all highlighted results and snippets.`)) + cmd.Flags().String("highlightPreTag", "", heredoc.Doc(`HTML tag to insert before the highlighted parts in all highlighted results and snippets. +See: https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/`)) cmd.Flags().SetAnnotation("highlightPreTag", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().Int("hitsPerPage", 20, heredoc.Doc(`Number of hits per page.`)) + cmd.Flags().Int("hitsPerPage", 20, heredoc.Doc(`Number of hits per page. +See: https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/`)) cmd.Flags().SetAnnotation("hitsPerPage", "Categories", []string{"Pagination"}) ignorePlurals := NewJSONVar([]string{"array", "boolean"}...) - cmd.Flags().Var(ignorePlurals, "ignorePlurals", heredoc.Doc(`Treat singular, plurals, and other forms of declensions as equivalent.`)) + 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(`Languages for language-specific processing steps, such as word detection and dictionary settings. +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.`)) + 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("maxFacetHits", 10, heredoc.Doc(`Maximum number of facet values to return when searching for facet values.`)) + cmd.Flags().Int("maxFacetHits", 10, heredoc.Doc(`Maximum number of facet values to return when searching for facet values. +See: https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits/`)) cmd.Flags().SetAnnotation("maxFacetHits", "Categories", []string{"Advanced"}) - cmd.Flags().Int("maxValuesPerFacet", 100, heredoc.Doc(`Maximum number of facet values to return for each facet.`)) + cmd.Flags().Int("maxValuesPerFacet", 100, heredoc.Doc(`Maximum number of facet values to return for each facet. +See: https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/`)) cmd.Flags().SetAnnotation("maxValuesPerFacet", "Categories", []string{"Faceting"}) - cmd.Flags().Int("minProximity", 1, heredoc.Doc(`Minimum proximity score for two matching words.`)) + cmd.Flags().Int("minProximity", 1, heredoc.Doc(`Minimum proximity score for two matching words. +See: https://www.algolia.com/doc/api-reference/api-parameters/minProximity/`)) cmd.Flags().SetAnnotation("minProximity", "Categories", []string{"Advanced"}) - cmd.Flags().Int("minWordSizefor1Typo", 4, heredoc.Doc(`Minimum number of characters a word in the search query must contain to accept matches with one typo.`)) + cmd.Flags().Int("minWordSizefor1Typo", 4, heredoc.Doc(`Minimum number of characters a word in the search query must contain to accept matches with one typo. +See: https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typo/`)) cmd.Flags().SetAnnotation("minWordSizefor1Typo", "Categories", []string{"Typos"}) - 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.`)) + 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().String("mode", "keywordSearch", heredoc.Doc(`Search mode the index will use to query for results. One of: neuralSearch, keywordSearch.`)) + 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("numericAttributesForFiltering", []string{}, heredoc.Doc(`Numeric attributes that can be used as numerical filters.`)) + 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(`Words that should be considered optional when found in the query. +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.`)) - 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().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. +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.`)) + cmd.Flags().String("queryType", "prefixLast", heredoc.Doc(`Determines if and how query words are interpreted as prefixes. One of: prefixLast, prefixAll, prefixNone. +See: https://www.algolia.com/doc/api-reference/api-parameters/queryType/`)) cmd.Flags().SetAnnotation("queryType", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("ranking", []string{"typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"}, heredoc.Doc(`Determines the order in which Algolia returns your results.`)) + cmd.Flags().StringSlice("ranking", []string{"typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"}, heredoc.Doc(`Determines the order in which Algolia returns your results. +See: https://www.algolia.com/doc/api-reference/api-parameters/ranking/`)) cmd.Flags().SetAnnotation("ranking", "Categories", []string{"Ranking"}) reRankingApplyFilter := NewJSONVar([]string{"array", "string", "null"}...) cmd.Flags().Var(reRankingApplyFilter, "reRankingApplyFilter", heredoc.Doc(`Restrict Dynamic Re-Ranking to records that match these filters.`)) - cmd.Flags().Int("relevancyStrictness", 100, heredoc.Doc(`Relevancy threshold below which less relevant results aren't included in the results.`)) + cmd.Flags().Int("relevancyStrictness", 100, heredoc.Doc(`Relevancy threshold below which less relevant results aren't included in the results. +See: https://www.algolia.com/doc/api-reference/api-parameters/relevancyStrictness/`)) cmd.Flags().SetAnnotation("relevancyStrictness", "Categories", []string{"Ranking"}) removeStopWords := NewJSONVar([]string{"array", "boolean"}...) - cmd.Flags().Var(removeStopWords, "removeStopWords", heredoc.Doc(`Removes stop words from the search query.`)) + cmd.Flags().Var(removeStopWords, "removeStopWords", heredoc.Doc(`Removes stop words from the search query. +See: https://www.algolia.com/doc/api-reference/api-parameters/removeStopWords/`)) cmd.Flags().SetAnnotation("removeStopWords", "Categories", []string{"Languages"}) - cmd.Flags().String("removeWordsIfNoResults", "none", heredoc.Doc(`Strategy for removing words from the query when it doesn't return any results. One of: none, lastWords, firstWords, allOptional.`)) + cmd.Flags().String("removeWordsIfNoResults", "none", heredoc.Doc(`Strategy for removing words from the query when it doesn't return any results. One of: none, lastWords, firstWords, allOptional. +See: https://www.algolia.com/doc/api-reference/api-parameters/removeWordsIfNoResults/`)) cmd.Flags().SetAnnotation("removeWordsIfNoResults", "Categories", []string{"Query strategy"}) renderingContent := NewJSONVar([]string{}...) - cmd.Flags().Var(renderingContent, "renderingContent", heredoc.Doc(`Extra data that can be used in the search UI.`)) + cmd.Flags().Var(renderingContent, "renderingContent", heredoc.Doc(`Extra data that can be used in the search UI. +See: https://www.algolia.com/doc/api-reference/api-parameters/renderingContent/`)) cmd.Flags().SetAnnotation("renderingContent", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("replaceSynonymsInHighlight", false, heredoc.Doc(`Whether to replace a highlighted word with the matched synonym.`)) + 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("replicas", []string{}, heredoc.Doc(`Creates replica indices.`)) + 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 the API response of search and browse requests. +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 at least partially 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.`)) + cmd.Flags().StringSlice("searchableAttributes", []string{}, heredoc.Doc(`Attributes used for searching. Attribute names are case-sensitive. +See: https://www.algolia.com/doc/api-reference/api-parameters/searchableAttributes/`)) cmd.Flags().SetAnnotation("searchableAttributes", "Categories", []string{"Attributes"}) semanticSearch := NewJSONVar([]string{}...) cmd.Flags().Var(semanticSearch, "semanticSearch", heredoc.Doc(`Settings for the semantic search part of NeuralSearch.`)) - cmd.Flags().String("separatorsToIndex", "", heredoc.Doc(`Controls which separators are indexed.`)) + cmd.Flags().String("separatorsToIndex", "", heredoc.Doc(`Controls which separators are indexed. +See: https://www.algolia.com/doc/api-reference/api-parameters/separatorsToIndex/`)) cmd.Flags().SetAnnotation("separatorsToIndex", "Categories", []string{"Typos"}) - cmd.Flags().String("snippetEllipsisText", "…", heredoc.Doc(`String used as an ellipsis indicator when a snippet is truncated.`)) + cmd.Flags().String("snippetEllipsisText", "…", heredoc.Doc(`String used as an ellipsis indicator when a snippet is truncated. +See: https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisText/`)) cmd.Flags().SetAnnotation("snippetEllipsisText", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().String("sortFacetValuesBy", "count", heredoc.Doc(`Order in which to retrieve facet values.`)) + 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"}) typoTolerance := NewJSONVar([]string{"boolean", "string"}...) - cmd.Flags().Var(typoTolerance, "typoTolerance", heredoc.Doc(`Whether typo tolerance is enabled and how it is applied.`)) + 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().StringSlice("unretrievableAttributes", []string{}, heredoc.Doc(`Attributes that can't be retrieved at query time.`)) + cmd.Flags().StringSlice("unretrievableAttributes", []string{}, heredoc.Doc(`Attributes that can't be retrieved at query time. +See: https://www.algolia.com/doc/api-reference/api-parameters/unretrievableAttributes/`)) cmd.Flags().SetAnnotation("unretrievableAttributes", "Categories", []string{"Attributes"}) userData := NewJSONVar([]string{}...) - cmd.Flags().Var(userData, "userData", heredoc.Doc(`An object with custom data.`)) + cmd.Flags().Var(userData, "userData", heredoc.Doc(`An object with custom data. +See: https://www.algolia.com/doc/api-reference/api-parameters/userData/`)) cmd.Flags().SetAnnotation("userData", "Categories", []string{"Advanced"}) } func AddSearchParamsObjectFlags(cmd *cobra.Command) { - cmd.Flags().Bool("advancedSyntax", false, heredoc.Doc(`Whether to support phrase matching and excluding words from search queries.`)) + cmd.Flags().Bool("advancedSyntax", false, heredoc.Doc(`Whether to support phrase matching and excluding words from search queries. +See: https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntax/`)) cmd.Flags().SetAnnotation("advancedSyntax", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("advancedSyntaxFeatures", []string{"exactPhrase", "excludeWords"}, heredoc.Doc(`Advanced search syntax features you want to support.`)) + cmd.Flags().StringSlice("advancedSyntaxFeatures", []string{"exactPhrase", "excludeWords"}, heredoc.Doc(`Advanced search syntax features you want to support. +See: https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntaxFeatures/`)) cmd.Flags().SetAnnotation("advancedSyntaxFeatures", "Categories", []string{"Query strategy"}) - cmd.Flags().Bool("allowTyposOnNumericTokens", true, heredoc.Doc(`Whether to allow typos on numbers in the search query.`)) + 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(`Alternatives of query words that should be considered as exact matches by the Exact ranking criterion. +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 this search will be included in 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(`Tags to apply to the query for segmenting analytics data. +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. +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 obtain the coordinates from the request'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(`Precision of a coordinate-based search in meters to group results with similar distances. +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.`)) + 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. +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.`)) + cmd.Flags().StringSlice("attributesToHighlight", []string{}, heredoc.Doc(`Attributes to highlight. +See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/`)) cmd.Flags().SetAnnotation("attributesToHighlight", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().StringSlice("attributesToRetrieve", []string{"*"}, heredoc.Doc(`Attributes to include in the API response.`)) + cmd.Flags().StringSlice("attributesToRetrieve", []string{"*"}, heredoc.Doc(`Attributes to include in the API response. +See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToRetrieve/`)) cmd.Flags().SetAnnotation("attributesToRetrieve", "Categories", []string{"Attributes"}) - cmd.Flags().StringSlice("attributesToSnippet", []string{}, heredoc.Doc(`Attributes for which to enable snippets.`)) + cmd.Flags().StringSlice("attributesToSnippet", []string{}, heredoc.Doc(`Attributes for which to enable snippets. +See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/`)) cmd.Flags().SetAnnotation("attributesToSnippet", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().Bool("clickAnalytics", false, heredoc.Doc(`Whether to include a queryID attribute in the response.`)) + 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().StringSlice("customRanking", []string{}, heredoc.Doc(`Attributes to use as custom ranking.`)) + 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"}) - cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`Whether to split compound words into their building blocks.`)) + cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`Whether to split compound words into their building blocks. +See: https://www.algolia.com/doc/api-reference/api-parameters/decompoundQuery/`)) cmd.Flags().SetAnnotation("decompoundQuery", "Categories", []string{"Languages"}) - cmd.Flags().StringSlice("disableExactOnAttributes", []string{}, heredoc.Doc(`Searchable attributes for which you want to turn off the Exact ranking criterion.`)) + cmd.Flags().StringSlice("disableExactOnAttributes", []string{}, heredoc.Doc(`Searchable attributes for which you want to turn off the Exact ranking criterion. +See: https://www.algolia.com/doc/api-reference/api-parameters/disableExactOnAttributes/`)) cmd.Flags().SetAnnotation("disableExactOnAttributes", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("disableTypoToleranceOnAttributes", []string{}, heredoc.Doc(`Attributes for which you want to turn off typo tolerance.`)) + cmd.Flags().StringSlice("disableTypoToleranceOnAttributes", []string{}, heredoc.Doc(`Attributes for which you want to turn off typo tolerance. +See: https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnAttributes/`)) cmd.Flags().SetAnnotation("disableTypoToleranceOnAttributes", "Categories", []string{"Typos"}) distinct := NewJSONVar([]string{"boolean", "integer"}...) - cmd.Flags().Var(distinct, "distinct", heredoc.Doc(`Determines how many records of a group are included in the search results.`)) + 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 enable A/B testing for this search. +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.`)) + cmd.Flags().Bool("enablePersonalization", false, heredoc.Doc(`Whether to enable Personalization. +See: https://www.algolia.com/doc/api-reference/api-parameters/enablePersonalization/`)) cmd.Flags().SetAnnotation("enablePersonalization", "Categories", []string{"Personalization"}) - cmd.Flags().Bool("enableReRanking", true, heredoc.Doc(`Whether this search will use Dynamic Re-Ranking.`)) + cmd.Flags().Bool("enableReRanking", true, heredoc.Doc(`Whether this search will use Dynamic Re-Ranking. +See: https://www.algolia.com/doc/api-reference/api-parameters/enableReRanking/`)) cmd.Flags().SetAnnotation("enableReRanking", "Categories", []string{"Filtering"}) - cmd.Flags().Bool("enableRules", true, heredoc.Doc(`Whether to enable rules.`)) + cmd.Flags().Bool("enableRules", true, heredoc.Doc(`Whether to enable rules. +See: https://www.algolia.com/doc/api-reference/api-parameters/enableRules/`)) cmd.Flags().SetAnnotation("enableRules", "Categories", []string{"Rules"}) - cmd.Flags().String("exactOnSingleWordQuery", "attribute", heredoc.Doc(`Determines how the Exact ranking criterion is computed when the search query has only one word. One of: attribute, none, word.`)) + cmd.Flags().String("exactOnSingleWordQuery", "attribute", heredoc.Doc(`Determines how the Exact ranking criterion is computed when the search query has only one word. One of: attribute, none, word. +See: https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/`)) cmd.Flags().SetAnnotation("exactOnSingleWordQuery", "Categories", []string{"Query strategy"}) facetFilters := NewJSONVar([]string{"array", "string"}...) - cmd.Flags().Var(facetFilters, "facetFilters", heredoc.Doc(`Filter the search by facet values, so that only records with the same facet values are retrieved.`)) + 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 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(`Facets for which to retrieve facet values that match the search criteria and the number of matching 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(`Filter expression to only include items that match the filter criteria in the response. +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.`)) + cmd.Flags().Bool("getRankingInfo", false, heredoc.Doc(`Whether the search response should include detailed ranking information. +See: https://www.algolia.com/doc/api-reference/api-parameters/getRankingInfo/`)) cmd.Flags().SetAnnotation("getRankingInfo", "Categories", []string{"Advanced"}) - cmd.Flags().String("highlightPostTag", "", heredoc.Doc(`HTML tag to insert after the highlighted parts in all highlighted results and snippets.`)) + cmd.Flags().String("highlightPostTag", "", heredoc.Doc(`HTML tag to insert after the highlighted parts in all highlighted results and snippets. +See: https://www.algolia.com/doc/api-reference/api-parameters/highlightPostTag/`)) cmd.Flags().SetAnnotation("highlightPostTag", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().String("highlightPreTag", "", heredoc.Doc(`HTML tag to insert before the highlighted parts in all highlighted results and snippets.`)) + cmd.Flags().String("highlightPreTag", "", heredoc.Doc(`HTML tag to insert before the highlighted parts in all highlighted results and snippets. +See: https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/`)) cmd.Flags().SetAnnotation("highlightPreTag", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().Int("hitsPerPage", 20, heredoc.Doc(`Number of hits per page.`)) + cmd.Flags().Int("hitsPerPage", 20, heredoc.Doc(`Number of hits per page. +See: https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/`)) cmd.Flags().SetAnnotation("hitsPerPage", "Categories", []string{"Pagination"}) ignorePlurals := NewJSONVar([]string{"array", "boolean"}...) - cmd.Flags().Var(ignorePlurals, "ignorePlurals", heredoc.Doc(`Treat singular, plurals, and other forms of declensions as equivalent.`)) + 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().SetAnnotation("insideBoundingBox", "Categories", []string{"Geo-Search"}) cmd.Flags().SetAnnotation("insidePolygon", "Categories", []string{"Geo-Search"}) - cmd.Flags().String("keepDiacriticsOnCharacters", "", heredoc.Doc(`Characters for which diacritics should be preserved.`)) + 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(`Number of hits to retrieve (used in combination with offset). +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.`)) + cmd.Flags().Int("maxFacetHits", 10, heredoc.Doc(`Maximum number of facet values to return when searching for facet values. +See: https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits/`)) cmd.Flags().SetAnnotation("maxFacetHits", "Categories", []string{"Advanced"}) - cmd.Flags().Int("maxValuesPerFacet", 100, heredoc.Doc(`Maximum number of facet values to return for each facet.`)) + cmd.Flags().Int("maxValuesPerFacet", 100, heredoc.Doc(`Maximum number of facet values to return for each facet. +See: https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/`)) cmd.Flags().SetAnnotation("maxValuesPerFacet", "Categories", []string{"Faceting"}) - cmd.Flags().Int("minProximity", 1, heredoc.Doc(`Minimum proximity score for two matching words.`)) + cmd.Flags().Int("minProximity", 1, heredoc.Doc(`Minimum proximity score for two matching words. +See: https://www.algolia.com/doc/api-reference/api-parameters/minProximity/`)) cmd.Flags().SetAnnotation("minProximity", "Categories", []string{"Advanced"}) - cmd.Flags().Int("minWordSizefor1Typo", 4, heredoc.Doc(`Minimum number of characters a word in the search query must contain to accept matches with one typo.`)) + cmd.Flags().Int("minWordSizefor1Typo", 4, heredoc.Doc(`Minimum number of characters a word in the search query must contain to accept matches with one typo. +See: https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typo/`)) cmd.Flags().SetAnnotation("minWordSizefor1Typo", "Categories", []string{"Typos"}) - 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.`)) + 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(`Minimum radius (in meters) for a search around a location when aroundRadius isn't set. +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.`)) + 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(`ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches). +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.`)) + 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(`Position of the first hit to retrieve. +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(`Filters to promote or demote records in the search results. +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(`Words that should be considered optional when found in the query. +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(`Page of search results to retrieve. +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 search when calculating processing-time percentiles. +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(`Impact that Personalization should have on this search. +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(`Search query. +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(`Languages for 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.`)) + cmd.Flags().String("queryType", "prefixLast", heredoc.Doc(`Determines if and how query words are interpreted as prefixes. One of: prefixLast, prefixAll, prefixNone. +See: https://www.algolia.com/doc/api-reference/api-parameters/queryType/`)) cmd.Flags().SetAnnotation("queryType", "Categories", []string{"Query strategy"}) - cmd.Flags().StringSlice("ranking", []string{"typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"}, heredoc.Doc(`Determines the order in which Algolia returns your results.`)) + cmd.Flags().StringSlice("ranking", []string{"typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom"}, heredoc.Doc(`Determines the order in which Algolia returns your results. +See: https://www.algolia.com/doc/api-reference/api-parameters/ranking/`)) cmd.Flags().SetAnnotation("ranking", "Categories", []string{"Ranking"}) reRankingApplyFilter := NewJSONVar([]string{"array", "string", "null"}...) cmd.Flags().Var(reRankingApplyFilter, "reRankingApplyFilter", heredoc.Doc(`Restrict Dynamic Re-Ranking to records that match these filters.`)) - cmd.Flags().Int("relevancyStrictness", 100, heredoc.Doc(`Relevancy threshold below which less relevant results aren't included in the results.`)) + cmd.Flags().Int("relevancyStrictness", 100, heredoc.Doc(`Relevancy threshold below which less relevant results aren't included in the results. +See: https://www.algolia.com/doc/api-reference/api-parameters/relevancyStrictness/`)) cmd.Flags().SetAnnotation("relevancyStrictness", "Categories", []string{"Ranking"}) removeStopWords := NewJSONVar([]string{"array", "boolean"}...) - cmd.Flags().Var(removeStopWords, "removeStopWords", heredoc.Doc(`Removes stop words from the search query.`)) + cmd.Flags().Var(removeStopWords, "removeStopWords", heredoc.Doc(`Removes stop words from the search query. +See: https://www.algolia.com/doc/api-reference/api-parameters/removeStopWords/`)) cmd.Flags().SetAnnotation("removeStopWords", "Categories", []string{"Languages"}) - cmd.Flags().String("removeWordsIfNoResults", "none", heredoc.Doc(`Strategy for removing words from the query when it doesn't return any results. One of: none, lastWords, firstWords, allOptional.`)) + cmd.Flags().String("removeWordsIfNoResults", "none", heredoc.Doc(`Strategy for removing words from the query when it doesn't return any results. One of: none, lastWords, firstWords, allOptional. +See: https://www.algolia.com/doc/api-reference/api-parameters/removeWordsIfNoResults/`)) cmd.Flags().SetAnnotation("removeWordsIfNoResults", "Categories", []string{"Query strategy"}) renderingContent := NewJSONVar([]string{}...) - cmd.Flags().Var(renderingContent, "renderingContent", heredoc.Doc(`Extra data that can be used in the search UI.`)) + cmd.Flags().Var(renderingContent, "renderingContent", heredoc.Doc(`Extra data that can be used in the search UI. +See: https://www.algolia.com/doc/api-reference/api-parameters/renderingContent/`)) cmd.Flags().SetAnnotation("renderingContent", "Categories", []string{"Advanced"}) - cmd.Flags().Bool("replaceSynonymsInHighlight", false, heredoc.Doc(`Whether to replace a highlighted word with the matched synonym.`)) + 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 the API response of search and browse requests. +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 at least partially 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(`Restricts a search to a subset of your 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.`)) + cmd.Flags().StringSlice("ruleContexts", []string{}, heredoc.Doc(`Assigns a rule context to the search query. +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(`Keywords to be used instead of the search query to conduct a more broader search. +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.`)) + cmd.Flags().String("snippetEllipsisText", "…", heredoc.Doc(`String used as an ellipsis indicator when a snippet is truncated. +See: https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisText/`)) cmd.Flags().SetAnnotation("snippetEllipsisText", "Categories", []string{"Highlighting and Snippeting"}) - cmd.Flags().String("sortFacetValuesBy", "count", heredoc.Doc(`Order in which to retrieve facet values.`)) + 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(`Whether to sum all filter scores. +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 take into account 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"}...) - cmd.Flags().Var(tagFilters, "tagFilters", heredoc.Doc(`Filter the search by values of the special _tags attribute.`)) + cmd.Flags().Var(tagFilters, "tagFilters", heredoc.Doc(`Filter the search by values of the special _tags attribute. +See: https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/`)) cmd.Flags().SetAnnotation("tagFilters", "Categories", []string{"Filtering"}) typoTolerance := NewJSONVar([]string{"boolean", "string"}...) - cmd.Flags().Var(typoTolerance, "typoTolerance", heredoc.Doc(`Whether typo tolerance is enabled and how it is applied.`)) + 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(`Unique pseudonymous or anonymous user identifier. +See: https://www.algolia.com/doc/api-reference/api-parameters/userToken/`)) cmd.Flags().SetAnnotation("userToken", "Categories", []string{"Personalization"}) } diff --git a/pkg/gen/gen_flags.go b/pkg/gen/gen_flags.go index 20ed7993..b93daa71 100644 --- a/pkg/gen/gen_flags.go +++ b/pkg/gen/gen_flags.go @@ -235,16 +235,30 @@ func replaceMarkdownLinks(text string) string { } // getDescription returns the short description for the given parameter. -// It's the first sentence of the parameter description followed by possible values if it's an enum. +// It's the first sentence of the parameter description followed by possible values if it's an enum, +// followed by a link to the API param reference page func getDescription(name string, param *openapi3.Schema) string { + withLink := true + // These params don't have an API reference page + if name == "semanticSearch" || name == "cursor" || name == "reRankingApplyFilter" { + withLink = false + } + description := shortDescription(param.Description) + // Add choices if param is an enum if param.Enum != nil { choices := make([]string, len(param.Enum)) for i, e := range param.Enum { choices[i] = e.(string) } - return fmt.Sprintf("%s One of: %v.", description, strings.Join(choices, ", ")) + description = fmt.Sprintf("%s One of: %v.", description, strings.Join(choices, ", ")) + } + + // Add link to the API param reference page + if withLink { + link := fmt.Sprintf("https://www.algolia.com/doc/api-reference/api-parameters/%s/", name) + description = fmt.Sprintf("%s\nSee: %s", description, link) } return description }