Skip to content

Commit a4e93d0

Browse files
algolia-botmillotp
andcommitted
fix(specs): make the searchParams compatible with v4 [skip-bc] (generated)
algolia/api-clients-automation#4108 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 1148a93 commit a4e93d0

File tree

68 files changed

+445
-604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+445
-604
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ final class BaseIndexSettings {
2727
this.userData,
2828
this.customNormalization,
2929
this.attributeForDistinct,
30+
this.maxFacetHits,
3031
});
3132

3233
/// Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/). Facets are attributes that let you categorize search results. They can be used for filtering search results. By default, no attribute is used for faceting. Attribute names are case-sensitive. **Modifiers** - `filterOnly(\"ATTRIBUTE\")`. Allows the attribute to be used as a filter but doesn't evaluate the facet values. - `searchable(\"ATTRIBUTE\")`. Allows searching for facet values. - `afterDistinct(\"ATTRIBUTE\")`. Evaluates the facet count _after_ deduplication with `distinct`. This ensures accurate facet counts. You can apply this modifier to searchable facets: `afterDistinct(searchable(ATTRIBUTE))`.
@@ -98,6 +99,11 @@ final class BaseIndexSettings {
9899
@JsonKey(name: r'attributeForDistinct')
99100
final String? attributeForDistinct;
100101

102+
/// Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
103+
// maximum: 100
104+
@JsonKey(name: r'maxFacetHits')
105+
final int? maxFacetHits;
106+
101107
@override
102108
bool operator ==(Object other) =>
103109
identical(this, other) ||
@@ -120,7 +126,8 @@ final class BaseIndexSettings {
120126
other.searchableAttributes == searchableAttributes &&
121127
other.userData == userData &&
122128
other.customNormalization == customNormalization &&
123-
other.attributeForDistinct == attributeForDistinct;
129+
other.attributeForDistinct == attributeForDistinct &&
130+
other.maxFacetHits == maxFacetHits;
124131

125132
@override
126133
int get hashCode =>
@@ -140,7 +147,8 @@ final class BaseIndexSettings {
140147
searchableAttributes.hashCode +
141148
userData.hashCode +
142149
customNormalization.hashCode +
143-
attributeForDistinct.hashCode;
150+
attributeForDistinct.hashCode +
151+
maxFacetHits.hashCode;
144152

145153
factory BaseIndexSettings.fromJson(Map<String, dynamic> json) =>
146154
_$BaseIndexSettingsFromJson(json);

packages/algoliasearch/lib/src/model/base_index_settings.g.dart

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// ignore_for_file: unused_element
33
import 'package:algoliasearch/src/model/advanced_syntax_features.dart';
44
import 'package:algoliasearch/src/model/supported_language.dart';
5+
import 'package:algoliasearch/src/model/rendering_content.dart';
56
import 'package:algoliasearch/src/model/remove_words_if_no_results.dart';
67
import 'package:algoliasearch/src/model/query_type.dart';
78
import 'package:algoliasearch/src/model/exact_on_single_word_query.dart';
8-
import 'package:algoliasearch/src/model/rendering_content.dart';
99
import 'package:algoliasearch/src/model/alternatives_as_exact.dart';
1010

1111
import 'package:json_annotation/json_annotation.dart';
@@ -48,7 +48,6 @@ final class BaseRecommendIndexSettings {
4848
this.replaceSynonymsInHighlight,
4949
this.minProximity,
5050
this.responseFields,
51-
this.maxFacetHits,
5251
this.maxValuesPerFacet,
5352
this.sortFacetValuesBy,
5453
this.attributeCriteriaComputedByMinProximity,
@@ -154,9 +153,11 @@ final class BaseRecommendIndexSettings {
154153
@JsonKey(name: r'advancedSyntax')
155154
final bool? advancedSyntax;
156155

157-
/// Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words).
156+
/// One of types:
157+
/// - [String]
158+
/// - [List<String>]
158159
@JsonKey(name: r'optionalWords')
159-
final List<String>? optionalWords;
160+
final dynamic optionalWords;
160161

161162
/// Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking.
162163
@JsonKey(name: r'disableExactOnAttributes')
@@ -193,11 +194,6 @@ final class BaseRecommendIndexSettings {
193194
@JsonKey(name: r'responseFields')
194195
final List<String>? responseFields;
195196

196-
/// Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
197-
// maximum: 100
198-
@JsonKey(name: r'maxFacetHits')
199-
final int? maxFacetHits;
200-
201197
/// Maximum number of facet values to return for each facet.
202198
// maximum: 1000
203199
@JsonKey(name: r'maxValuesPerFacet')
@@ -263,7 +259,6 @@ final class BaseRecommendIndexSettings {
263259
other.replaceSynonymsInHighlight == replaceSynonymsInHighlight &&
264260
other.minProximity == minProximity &&
265261
other.responseFields == responseFields &&
266-
other.maxFacetHits == maxFacetHits &&
267262
other.maxValuesPerFacet == maxValuesPerFacet &&
268263
other.sortFacetValuesBy == sortFacetValuesBy &&
269264
other.attributeCriteriaComputedByMinProximity ==
@@ -297,7 +292,7 @@ final class BaseRecommendIndexSettings {
297292
queryType.hashCode +
298293
removeWordsIfNoResults.hashCode +
299294
advancedSyntax.hashCode +
300-
optionalWords.hashCode +
295+
(optionalWords == null ? 0 : optionalWords.hashCode) +
301296
disableExactOnAttributes.hashCode +
302297
exactOnSingleWordQuery.hashCode +
303298
alternativesAsExact.hashCode +
@@ -306,7 +301,6 @@ final class BaseRecommendIndexSettings {
306301
replaceSynonymsInHighlight.hashCode +
307302
minProximity.hashCode +
308303
responseFields.hashCode +
309-
maxFacetHits.hashCode +
310304
maxValuesPerFacet.hashCode +
311305
sortFacetValuesBy.hashCode +
312306
attributeCriteriaComputedByMinProximity.hashCode +

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

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,11 @@ final class BaseRecommendSearchParams {
117117
@JsonKey(name: r'minimumAroundRadius')
118118
final int? minimumAroundRadius;
119119

120-
/// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas).
120+
/// One of types:
121+
/// - [List<List<double>>]
122+
/// - [String]
121123
@JsonKey(name: r'insideBoundingBox')
122-
final List<List<double>>? insideBoundingBox;
124+
final dynamic insideBoundingBox;
123125

124126
/// Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`.
125127
@JsonKey(name: r'insidePolygon')
@@ -221,7 +223,7 @@ final class BaseRecommendSearchParams {
221223
aroundRadius.hashCode +
222224
aroundPrecision.hashCode +
223225
minimumAroundRadius.hashCode +
224-
insideBoundingBox.hashCode +
226+
(insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) +
225227
insidePolygon.hashCode +
226228
naturalLanguages.hashCode +
227229
ruleContexts.hashCode +

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

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,11 @@ final class BaseSearchParams {
140140
@JsonKey(name: r'minimumAroundRadius')
141141
final int? minimumAroundRadius;
142142

143-
/// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas).
143+
/// One of types:
144+
/// - [List<List<double>>]
145+
/// - [String]
144146
@JsonKey(name: r'insideBoundingBox')
145-
final List<List<double>>? insideBoundingBox;
147+
final dynamic insideBoundingBox;
146148

147149
/// Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`.
148150
@JsonKey(name: r'insidePolygon')
@@ -252,7 +254,7 @@ final class BaseSearchParams {
252254
aroundRadius.hashCode +
253255
aroundPrecision.hashCode +
254256
minimumAroundRadius.hashCode +
255-
insideBoundingBox.hashCode +
257+
(insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) +
256258
insidePolygon.hashCode +
257259
naturalLanguages.hashCode +
258260
ruleContexts.hashCode +

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

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@ final class BaseSearchParamsWithoutQuery {
135135
@JsonKey(name: r'minimumAroundRadius')
136136
final int? minimumAroundRadius;
137137

138-
/// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas).
138+
/// One of types:
139+
/// - [List<List<double>>]
140+
/// - [String]
139141
@JsonKey(name: r'insideBoundingBox')
140-
final List<List<double>>? insideBoundingBox;
142+
final dynamic insideBoundingBox;
141143

142144
/// Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`.
143145
@JsonKey(name: r'insidePolygon')
@@ -245,7 +247,7 @@ final class BaseSearchParamsWithoutQuery {
245247
aroundRadius.hashCode +
246248
aroundPrecision.hashCode +
247249
minimumAroundRadius.hashCode +
248-
insideBoundingBox.hashCode +
250+
(insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) +
249251
insidePolygon.hashCode +
250252
naturalLanguages.hashCode +
251253
ruleContexts.hashCode +

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

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)