Skip to content

Commit 4df3fbd

Browse files
algolia-botClaraMullershortcutsgavinwade12
committed
refactor(specs): mutualise code between Search API & Comp API for search query parameters (generated)
algolia/api-clients-automation#5125 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clara Muller <[email protected]> Co-authored-by: shortcuts <[email protected]> Co-authored-by: Gavin Wade <[email protected]>
1 parent d83b34d commit 4df3fbd

16 files changed

+735
-732
lines changed

Sources/Composition/Models/CompositionParams.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ public struct CompositionParams: Codable, JSONEncodable {
2727
public var page: Int?
2828
/// Whether the run response should include detailed ranking information.
2929
public var getRankingInfo: Bool?
30+
/// Relevancy threshold below which less relevant results aren't included in the results You can only set
31+
/// `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas).
32+
/// Use this setting to strike a balance between the relevance and number of returned results.
3033
public var relevancyStrictness: Int?
3134
public var facetFilters: CompositionFacetFilters?
3235
public var optionalFilters: CompositionOptionalFilters?
@@ -51,9 +54,9 @@ public struct CompositionParams: Codable, JSONEncodable {
5154
/// This parameter is ignored if you also specify `insideBoundingBox`.
5255
public var insidePolygon: [[Double]]?
5356
/// Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection
54-
/// dictionaries This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals`
57+
/// dictionaries This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals`
5558
/// settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk)
56-
/// languages. To support this, you must place the CJK language **first** **You should always specify a query
59+
/// languages. To support this, you must place the CJK language **first** **You should always specify a query
5760
/// language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/),
5861
/// or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to
5962
/// unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/).

Sources/Recommend/Models/BaseRecommendIndexSettings.swift

Lines changed: 50 additions & 50 deletions
Large diffs are not rendered by default.

Sources/Recommend/Models/BaseRecommendSearchParams.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import Foundation
77
#endif
88

99
public struct BaseRecommendSearchParams: Codable, JSONEncodable {
10-
/// Keywords to be used instead of the search query to conduct a more broader search. Using the `similarQuery`
11-
/// parameter changes other settings: - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. -
12-
/// `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords`. Since the
10+
/// Keywords to be used instead of the search query to conduct a more broader search Using the `similarQuery`
11+
/// parameter changes other settings - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. -
12+
/// `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords` Since the
1313
/// `similarQuery` is supposed to do a broad search, they usually return many results. Combine it with `filters` to
1414
/// narrow down the list of results.
1515
public var similarQuery: String?
@@ -31,16 +31,16 @@ public struct BaseRecommendSearchParams: Codable, JSONEncodable {
3131
public var optionalFilters: RecommendOptionalFilters?
3232
public var numericFilters: RecommendNumericFilters?
3333
public var tagFilters: RecommendTagFilters?
34-
/// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is
34+
/// Whether to sum all filter scores If true, all filter scores are summed. Otherwise, the maximum filter score is
3535
/// kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores).
3636
public var sumOrFiltersScores: Bool?
3737
/// Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
3838
public var restrictSearchableAttributes: [String]?
39-
/// Facets for which to retrieve facet values that match the search criteria and the number of matching facet
40-
/// values. To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
39+
/// Facets for which to retrieve facet values that match the search criteria and the number of matching facet values
40+
/// To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
4141
public var facets: [String]?
42-
/// Whether faceting should be applied after deduplication with `distinct`. This leads to accurate facet counts
43-
/// when using faceting in combination with `distinct`. It's usually better to use `afterDistinct` modifiers in the
42+
/// Whether faceting should be applied after deduplication with `distinct` This leads to accurate facet counts when
43+
/// using faceting in combination with `distinct`. It's usually better to use `afterDistinct` modifiers in the
4444
/// `attributesForFaceting` setting, as `facetingAfterDistinct` only computes correct facet counts if all records
4545
/// have the same facet values for the `attributeForDistinct`.
4646
public var facetingAfterDistinct: Bool?
@@ -62,14 +62,14 @@ public struct BaseRecommendSearchParams: Codable, JSONEncodable {
6262
/// This parameter is ignored if you also specify `insideBoundingBox`.
6363
public var insidePolygon: [[Double]]?
6464
/// ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to
65-
/// keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets
65+
/// keyword searches) - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets
6666
/// `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and
6767
/// `analyticsTags`.
6868
public var naturalLanguages: [RecommendSupportedLanguage]?
69-
/// Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context)
69+
/// Assigns a rule context to the search query [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context)
7070
/// are strings that you can use to trigger matching rules.
7171
public var ruleContexts: [String]?
72-
/// Impact that Personalization should have on this search. The higher this value is, the more Personalization
72+
/// Impact that Personalization should have on this search The higher this value is, the more Personalization
7373
/// determines the ranking compared to other factors. For more information, see [Understanding Personalization impact](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact).
7474
public var personalizationImpact: Int?
7575
/// Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events.
@@ -79,8 +79,8 @@ public struct BaseRecommendSearchParams: Codable, JSONEncodable {
7979
public var getRankingInfo: Bool?
8080
/// Whether to take into account an index's synonyms for this search.
8181
public var synonyms: Bool?
82-
/// Whether to include a `queryID` attribute in the response. The query ID is a unique identifier for a search
83-
/// query and is required for tracking [click and conversion
82+
/// Whether to include a `queryID` attribute in the response The query ID is a unique identifier for a search query
83+
/// and is required for tracking [click and conversion
8484
/// events](https://www.algolia.com/guides/sending-events/getting-started/).
8585
public var clickAnalytics: Bool?
8686
/// Whether this search will be included in Analytics.

0 commit comments

Comments
 (0)