Skip to content

Commit 664a884

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 dabb7ac commit 664a884

31 files changed

+594
-593
lines changed

packages/algoliasearch/lib/src/model/base_recommend_index_settings.dart

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

packages/algoliasearch/lib/src/model/base_recommend_search_params.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ final class BaseRecommendSearchParams {
4040
this.enableABTest,
4141
});
4242

43-
/// Keywords to be used instead of the search query to conduct a more broader search. Using the `similarQuery` parameter changes other settings: - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. - `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords`. Since the `similarQuery` is supposed to do a broad search, they usually return many results. Combine it with `filters` to narrow down the list of results.
43+
/// Keywords to be used instead of the search query to conduct a more broader search Using the `similarQuery` parameter changes other settings - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. - `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords` Since the `similarQuery` is supposed to do a broad search, they usually return many results. Combine it with `filters` to narrow down the list of results.
4444
@JsonKey(name: r'similarQuery')
4545
final String? similarQuery;
4646

@@ -76,19 +76,19 @@ final class BaseRecommendSearchParams {
7676
@JsonKey(name: r'tagFilters')
7777
final dynamic tagFilters;
7878

79-
/// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is 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).
79+
/// Whether to sum all filter scores If true, all filter scores are summed. Otherwise, the maximum filter score is 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).
8080
@JsonKey(name: r'sumOrFiltersScores')
8181
final bool? sumOrFiltersScores;
8282

8383
/// Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
8484
@JsonKey(name: r'restrictSearchableAttributes')
8585
final List<String>? restrictSearchableAttributes;
8686

87-
/// Facets for which to retrieve facet values that match the search criteria and the number of matching facet 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).
87+
/// Facets for which to retrieve facet values that match the search criteria and the number of matching facet 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).
8888
@JsonKey(name: r'facets')
8989
final List<String>? facets;
9090

91-
/// Whether faceting should be applied after deduplication with `distinct`. This leads to accurate facet counts when using faceting in combination with `distinct`. It's usually better to use `afterDistinct` modifiers in the `attributesForFaceting` setting, as `facetingAfterDistinct` only computes correct facet counts if all records have the same facet values for the `attributeForDistinct`.
91+
/// Whether faceting should be applied after deduplication with `distinct` This leads to accurate facet counts when using faceting in combination with `distinct`. It's usually better to use `afterDistinct` modifiers in the `attributesForFaceting` setting, as `facetingAfterDistinct` only computes correct facet counts if all records have the same facet values for the `attributeForDistinct`.
9292
@JsonKey(name: r'facetingAfterDistinct')
9393
final bool? facetingAfterDistinct;
9494

@@ -127,15 +127,15 @@ final class BaseRecommendSearchParams {
127127
@JsonKey(name: r'insidePolygon')
128128
final List<List<double>>? insidePolygon;
129129

130-
/// ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
130+
/// ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches) - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
131131
@JsonKey(name: r'naturalLanguages')
132132
final List<SupportedLanguage>? naturalLanguages;
133133

134-
/// 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) are strings that you can use to trigger matching rules.
134+
/// 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) are strings that you can use to trigger matching rules.
135135
@JsonKey(name: r'ruleContexts')
136136
final List<String>? ruleContexts;
137137

138-
/// Impact that Personalization should have on this search. The higher this value is, the more Personalization 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).
138+
/// Impact that Personalization should have on this search The higher this value is, the more Personalization 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).
139139
// minimum: 0
140140
// maximum: 100
141141
@JsonKey(name: r'personalizationImpact')
@@ -153,7 +153,7 @@ final class BaseRecommendSearchParams {
153153
@JsonKey(name: r'synonyms')
154154
final bool? synonyms;
155155

156-
/// Whether to include a `queryID` attribute in the response. The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/guides/sending-events/getting-started/).
156+
/// Whether to include a `queryID` attribute in the response The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/guides/sending-events/getting-started/).
157157
@JsonKey(name: r'clickAnalytics')
158158
final bool? clickAnalytics;
159159

packages/algoliasearch/lib/src/model/base_search_params.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ final class BaseSearchParams {
4848
@JsonKey(name: r'query')
4949
final String? query;
5050

51-
/// Keywords to be used instead of the search query to conduct a more broader search. Using the `similarQuery` parameter changes other settings: - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. - `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords`. Since the `similarQuery` is supposed to do a broad search, they usually return many results. Combine it with `filters` to narrow down the list of results.
51+
/// Keywords to be used instead of the search query to conduct a more broader search Using the `similarQuery` parameter changes other settings - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. - `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords` Since the `similarQuery` is supposed to do a broad search, they usually return many results. Combine it with `filters` to narrow down the list of results.
5252
@JsonKey(name: r'similarQuery')
5353
final String? similarQuery;
5454

@@ -84,19 +84,19 @@ final class BaseSearchParams {
8484
@JsonKey(name: r'tagFilters')
8585
final dynamic tagFilters;
8686

87-
/// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is 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).
87+
/// Whether to sum all filter scores If true, all filter scores are summed. Otherwise, the maximum filter score is 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).
8888
@JsonKey(name: r'sumOrFiltersScores')
8989
final bool? sumOrFiltersScores;
9090

9191
/// Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
9292
@JsonKey(name: r'restrictSearchableAttributes')
9393
final List<String>? restrictSearchableAttributes;
9494

95-
/// Facets for which to retrieve facet values that match the search criteria and the number of matching facet 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).
95+
/// Facets for which to retrieve facet values that match the search criteria and the number of matching facet 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).
9696
@JsonKey(name: r'facets')
9797
final List<String>? facets;
9898

99-
/// Whether faceting should be applied after deduplication with `distinct`. This leads to accurate facet counts when using faceting in combination with `distinct`. It's usually better to use `afterDistinct` modifiers in the `attributesForFaceting` setting, as `facetingAfterDistinct` only computes correct facet counts if all records have the same facet values for the `attributeForDistinct`.
99+
/// Whether faceting should be applied after deduplication with `distinct` This leads to accurate facet counts when using faceting in combination with `distinct`. It's usually better to use `afterDistinct` modifiers in the `attributesForFaceting` setting, as `facetingAfterDistinct` only computes correct facet counts if all records have the same facet values for the `attributeForDistinct`.
100100
@JsonKey(name: r'facetingAfterDistinct')
101101
final bool? facetingAfterDistinct;
102102

@@ -150,15 +150,15 @@ final class BaseSearchParams {
150150
@JsonKey(name: r'insidePolygon')
151151
final List<List<double>>? insidePolygon;
152152

153-
/// ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
153+
/// ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches) - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
154154
@JsonKey(name: r'naturalLanguages')
155155
final List<SupportedLanguage>? naturalLanguages;
156156

157-
/// 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) are strings that you can use to trigger matching rules.
157+
/// 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) are strings that you can use to trigger matching rules.
158158
@JsonKey(name: r'ruleContexts')
159159
final List<String>? ruleContexts;
160160

161-
/// Impact that Personalization should have on this search. The higher this value is, the more Personalization 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).
161+
/// Impact that Personalization should have on this search The higher this value is, the more Personalization 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).
162162
// minimum: 0
163163
// maximum: 100
164164
@JsonKey(name: r'personalizationImpact')
@@ -176,7 +176,7 @@ final class BaseSearchParams {
176176
@JsonKey(name: r'synonyms')
177177
final bool? synonyms;
178178

179-
/// Whether to include a `queryID` attribute in the response. The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/guides/sending-events/getting-started/).
179+
/// Whether to include a `queryID` attribute in the response The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/guides/sending-events/getting-started/).
180180
@JsonKey(name: r'clickAnalytics')
181181
final bool? clickAnalytics;
182182

packages/algoliasearch/lib/src/model/base_search_params_without_query.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ final class BaseSearchParamsWithoutQuery {
4343
this.enableABTest,
4444
});
4545

46-
/// Keywords to be used instead of the search query to conduct a more broader search. Using the `similarQuery` parameter changes other settings: - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. - `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords`. Since the `similarQuery` is supposed to do a broad search, they usually return many results. Combine it with `filters` to narrow down the list of results.
46+
/// Keywords to be used instead of the search query to conduct a more broader search Using the `similarQuery` parameter changes other settings - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. - `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords` Since the `similarQuery` is supposed to do a broad search, they usually return many results. Combine it with `filters` to narrow down the list of results.
4747
@JsonKey(name: r'similarQuery')
4848
final String? similarQuery;
4949

@@ -79,19 +79,19 @@ final class BaseSearchParamsWithoutQuery {
7979
@JsonKey(name: r'tagFilters')
8080
final dynamic tagFilters;
8181

82-
/// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is 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).
82+
/// Whether to sum all filter scores If true, all filter scores are summed. Otherwise, the maximum filter score is 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).
8383
@JsonKey(name: r'sumOrFiltersScores')
8484
final bool? sumOrFiltersScores;
8585

8686
/// Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
8787
@JsonKey(name: r'restrictSearchableAttributes')
8888
final List<String>? restrictSearchableAttributes;
8989

90-
/// Facets for which to retrieve facet values that match the search criteria and the number of matching facet 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).
90+
/// Facets for which to retrieve facet values that match the search criteria and the number of matching facet 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).
9191
@JsonKey(name: r'facets')
9292
final List<String>? facets;
9393

94-
/// Whether faceting should be applied after deduplication with `distinct`. This leads to accurate facet counts when using faceting in combination with `distinct`. It's usually better to use `afterDistinct` modifiers in the `attributesForFaceting` setting, as `facetingAfterDistinct` only computes correct facet counts if all records have the same facet values for the `attributeForDistinct`.
94+
/// Whether faceting should be applied after deduplication with `distinct` This leads to accurate facet counts when using faceting in combination with `distinct`. It's usually better to use `afterDistinct` modifiers in the `attributesForFaceting` setting, as `facetingAfterDistinct` only computes correct facet counts if all records have the same facet values for the `attributeForDistinct`.
9595
@JsonKey(name: r'facetingAfterDistinct')
9696
final bool? facetingAfterDistinct;
9797

@@ -145,15 +145,15 @@ final class BaseSearchParamsWithoutQuery {
145145
@JsonKey(name: r'insidePolygon')
146146
final List<List<double>>? insidePolygon;
147147

148-
/// ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
148+
/// ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches) - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
149149
@JsonKey(name: r'naturalLanguages')
150150
final List<SupportedLanguage>? naturalLanguages;
151151

152-
/// 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) are strings that you can use to trigger matching rules.
152+
/// 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) are strings that you can use to trigger matching rules.
153153
@JsonKey(name: r'ruleContexts')
154154
final List<String>? ruleContexts;
155155

156-
/// Impact that Personalization should have on this search. The higher this value is, the more Personalization 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).
156+
/// Impact that Personalization should have on this search The higher this value is, the more Personalization 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).
157157
// minimum: 0
158158
// maximum: 100
159159
@JsonKey(name: r'personalizationImpact')
@@ -171,7 +171,7 @@ final class BaseSearchParamsWithoutQuery {
171171
@JsonKey(name: r'synonyms')
172172
final bool? synonyms;
173173

174-
/// Whether to include a `queryID` attribute in the response. The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/guides/sending-events/getting-started/).
174+
/// Whether to include a `queryID` attribute in the response The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/guides/sending-events/getting-started/).
175175
@JsonKey(name: r'clickAnalytics')
176176
final bool? clickAnalytics;
177177

0 commit comments

Comments
 (0)