diff --git a/packages/algoliasearch/lib/src/model/base_index_settings.dart b/packages/algoliasearch/lib/src/model/base_index_settings.dart index 516ec1f..4e5c264 100644 --- a/packages/algoliasearch/lib/src/model/base_index_settings.dart +++ b/packages/algoliasearch/lib/src/model/base_index_settings.dart @@ -27,6 +27,7 @@ final class BaseIndexSettings { this.userData, this.customNormalization, this.attributeForDistinct, + this.maxFacetHits, }); /// 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 { @JsonKey(name: r'attributeForDistinct') final String? attributeForDistinct; + /// 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). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + @override bool operator ==(Object other) => identical(this, other) || @@ -120,7 +126,8 @@ final class BaseIndexSettings { other.searchableAttributes == searchableAttributes && other.userData == userData && other.customNormalization == customNormalization && - other.attributeForDistinct == attributeForDistinct; + other.attributeForDistinct == attributeForDistinct && + other.maxFacetHits == maxFacetHits; @override int get hashCode => @@ -140,7 +147,8 @@ final class BaseIndexSettings { searchableAttributes.hashCode + userData.hashCode + customNormalization.hashCode + - attributeForDistinct.hashCode; + attributeForDistinct.hashCode + + maxFacetHits.hashCode; factory BaseIndexSettings.fromJson(Map json) => _$BaseIndexSettingsFromJson(json); diff --git a/packages/algoliasearch/lib/src/model/base_index_settings.g.dart b/packages/algoliasearch/lib/src/model/base_index_settings.g.dart index 2d5fe18..7d1c260 100644 --- a/packages/algoliasearch/lib/src/model/base_index_settings.g.dart +++ b/packages/algoliasearch/lib/src/model/base_index_settings.g.dart @@ -55,6 +55,8 @@ BaseIndexSettings _$BaseIndexSettingsFromJson(Map json) => )), attributeForDistinct: $checkedConvert('attributeForDistinct', (v) => v as String?), + maxFacetHits: + $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), ); return val; }, @@ -90,6 +92,7 @@ Map _$BaseIndexSettingsToJson(BaseIndexSettings instance) { writeNotNull('userData', instance.userData); writeNotNull('customNormalization', instance.customNormalization); writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('maxFacetHits', instance.maxFacetHits); return val; } diff --git a/packages/algoliasearch/lib/src/model/base_recommend_index_settings.dart b/packages/algoliasearch/lib/src/model/base_recommend_index_settings.dart index 3707f35..0bc246b 100644 --- a/packages/algoliasearch/lib/src/model/base_recommend_index_settings.dart +++ b/packages/algoliasearch/lib/src/model/base_recommend_index_settings.dart @@ -2,10 +2,10 @@ // ignore_for_file: unused_element import 'package:algoliasearch/src/model/advanced_syntax_features.dart'; import 'package:algoliasearch/src/model/supported_language.dart'; +import 'package:algoliasearch/src/model/rendering_content.dart'; import 'package:algoliasearch/src/model/remove_words_if_no_results.dart'; import 'package:algoliasearch/src/model/query_type.dart'; import 'package:algoliasearch/src/model/exact_on_single_word_query.dart'; -import 'package:algoliasearch/src/model/rendering_content.dart'; import 'package:algoliasearch/src/model/alternatives_as_exact.dart'; import 'package:json_annotation/json_annotation.dart'; @@ -48,7 +48,6 @@ final class BaseRecommendIndexSettings { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -154,9 +153,11 @@ final class BaseRecommendIndexSettings { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -193,11 +194,6 @@ final class BaseRecommendIndexSettings { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -263,7 +259,6 @@ final class BaseRecommendIndexSettings { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -297,7 +292,7 @@ final class BaseRecommendIndexSettings { queryType.hashCode + removeWordsIfNoResults.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -306,7 +301,6 @@ final class BaseRecommendIndexSettings { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/algoliasearch/lib/src/model/base_recommend_index_settings.g.dart b/packages/algoliasearch/lib/src/model/base_recommend_index_settings.g.dart index 3c0684f..6ed70e8 100644 --- a/packages/algoliasearch/lib/src/model/base_recommend_index_settings.g.dart +++ b/packages/algoliasearch/lib/src/model/base_recommend_index_settings.g.dart @@ -58,8 +58,7 @@ BaseRecommendIndexSettings _$BaseRecommendIndexSettingsFromJson( removeWordsIfNoResults: $checkedConvert('removeWordsIfNoResults', (v) => $enumDecodeNullable(_$RemoveWordsIfNoResultsEnumMap, v)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -81,8 +80,6 @@ BaseRecommendIndexSettings _$BaseRecommendIndexSettingsFromJson( $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -153,7 +150,6 @@ Map _$BaseRecommendIndexSettingsToJson( 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/algoliasearch/lib/src/model/base_recommend_search_params.dart b/packages/algoliasearch/lib/src/model/base_recommend_search_params.dart index 7b9a93c..e302fa1 100644 --- a/packages/algoliasearch/lib/src/model/base_recommend_search_params.dart +++ b/packages/algoliasearch/lib/src/model/base_recommend_search_params.dart @@ -117,9 +117,11 @@ final class BaseRecommendSearchParams { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -221,7 +223,7 @@ final class BaseRecommendSearchParams { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + diff --git a/packages/algoliasearch/lib/src/model/base_recommend_search_params.g.dart b/packages/algoliasearch/lib/src/model/base_recommend_search_params.g.dart index 439e57d..e6788d7 100644 --- a/packages/algoliasearch/lib/src/model/base_recommend_search_params.g.dart +++ b/packages/algoliasearch/lib/src/model/base_recommend_search_params.g.dart @@ -35,13 +35,7 @@ BaseRecommendSearchParams _$BaseRecommendSearchParamsFromJson( aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) diff --git a/packages/algoliasearch/lib/src/model/base_search_params.dart b/packages/algoliasearch/lib/src/model/base_search_params.dart index 979fd35..aeb85a7 100644 --- a/packages/algoliasearch/lib/src/model/base_search_params.dart +++ b/packages/algoliasearch/lib/src/model/base_search_params.dart @@ -140,9 +140,11 @@ final class BaseSearchParams { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -252,7 +254,7 @@ final class BaseSearchParams { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + diff --git a/packages/algoliasearch/lib/src/model/base_search_params.g.dart b/packages/algoliasearch/lib/src/model/base_search_params.g.dart index 6222a9f..f49c46c 100644 --- a/packages/algoliasearch/lib/src/model/base_search_params.g.dart +++ b/packages/algoliasearch/lib/src/model/base_search_params.g.dart @@ -38,13 +38,7 @@ BaseSearchParams _$BaseSearchParamsFromJson(Map json) => aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) diff --git a/packages/algoliasearch/lib/src/model/base_search_params_without_query.dart b/packages/algoliasearch/lib/src/model/base_search_params_without_query.dart index 8fd30b7..ebcc6ba 100644 --- a/packages/algoliasearch/lib/src/model/base_search_params_without_query.dart +++ b/packages/algoliasearch/lib/src/model/base_search_params_without_query.dart @@ -135,9 +135,11 @@ final class BaseSearchParamsWithoutQuery { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -245,7 +247,7 @@ final class BaseSearchParamsWithoutQuery { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + diff --git a/packages/algoliasearch/lib/src/model/base_search_params_without_query.g.dart b/packages/algoliasearch/lib/src/model/base_search_params_without_query.g.dart index 02715e2..f881eaf 100644 --- a/packages/algoliasearch/lib/src/model/base_search_params_without_query.g.dart +++ b/packages/algoliasearch/lib/src/model/base_search_params_without_query.g.dart @@ -38,13 +38,7 @@ BaseSearchParamsWithoutQuery _$BaseSearchParamsWithoutQueryFromJson( aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) diff --git a/packages/algoliasearch/lib/src/model/browse_params_object.dart b/packages/algoliasearch/lib/src/model/browse_params_object.dart index 57d4283..589a958 100644 --- a/packages/algoliasearch/lib/src/model/browse_params_object.dart +++ b/packages/algoliasearch/lib/src/model/browse_params_object.dart @@ -87,7 +87,6 @@ final class BrowseParamsObject { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -193,9 +192,11 @@ final class BrowseParamsObject { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -364,9 +365,11 @@ final class BrowseParamsObject { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -403,11 +406,6 @@ final class BrowseParamsObject { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -514,7 +512,6 @@ final class BrowseParamsObject { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -545,7 +542,7 @@ final class BrowseParamsObject { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + @@ -586,7 +583,7 @@ final class BrowseParamsObject { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -595,7 +592,6 @@ final class BrowseParamsObject { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/algoliasearch/lib/src/model/browse_params_object.g.dart b/packages/algoliasearch/lib/src/model/browse_params_object.g.dart index 12bc6a2..14d2186 100644 --- a/packages/algoliasearch/lib/src/model/browse_params_object.g.dart +++ b/packages/algoliasearch/lib/src/model/browse_params_object.g.dart @@ -38,13 +38,7 @@ BrowseParamsObject _$BrowseParamsObjectFromJson(Map json) => aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) @@ -129,8 +123,7 @@ BrowseParamsObject _$BrowseParamsObjectFromJson(Map json) => ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -152,8 +145,6 @@ BrowseParamsObject _$BrowseParamsObjectFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -264,7 +255,6 @@ Map _$BrowseParamsObjectToJson(BrowseParamsObject instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/algoliasearch/lib/src/model/consequence_params.dart b/packages/algoliasearch/lib/src/model/consequence_params.dart index 3b47942..42018ab 100644 --- a/packages/algoliasearch/lib/src/model/consequence_params.dart +++ b/packages/algoliasearch/lib/src/model/consequence_params.dart @@ -86,7 +86,6 @@ final class ConsequenceParams { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -190,9 +189,11 @@ final class ConsequenceParams { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -361,9 +362,11 @@ final class ConsequenceParams { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -400,11 +403,6 @@ final class ConsequenceParams { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -524,7 +522,6 @@ final class ConsequenceParams { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -556,7 +553,7 @@ final class ConsequenceParams { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + @@ -597,7 +594,7 @@ final class ConsequenceParams { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -606,7 +603,6 @@ final class ConsequenceParams { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/algoliasearch/lib/src/model/consequence_params.g.dart b/packages/algoliasearch/lib/src/model/consequence_params.g.dart index 82861f7..91f10eb 100644 --- a/packages/algoliasearch/lib/src/model/consequence_params.g.dart +++ b/packages/algoliasearch/lib/src/model/consequence_params.g.dart @@ -37,13 +37,7 @@ ConsequenceParams _$ConsequenceParamsFromJson(Map json) => aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) @@ -128,8 +122,7 @@ ConsequenceParams _$ConsequenceParamsFromJson(Map json) => ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -151,8 +144,6 @@ ConsequenceParams _$ConsequenceParamsFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -266,7 +257,6 @@ Map _$ConsequenceParamsToJson(ConsequenceParams instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/algoliasearch/lib/src/model/fallback_params.dart b/packages/algoliasearch/lib/src/model/fallback_params.dart index 5a1f647..293618d 100644 --- a/packages/algoliasearch/lib/src/model/fallback_params.dart +++ b/packages/algoliasearch/lib/src/model/fallback_params.dart @@ -62,6 +62,7 @@ final class FallbackParams { this.userData, this.customNormalization, this.attributeForDistinct, + this.maxFacetHits, this.attributesToRetrieve, this.ranking, this.relevancyStrictness, @@ -94,7 +95,6 @@ final class FallbackParams { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -180,9 +180,11 @@ final class FallbackParams { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -307,6 +309,11 @@ final class FallbackParams { @JsonKey(name: r'attributeForDistinct') final String? attributeForDistinct; + /// 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). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + /// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. @JsonKey(name: r'attributesToRetrieve') final List? attributesToRetrieve; @@ -404,9 +411,11 @@ final class FallbackParams { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -443,11 +452,6 @@ final class FallbackParams { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -527,6 +531,7 @@ final class FallbackParams { other.userData == userData && other.customNormalization == customNormalization && other.attributeForDistinct == attributeForDistinct && + other.maxFacetHits == maxFacetHits && other.attributesToRetrieve == attributesToRetrieve && other.ranking == ranking && other.relevancyStrictness == relevancyStrictness && @@ -561,7 +566,6 @@ final class FallbackParams { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -587,7 +591,7 @@ final class FallbackParams { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + @@ -618,6 +622,7 @@ final class FallbackParams { userData.hashCode + customNormalization.hashCode + attributeForDistinct.hashCode + + maxFacetHits.hashCode + attributesToRetrieve.hashCode + ranking.hashCode + relevancyStrictness.hashCode + @@ -641,7 +646,7 @@ final class FallbackParams { queryType.hashCode + removeWordsIfNoResults.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -650,7 +655,6 @@ final class FallbackParams { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/algoliasearch/lib/src/model/fallback_params.g.dart b/packages/algoliasearch/lib/src/model/fallback_params.g.dart index 7745b32..95a7445 100644 --- a/packages/algoliasearch/lib/src/model/fallback_params.g.dart +++ b/packages/algoliasearch/lib/src/model/fallback_params.g.dart @@ -34,13 +34,7 @@ FallbackParams _$FallbackParamsFromJson(Map json) => aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) @@ -111,6 +105,8 @@ FallbackParams _$FallbackParamsFromJson(Map json) => )), attributeForDistinct: $checkedConvert('attributeForDistinct', (v) => v as String?), + maxFacetHits: + $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), attributesToRetrieve: $checkedConvert('attributesToRetrieve', (v) => (v as List?)?.map((e) => e as String).toList()), ranking: $checkedConvert('ranking', @@ -156,8 +152,7 @@ FallbackParams _$FallbackParamsFromJson(Map json) => removeWordsIfNoResults: $checkedConvert('removeWordsIfNoResults', (v) => $enumDecodeNullable(_$RemoveWordsIfNoResultsEnumMap, v)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -179,8 +174,6 @@ FallbackParams _$FallbackParamsFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -262,6 +255,7 @@ Map _$FallbackParamsToJson(FallbackParams instance) { writeNotNull('userData', instance.userData); writeNotNull('customNormalization', instance.customNormalization); writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('attributesToRetrieve', instance.attributesToRetrieve); writeNotNull('ranking', instance.ranking); writeNotNull('relevancyStrictness', instance.relevancyStrictness); @@ -302,7 +296,6 @@ Map _$FallbackParamsToJson(FallbackParams instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/algoliasearch/lib/src/model/index_settings.dart b/packages/algoliasearch/lib/src/model/index_settings.dart index a48cd88..a789381 100644 --- a/packages/algoliasearch/lib/src/model/index_settings.dart +++ b/packages/algoliasearch/lib/src/model/index_settings.dart @@ -35,6 +35,7 @@ final class IndexSettings { this.userData, this.customNormalization, this.attributeForDistinct, + this.maxFacetHits, this.attributesToRetrieve, this.ranking, this.customRanking, @@ -72,7 +73,6 @@ final class IndexSettings { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -150,6 +150,11 @@ final class IndexSettings { @JsonKey(name: r'attributeForDistinct') final String? attributeForDistinct; + /// 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). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + /// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. @JsonKey(name: r'attributesToRetrieve') final List? attributesToRetrieve; @@ -267,9 +272,11 @@ final class IndexSettings { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -306,11 +313,6 @@ final class IndexSettings { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -361,6 +363,7 @@ final class IndexSettings { other.userData == userData && other.customNormalization == customNormalization && other.attributeForDistinct == attributeForDistinct && + other.maxFacetHits == maxFacetHits && other.attributesToRetrieve == attributesToRetrieve && other.ranking == ranking && other.customRanking == customRanking && @@ -400,7 +403,6 @@ final class IndexSettings { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -428,6 +430,7 @@ final class IndexSettings { userData.hashCode + customNormalization.hashCode + attributeForDistinct.hashCode + + maxFacetHits.hashCode + attributesToRetrieve.hashCode + ranking.hashCode + customRanking.hashCode + @@ -456,7 +459,7 @@ final class IndexSettings { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -465,7 +468,6 @@ final class IndexSettings { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/algoliasearch/lib/src/model/index_settings.g.dart b/packages/algoliasearch/lib/src/model/index_settings.g.dart index 2132b6d..87e6c4c 100644 --- a/packages/algoliasearch/lib/src/model/index_settings.g.dart +++ b/packages/algoliasearch/lib/src/model/index_settings.g.dart @@ -55,6 +55,8 @@ IndexSettings _$IndexSettingsFromJson(Map json) => )), attributeForDistinct: $checkedConvert('attributeForDistinct', (v) => v as String?), + maxFacetHits: + $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), attributesToRetrieve: $checkedConvert('attributesToRetrieve', (v) => (v as List?)?.map((e) => e as String).toList()), ranking: $checkedConvert('ranking', @@ -113,8 +115,7 @@ IndexSettings _$IndexSettingsFromJson(Map json) => ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -136,8 +137,6 @@ IndexSettings _$IndexSettingsFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -188,6 +187,7 @@ Map _$IndexSettingsToJson(IndexSettings instance) { writeNotNull('userData', instance.userData); writeNotNull('customNormalization', instance.customNormalization); writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('attributesToRetrieve', instance.attributesToRetrieve); writeNotNull('ranking', instance.ranking); writeNotNull('customRanking', instance.customRanking); @@ -234,7 +234,6 @@ Map _$IndexSettingsToJson(IndexSettings instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/algoliasearch/lib/src/model/index_settings_as_search_params.dart b/packages/algoliasearch/lib/src/model/index_settings_as_search_params.dart index 61d5b61..97803f0 100644 --- a/packages/algoliasearch/lib/src/model/index_settings_as_search_params.dart +++ b/packages/algoliasearch/lib/src/model/index_settings_as_search_params.dart @@ -55,7 +55,6 @@ final class IndexSettingsAsSearchParams { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -181,9 +180,11 @@ final class IndexSettingsAsSearchParams { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -220,11 +221,6 @@ final class IndexSettingsAsSearchParams { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -295,7 +291,6 @@ final class IndexSettingsAsSearchParams { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -334,7 +329,7 @@ final class IndexSettingsAsSearchParams { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -343,7 +338,6 @@ final class IndexSettingsAsSearchParams { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/algoliasearch/lib/src/model/index_settings_as_search_params.g.dart b/packages/algoliasearch/lib/src/model/index_settings_as_search_params.g.dart index d0bc710..d91c840 100644 --- a/packages/algoliasearch/lib/src/model/index_settings_as_search_params.g.dart +++ b/packages/algoliasearch/lib/src/model/index_settings_as_search_params.g.dart @@ -71,8 +71,7 @@ IndexSettingsAsSearchParams _$IndexSettingsAsSearchParamsFromJson( ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -94,8 +93,6 @@ IndexSettingsAsSearchParams _$IndexSettingsAsSearchParamsFromJson( $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -172,7 +169,6 @@ Map _$IndexSettingsAsSearchParamsToJson( 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/algoliasearch/lib/src/model/recommend_index_settings.dart b/packages/algoliasearch/lib/src/model/recommend_index_settings.dart index 405e317..5c73566 100644 --- a/packages/algoliasearch/lib/src/model/recommend_index_settings.dart +++ b/packages/algoliasearch/lib/src/model/recommend_index_settings.dart @@ -2,10 +2,10 @@ // ignore_for_file: unused_element import 'package:algoliasearch/src/model/advanced_syntax_features.dart'; import 'package:algoliasearch/src/model/supported_language.dart'; +import 'package:algoliasearch/src/model/rendering_content.dart'; import 'package:algoliasearch/src/model/remove_words_if_no_results.dart'; import 'package:algoliasearch/src/model/query_type.dart'; import 'package:algoliasearch/src/model/exact_on_single_word_query.dart'; -import 'package:algoliasearch/src/model/rendering_content.dart'; import 'package:algoliasearch/src/model/alternatives_as_exact.dart'; import 'package:json_annotation/json_annotation.dart'; @@ -33,6 +33,7 @@ final class RecommendIndexSettings { this.userData, this.customNormalization, this.attributeForDistinct, + this.maxFacetHits, this.attributesToRetrieve, this.ranking, this.relevancyStrictness, @@ -65,7 +66,6 @@ final class RecommendIndexSettings { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -143,6 +143,11 @@ final class RecommendIndexSettings { @JsonKey(name: r'attributeForDistinct') final String? attributeForDistinct; + /// 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). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + /// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. @JsonKey(name: r'attributesToRetrieve') final List? attributesToRetrieve; @@ -240,9 +245,11 @@ final class RecommendIndexSettings { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -279,11 +286,6 @@ final class RecommendIndexSettings { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -334,6 +336,7 @@ final class RecommendIndexSettings { other.userData == userData && other.customNormalization == customNormalization && other.attributeForDistinct == attributeForDistinct && + other.maxFacetHits == maxFacetHits && other.attributesToRetrieve == attributesToRetrieve && other.ranking == ranking && other.relevancyStrictness == relevancyStrictness && @@ -368,7 +371,6 @@ final class RecommendIndexSettings { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -396,6 +398,7 @@ final class RecommendIndexSettings { userData.hashCode + customNormalization.hashCode + attributeForDistinct.hashCode + + maxFacetHits.hashCode + attributesToRetrieve.hashCode + ranking.hashCode + relevancyStrictness.hashCode + @@ -419,7 +422,7 @@ final class RecommendIndexSettings { queryType.hashCode + removeWordsIfNoResults.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -428,7 +431,6 @@ final class RecommendIndexSettings { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/algoliasearch/lib/src/model/recommend_index_settings.g.dart b/packages/algoliasearch/lib/src/model/recommend_index_settings.g.dart index 79e862e..1033f0f 100644 --- a/packages/algoliasearch/lib/src/model/recommend_index_settings.g.dart +++ b/packages/algoliasearch/lib/src/model/recommend_index_settings.g.dart @@ -56,6 +56,8 @@ RecommendIndexSettings _$RecommendIndexSettingsFromJson( )), attributeForDistinct: $checkedConvert('attributeForDistinct', (v) => v as String?), + maxFacetHits: + $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), attributesToRetrieve: $checkedConvert('attributesToRetrieve', (v) => (v as List?)?.map((e) => e as String).toList()), ranking: $checkedConvert('ranking', @@ -101,8 +103,7 @@ RecommendIndexSettings _$RecommendIndexSettingsFromJson( removeWordsIfNoResults: $checkedConvert('removeWordsIfNoResults', (v) => $enumDecodeNullable(_$RemoveWordsIfNoResultsEnumMap, v)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -124,8 +125,6 @@ RecommendIndexSettings _$RecommendIndexSettingsFromJson( $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -177,6 +176,7 @@ Map _$RecommendIndexSettingsToJson( writeNotNull('userData', instance.userData); writeNotNull('customNormalization', instance.customNormalization); writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('attributesToRetrieve', instance.attributesToRetrieve); writeNotNull('ranking', instance.ranking); writeNotNull('relevancyStrictness', instance.relevancyStrictness); @@ -217,7 +217,6 @@ Map _$RecommendIndexSettingsToJson( 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/algoliasearch/lib/src/model/recommend_search_params.dart b/packages/algoliasearch/lib/src/model/recommend_search_params.dart index 589f6f8..31a0fd7 100644 --- a/packages/algoliasearch/lib/src/model/recommend_search_params.dart +++ b/packages/algoliasearch/lib/src/model/recommend_search_params.dart @@ -62,6 +62,7 @@ final class RecommendSearchParams { this.userData, this.customNormalization, this.attributeForDistinct, + this.maxFacetHits, this.attributesToRetrieve, this.ranking, this.relevancyStrictness, @@ -94,7 +95,6 @@ final class RecommendSearchParams { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -180,9 +180,11 @@ final class RecommendSearchParams { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -307,6 +309,11 @@ final class RecommendSearchParams { @JsonKey(name: r'attributeForDistinct') final String? attributeForDistinct; + /// 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). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + /// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. @JsonKey(name: r'attributesToRetrieve') final List? attributesToRetrieve; @@ -404,9 +411,11 @@ final class RecommendSearchParams { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -443,11 +452,6 @@ final class RecommendSearchParams { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -527,6 +531,7 @@ final class RecommendSearchParams { other.userData == userData && other.customNormalization == customNormalization && other.attributeForDistinct == attributeForDistinct && + other.maxFacetHits == maxFacetHits && other.attributesToRetrieve == attributesToRetrieve && other.ranking == ranking && other.relevancyStrictness == relevancyStrictness && @@ -561,7 +566,6 @@ final class RecommendSearchParams { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -587,7 +591,7 @@ final class RecommendSearchParams { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + @@ -618,6 +622,7 @@ final class RecommendSearchParams { userData.hashCode + customNormalization.hashCode + attributeForDistinct.hashCode + + maxFacetHits.hashCode + attributesToRetrieve.hashCode + ranking.hashCode + relevancyStrictness.hashCode + @@ -641,7 +646,7 @@ final class RecommendSearchParams { queryType.hashCode + removeWordsIfNoResults.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -650,7 +655,6 @@ final class RecommendSearchParams { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/algoliasearch/lib/src/model/recommend_search_params.g.dart b/packages/algoliasearch/lib/src/model/recommend_search_params.g.dart index cab8210..b077e58 100644 --- a/packages/algoliasearch/lib/src/model/recommend_search_params.g.dart +++ b/packages/algoliasearch/lib/src/model/recommend_search_params.g.dart @@ -35,13 +35,7 @@ RecommendSearchParams _$RecommendSearchParamsFromJson( aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) @@ -112,6 +106,8 @@ RecommendSearchParams _$RecommendSearchParamsFromJson( )), attributeForDistinct: $checkedConvert('attributeForDistinct', (v) => v as String?), + maxFacetHits: + $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), attributesToRetrieve: $checkedConvert('attributesToRetrieve', (v) => (v as List?)?.map((e) => e as String).toList()), ranking: $checkedConvert('ranking', @@ -157,8 +153,7 @@ RecommendSearchParams _$RecommendSearchParamsFromJson( removeWordsIfNoResults: $checkedConvert('removeWordsIfNoResults', (v) => $enumDecodeNullable(_$RemoveWordsIfNoResultsEnumMap, v)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -180,8 +175,6 @@ RecommendSearchParams _$RecommendSearchParamsFromJson( $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -264,6 +257,7 @@ Map _$RecommendSearchParamsToJson( writeNotNull('userData', instance.userData); writeNotNull('customNormalization', instance.customNormalization); writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('attributesToRetrieve', instance.attributesToRetrieve); writeNotNull('ranking', instance.ranking); writeNotNull('relevancyStrictness', instance.relevancyStrictness); @@ -304,7 +298,6 @@ Map _$RecommendSearchParamsToJson( 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/algoliasearch/lib/src/model/search_for_facets.dart b/packages/algoliasearch/lib/src/model/search_for_facets.dart index 7e9c0e2..ce07b81 100644 --- a/packages/algoliasearch/lib/src/model/search_for_facets.dart +++ b/packages/algoliasearch/lib/src/model/search_for_facets.dart @@ -89,7 +89,6 @@ final class SearchForFacets { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -99,6 +98,7 @@ final class SearchForFacets { required this.facet, required this.indexName, this.facetQuery, + this.maxFacetHits, required this.type, }); @@ -202,9 +202,11 @@ final class SearchForFacets { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -373,9 +375,11 @@ final class SearchForFacets { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -412,11 +416,6 @@ final class SearchForFacets { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -456,6 +455,11 @@ final class SearchForFacets { @JsonKey(name: r'facetQuery') final String? facetQuery; + /// 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). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + @JsonKey(name: r'type') final SearchTypeFacet type; @@ -535,7 +539,6 @@ final class SearchForFacets { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -546,6 +549,7 @@ final class SearchForFacets { other.facet == facet && other.indexName == indexName && other.facetQuery == facetQuery && + other.maxFacetHits == maxFacetHits && other.type == type; @override @@ -570,7 +574,7 @@ final class SearchForFacets { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + @@ -611,7 +615,7 @@ final class SearchForFacets { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -620,7 +624,6 @@ final class SearchForFacets { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + @@ -630,6 +633,7 @@ final class SearchForFacets { facet.hashCode + indexName.hashCode + facetQuery.hashCode + + maxFacetHits.hashCode + type.hashCode; factory SearchForFacets.fromJson(Map json) => diff --git a/packages/algoliasearch/lib/src/model/search_for_facets.g.dart b/packages/algoliasearch/lib/src/model/search_for_facets.g.dart index cc577ea..10156ef 100644 --- a/packages/algoliasearch/lib/src/model/search_for_facets.g.dart +++ b/packages/algoliasearch/lib/src/model/search_for_facets.g.dart @@ -39,13 +39,7 @@ SearchForFacets _$SearchForFacetsFromJson(Map json) => aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) @@ -130,8 +124,7 @@ SearchForFacets _$SearchForFacetsFromJson(Map json) => ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -153,8 +146,6 @@ SearchForFacets _$SearchForFacetsFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -173,6 +164,8 @@ SearchForFacets _$SearchForFacetsFromJson(Map json) => facet: $checkedConvert('facet', (v) => v as String), indexName: $checkedConvert('indexName', (v) => v as String), facetQuery: $checkedConvert('facetQuery', (v) => v as String?), + maxFacetHits: + $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), type: $checkedConvert( 'type', (v) => $enumDecode(_$SearchTypeFacetEnumMap, v)), ); @@ -270,7 +263,6 @@ Map _$SearchForFacetsToJson(SearchForFacets instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', @@ -281,6 +273,7 @@ Map _$SearchForFacetsToJson(SearchForFacets instance) { val['facet'] = instance.facet; val['indexName'] = instance.indexName; writeNotNull('facetQuery', instance.facetQuery); + writeNotNull('maxFacetHits', instance.maxFacetHits); val['type'] = instance.type.toJson(); return val; } diff --git a/packages/algoliasearch/lib/src/model/search_for_hits.dart b/packages/algoliasearch/lib/src/model/search_for_hits.dart index 47e1665..ba28835 100644 --- a/packages/algoliasearch/lib/src/model/search_for_hits.dart +++ b/packages/algoliasearch/lib/src/model/search_for_hits.dart @@ -89,7 +89,6 @@ final class SearchForHits { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -200,9 +199,11 @@ final class SearchForHits { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -371,9 +372,11 @@ final class SearchForHits { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -410,11 +413,6 @@ final class SearchForHits { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -525,7 +523,6 @@ final class SearchForHits { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -558,7 +555,7 @@ final class SearchForHits { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + @@ -599,7 +596,7 @@ final class SearchForHits { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -608,7 +605,6 @@ final class SearchForHits { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/algoliasearch/lib/src/model/search_for_hits.g.dart b/packages/algoliasearch/lib/src/model/search_for_hits.g.dart index 3ffb21a..6fbd471 100644 --- a/packages/algoliasearch/lib/src/model/search_for_hits.g.dart +++ b/packages/algoliasearch/lib/src/model/search_for_hits.g.dart @@ -39,13 +39,7 @@ SearchForHits _$SearchForHitsFromJson(Map json) => aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) @@ -130,8 +124,7 @@ SearchForHits _$SearchForHitsFromJson(Map json) => ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -153,8 +146,6 @@ SearchForHits _$SearchForHitsFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -268,7 +259,6 @@ Map _$SearchForHitsToJson(SearchForHits instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/algoliasearch/lib/src/model/search_params_object.dart b/packages/algoliasearch/lib/src/model/search_params_object.dart index ff88660..fb4f951 100644 --- a/packages/algoliasearch/lib/src/model/search_params_object.dart +++ b/packages/algoliasearch/lib/src/model/search_params_object.dart @@ -87,7 +87,6 @@ final class SearchParamsObject { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -192,9 +191,11 @@ final class SearchParamsObject { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -363,9 +364,11 @@ final class SearchParamsObject { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -402,11 +405,6 @@ final class SearchParamsObject { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -509,7 +507,6 @@ final class SearchParamsObject { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -539,7 +536,7 @@ final class SearchParamsObject { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + @@ -580,7 +577,7 @@ final class SearchParamsObject { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -589,7 +586,6 @@ final class SearchParamsObject { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/algoliasearch/lib/src/model/search_params_object.g.dart b/packages/algoliasearch/lib/src/model/search_params_object.g.dart index 7cd278b..8b20770 100644 --- a/packages/algoliasearch/lib/src/model/search_params_object.g.dart +++ b/packages/algoliasearch/lib/src/model/search_params_object.g.dart @@ -38,13 +38,7 @@ SearchParamsObject _$SearchParamsObjectFromJson(Map json) => aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) @@ -129,8 +123,7 @@ SearchParamsObject _$SearchParamsObjectFromJson(Map json) => ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -152,8 +145,6 @@ SearchParamsObject _$SearchParamsObjectFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -263,7 +254,6 @@ Map _$SearchParamsObjectToJson(SearchParamsObject instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/algoliasearch/lib/src/model/settings_response.dart b/packages/algoliasearch/lib/src/model/settings_response.dart index 7e77e38..6e330ab 100644 --- a/packages/algoliasearch/lib/src/model/settings_response.dart +++ b/packages/algoliasearch/lib/src/model/settings_response.dart @@ -35,6 +35,7 @@ final class SettingsResponse { this.userData, this.customNormalization, this.attributeForDistinct, + this.maxFacetHits, this.attributesToRetrieve, this.ranking, this.customRanking, @@ -72,7 +73,6 @@ final class SettingsResponse { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -151,6 +151,11 @@ final class SettingsResponse { @JsonKey(name: r'attributeForDistinct') final String? attributeForDistinct; + /// 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). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + /// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. @JsonKey(name: r'attributesToRetrieve') final List? attributesToRetrieve; @@ -268,9 +273,11 @@ final class SettingsResponse { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -307,11 +314,6 @@ final class SettingsResponse { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -366,6 +368,7 @@ final class SettingsResponse { other.userData == userData && other.customNormalization == customNormalization && other.attributeForDistinct == attributeForDistinct && + other.maxFacetHits == maxFacetHits && other.attributesToRetrieve == attributesToRetrieve && other.ranking == ranking && other.customRanking == customRanking && @@ -405,7 +408,6 @@ final class SettingsResponse { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -434,6 +436,7 @@ final class SettingsResponse { userData.hashCode + customNormalization.hashCode + attributeForDistinct.hashCode + + maxFacetHits.hashCode + attributesToRetrieve.hashCode + ranking.hashCode + customRanking.hashCode + @@ -462,7 +465,7 @@ final class SettingsResponse { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -471,7 +474,6 @@ final class SettingsResponse { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/algoliasearch/lib/src/model/settings_response.g.dart b/packages/algoliasearch/lib/src/model/settings_response.g.dart index 07cbbdf..4a5dc18 100644 --- a/packages/algoliasearch/lib/src/model/settings_response.g.dart +++ b/packages/algoliasearch/lib/src/model/settings_response.g.dart @@ -55,6 +55,8 @@ SettingsResponse _$SettingsResponseFromJson(Map json) => )), attributeForDistinct: $checkedConvert('attributeForDistinct', (v) => v as String?), + maxFacetHits: + $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), attributesToRetrieve: $checkedConvert('attributesToRetrieve', (v) => (v as List?)?.map((e) => e as String).toList()), ranking: $checkedConvert('ranking', @@ -113,8 +115,7 @@ SettingsResponse _$SettingsResponseFromJson(Map json) => ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -136,8 +137,6 @@ SettingsResponse _$SettingsResponseFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -189,6 +188,7 @@ Map _$SettingsResponseToJson(SettingsResponse instance) { writeNotNull('userData', instance.userData); writeNotNull('customNormalization', instance.customNormalization); writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('attributesToRetrieve', instance.attributesToRetrieve); writeNotNull('ranking', instance.ranking); writeNotNull('customRanking', instance.customRanking); @@ -235,7 +235,6 @@ Map _$SettingsResponseToJson(SettingsResponse instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/client_recommend/lib/src/model/base_index_settings.dart b/packages/client_recommend/lib/src/model/base_index_settings.dart index 465e4fa..f4bc591 100644 --- a/packages/client_recommend/lib/src/model/base_index_settings.dart +++ b/packages/client_recommend/lib/src/model/base_index_settings.dart @@ -27,6 +27,7 @@ final class BaseIndexSettings { this.userData, this.customNormalization, this.attributeForDistinct, + this.maxFacetHits, }); /// 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 { @JsonKey(name: r'attributeForDistinct') final String? attributeForDistinct; + /// 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). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + @override bool operator ==(Object other) => identical(this, other) || @@ -120,7 +126,8 @@ final class BaseIndexSettings { other.searchableAttributes == searchableAttributes && other.userData == userData && other.customNormalization == customNormalization && - other.attributeForDistinct == attributeForDistinct; + other.attributeForDistinct == attributeForDistinct && + other.maxFacetHits == maxFacetHits; @override int get hashCode => @@ -140,7 +147,8 @@ final class BaseIndexSettings { searchableAttributes.hashCode + userData.hashCode + customNormalization.hashCode + - attributeForDistinct.hashCode; + attributeForDistinct.hashCode + + maxFacetHits.hashCode; factory BaseIndexSettings.fromJson(Map json) => _$BaseIndexSettingsFromJson(json); diff --git a/packages/client_recommend/lib/src/model/base_index_settings.g.dart b/packages/client_recommend/lib/src/model/base_index_settings.g.dart index 2d5fe18..7d1c260 100644 --- a/packages/client_recommend/lib/src/model/base_index_settings.g.dart +++ b/packages/client_recommend/lib/src/model/base_index_settings.g.dart @@ -55,6 +55,8 @@ BaseIndexSettings _$BaseIndexSettingsFromJson(Map json) => )), attributeForDistinct: $checkedConvert('attributeForDistinct', (v) => v as String?), + maxFacetHits: + $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), ); return val; }, @@ -90,6 +92,7 @@ Map _$BaseIndexSettingsToJson(BaseIndexSettings instance) { writeNotNull('userData', instance.userData); writeNotNull('customNormalization', instance.customNormalization); writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('maxFacetHits', instance.maxFacetHits); return val; } diff --git a/packages/client_recommend/lib/src/model/base_recommend_index_settings.dart b/packages/client_recommend/lib/src/model/base_recommend_index_settings.dart index 01c76b0..083607c 100644 --- a/packages/client_recommend/lib/src/model/base_recommend_index_settings.dart +++ b/packages/client_recommend/lib/src/model/base_recommend_index_settings.dart @@ -1,9 +1,9 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. // ignore_for_file: unused_element import 'package:algolia_client_recommend/src/model/query_type.dart'; +import 'package:algolia_client_recommend/src/model/alternatives_as_exact.dart'; import 'package:algolia_client_recommend/src/model/advanced_syntax_features.dart'; import 'package:algolia_client_recommend/src/model/supported_language.dart'; -import 'package:algolia_client_recommend/src/model/alternatives_as_exact.dart'; import 'package:algolia_client_recommend/src/model/remove_words_if_no_results.dart'; import 'package:algolia_client_recommend/src/model/exact_on_single_word_query.dart'; import 'package:algolia_client_recommend/src/model/rendering_content.dart'; @@ -48,7 +48,6 @@ final class BaseRecommendIndexSettings { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -154,9 +153,11 @@ final class BaseRecommendIndexSettings { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -193,11 +194,6 @@ final class BaseRecommendIndexSettings { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -263,7 +259,6 @@ final class BaseRecommendIndexSettings { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -297,7 +292,7 @@ final class BaseRecommendIndexSettings { queryType.hashCode + removeWordsIfNoResults.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -306,7 +301,6 @@ final class BaseRecommendIndexSettings { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/client_recommend/lib/src/model/base_recommend_index_settings.g.dart b/packages/client_recommend/lib/src/model/base_recommend_index_settings.g.dart index 3c0684f..6ed70e8 100644 --- a/packages/client_recommend/lib/src/model/base_recommend_index_settings.g.dart +++ b/packages/client_recommend/lib/src/model/base_recommend_index_settings.g.dart @@ -58,8 +58,7 @@ BaseRecommendIndexSettings _$BaseRecommendIndexSettingsFromJson( removeWordsIfNoResults: $checkedConvert('removeWordsIfNoResults', (v) => $enumDecodeNullable(_$RemoveWordsIfNoResultsEnumMap, v)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -81,8 +80,6 @@ BaseRecommendIndexSettings _$BaseRecommendIndexSettingsFromJson( $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -153,7 +150,6 @@ Map _$BaseRecommendIndexSettingsToJson( 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/client_recommend/lib/src/model/base_recommend_search_params.dart b/packages/client_recommend/lib/src/model/base_recommend_search_params.dart index f31feb4..3664b55 100644 --- a/packages/client_recommend/lib/src/model/base_recommend_search_params.dart +++ b/packages/client_recommend/lib/src/model/base_recommend_search_params.dart @@ -117,9 +117,11 @@ final class BaseRecommendSearchParams { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -221,7 +223,7 @@ final class BaseRecommendSearchParams { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + diff --git a/packages/client_recommend/lib/src/model/base_recommend_search_params.g.dart b/packages/client_recommend/lib/src/model/base_recommend_search_params.g.dart index 439e57d..e6788d7 100644 --- a/packages/client_recommend/lib/src/model/base_recommend_search_params.g.dart +++ b/packages/client_recommend/lib/src/model/base_recommend_search_params.g.dart @@ -35,13 +35,7 @@ BaseRecommendSearchParams _$BaseRecommendSearchParamsFromJson( aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) diff --git a/packages/client_recommend/lib/src/model/fallback_params.dart b/packages/client_recommend/lib/src/model/fallback_params.dart index 5274bb1..2760dc8 100644 --- a/packages/client_recommend/lib/src/model/fallback_params.dart +++ b/packages/client_recommend/lib/src/model/fallback_params.dart @@ -62,6 +62,7 @@ final class FallbackParams { this.userData, this.customNormalization, this.attributeForDistinct, + this.maxFacetHits, this.attributesToRetrieve, this.ranking, this.relevancyStrictness, @@ -94,7 +95,6 @@ final class FallbackParams { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -180,9 +180,11 @@ final class FallbackParams { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -307,6 +309,11 @@ final class FallbackParams { @JsonKey(name: r'attributeForDistinct') final String? attributeForDistinct; + /// 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). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + /// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. @JsonKey(name: r'attributesToRetrieve') final List? attributesToRetrieve; @@ -404,9 +411,11 @@ final class FallbackParams { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -443,11 +452,6 @@ final class FallbackParams { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -527,6 +531,7 @@ final class FallbackParams { other.userData == userData && other.customNormalization == customNormalization && other.attributeForDistinct == attributeForDistinct && + other.maxFacetHits == maxFacetHits && other.attributesToRetrieve == attributesToRetrieve && other.ranking == ranking && other.relevancyStrictness == relevancyStrictness && @@ -561,7 +566,6 @@ final class FallbackParams { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -587,7 +591,7 @@ final class FallbackParams { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + @@ -618,6 +622,7 @@ final class FallbackParams { userData.hashCode + customNormalization.hashCode + attributeForDistinct.hashCode + + maxFacetHits.hashCode + attributesToRetrieve.hashCode + ranking.hashCode + relevancyStrictness.hashCode + @@ -641,7 +646,7 @@ final class FallbackParams { queryType.hashCode + removeWordsIfNoResults.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -650,7 +655,6 @@ final class FallbackParams { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/client_recommend/lib/src/model/fallback_params.g.dart b/packages/client_recommend/lib/src/model/fallback_params.g.dart index 7745b32..95a7445 100644 --- a/packages/client_recommend/lib/src/model/fallback_params.g.dart +++ b/packages/client_recommend/lib/src/model/fallback_params.g.dart @@ -34,13 +34,7 @@ FallbackParams _$FallbackParamsFromJson(Map json) => aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) @@ -111,6 +105,8 @@ FallbackParams _$FallbackParamsFromJson(Map json) => )), attributeForDistinct: $checkedConvert('attributeForDistinct', (v) => v as String?), + maxFacetHits: + $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), attributesToRetrieve: $checkedConvert('attributesToRetrieve', (v) => (v as List?)?.map((e) => e as String).toList()), ranking: $checkedConvert('ranking', @@ -156,8 +152,7 @@ FallbackParams _$FallbackParamsFromJson(Map json) => removeWordsIfNoResults: $checkedConvert('removeWordsIfNoResults', (v) => $enumDecodeNullable(_$RemoveWordsIfNoResultsEnumMap, v)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -179,8 +174,6 @@ FallbackParams _$FallbackParamsFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -262,6 +255,7 @@ Map _$FallbackParamsToJson(FallbackParams instance) { writeNotNull('userData', instance.userData); writeNotNull('customNormalization', instance.customNormalization); writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('attributesToRetrieve', instance.attributesToRetrieve); writeNotNull('ranking', instance.ranking); writeNotNull('relevancyStrictness', instance.relevancyStrictness); @@ -302,7 +296,6 @@ Map _$FallbackParamsToJson(FallbackParams instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/client_recommend/lib/src/model/recommend_index_settings.dart b/packages/client_recommend/lib/src/model/recommend_index_settings.dart index 2bba9c0..cc0d274 100644 --- a/packages/client_recommend/lib/src/model/recommend_index_settings.dart +++ b/packages/client_recommend/lib/src/model/recommend_index_settings.dart @@ -1,9 +1,9 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. // ignore_for_file: unused_element import 'package:algolia_client_recommend/src/model/query_type.dart'; +import 'package:algolia_client_recommend/src/model/alternatives_as_exact.dart'; import 'package:algolia_client_recommend/src/model/advanced_syntax_features.dart'; import 'package:algolia_client_recommend/src/model/supported_language.dart'; -import 'package:algolia_client_recommend/src/model/alternatives_as_exact.dart'; import 'package:algolia_client_recommend/src/model/remove_words_if_no_results.dart'; import 'package:algolia_client_recommend/src/model/exact_on_single_word_query.dart'; import 'package:algolia_client_recommend/src/model/rendering_content.dart'; @@ -33,6 +33,7 @@ final class RecommendIndexSettings { this.userData, this.customNormalization, this.attributeForDistinct, + this.maxFacetHits, this.attributesToRetrieve, this.ranking, this.relevancyStrictness, @@ -65,7 +66,6 @@ final class RecommendIndexSettings { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -143,6 +143,11 @@ final class RecommendIndexSettings { @JsonKey(name: r'attributeForDistinct') final String? attributeForDistinct; + /// 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). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + /// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. @JsonKey(name: r'attributesToRetrieve') final List? attributesToRetrieve; @@ -240,9 +245,11 @@ final class RecommendIndexSettings { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -279,11 +286,6 @@ final class RecommendIndexSettings { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -334,6 +336,7 @@ final class RecommendIndexSettings { other.userData == userData && other.customNormalization == customNormalization && other.attributeForDistinct == attributeForDistinct && + other.maxFacetHits == maxFacetHits && other.attributesToRetrieve == attributesToRetrieve && other.ranking == ranking && other.relevancyStrictness == relevancyStrictness && @@ -368,7 +371,6 @@ final class RecommendIndexSettings { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -396,6 +398,7 @@ final class RecommendIndexSettings { userData.hashCode + customNormalization.hashCode + attributeForDistinct.hashCode + + maxFacetHits.hashCode + attributesToRetrieve.hashCode + ranking.hashCode + relevancyStrictness.hashCode + @@ -419,7 +422,7 @@ final class RecommendIndexSettings { queryType.hashCode + removeWordsIfNoResults.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -428,7 +431,6 @@ final class RecommendIndexSettings { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/client_recommend/lib/src/model/recommend_index_settings.g.dart b/packages/client_recommend/lib/src/model/recommend_index_settings.g.dart index 79e862e..1033f0f 100644 --- a/packages/client_recommend/lib/src/model/recommend_index_settings.g.dart +++ b/packages/client_recommend/lib/src/model/recommend_index_settings.g.dart @@ -56,6 +56,8 @@ RecommendIndexSettings _$RecommendIndexSettingsFromJson( )), attributeForDistinct: $checkedConvert('attributeForDistinct', (v) => v as String?), + maxFacetHits: + $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), attributesToRetrieve: $checkedConvert('attributesToRetrieve', (v) => (v as List?)?.map((e) => e as String).toList()), ranking: $checkedConvert('ranking', @@ -101,8 +103,7 @@ RecommendIndexSettings _$RecommendIndexSettingsFromJson( removeWordsIfNoResults: $checkedConvert('removeWordsIfNoResults', (v) => $enumDecodeNullable(_$RemoveWordsIfNoResultsEnumMap, v)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -124,8 +125,6 @@ RecommendIndexSettings _$RecommendIndexSettingsFromJson( $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -177,6 +176,7 @@ Map _$RecommendIndexSettingsToJson( writeNotNull('userData', instance.userData); writeNotNull('customNormalization', instance.customNormalization); writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('attributesToRetrieve', instance.attributesToRetrieve); writeNotNull('ranking', instance.ranking); writeNotNull('relevancyStrictness', instance.relevancyStrictness); @@ -217,7 +217,6 @@ Map _$RecommendIndexSettingsToJson( 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/client_recommend/lib/src/model/recommend_search_params.dart b/packages/client_recommend/lib/src/model/recommend_search_params.dart index 8970418..87848d1 100644 --- a/packages/client_recommend/lib/src/model/recommend_search_params.dart +++ b/packages/client_recommend/lib/src/model/recommend_search_params.dart @@ -62,6 +62,7 @@ final class RecommendSearchParams { this.userData, this.customNormalization, this.attributeForDistinct, + this.maxFacetHits, this.attributesToRetrieve, this.ranking, this.relevancyStrictness, @@ -94,7 +95,6 @@ final class RecommendSearchParams { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -180,9 +180,11 @@ final class RecommendSearchParams { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -307,6 +309,11 @@ final class RecommendSearchParams { @JsonKey(name: r'attributeForDistinct') final String? attributeForDistinct; + /// 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). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + /// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. @JsonKey(name: r'attributesToRetrieve') final List? attributesToRetrieve; @@ -404,9 +411,11 @@ final class RecommendSearchParams { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -443,11 +452,6 @@ final class RecommendSearchParams { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -527,6 +531,7 @@ final class RecommendSearchParams { other.userData == userData && other.customNormalization == customNormalization && other.attributeForDistinct == attributeForDistinct && + other.maxFacetHits == maxFacetHits && other.attributesToRetrieve == attributesToRetrieve && other.ranking == ranking && other.relevancyStrictness == relevancyStrictness && @@ -561,7 +566,6 @@ final class RecommendSearchParams { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -587,7 +591,7 @@ final class RecommendSearchParams { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + @@ -618,6 +622,7 @@ final class RecommendSearchParams { userData.hashCode + customNormalization.hashCode + attributeForDistinct.hashCode + + maxFacetHits.hashCode + attributesToRetrieve.hashCode + ranking.hashCode + relevancyStrictness.hashCode + @@ -641,7 +646,7 @@ final class RecommendSearchParams { queryType.hashCode + removeWordsIfNoResults.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -650,7 +655,6 @@ final class RecommendSearchParams { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/client_recommend/lib/src/model/recommend_search_params.g.dart b/packages/client_recommend/lib/src/model/recommend_search_params.g.dart index cab8210..b077e58 100644 --- a/packages/client_recommend/lib/src/model/recommend_search_params.g.dart +++ b/packages/client_recommend/lib/src/model/recommend_search_params.g.dart @@ -35,13 +35,7 @@ RecommendSearchParams _$RecommendSearchParamsFromJson( aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) @@ -112,6 +106,8 @@ RecommendSearchParams _$RecommendSearchParamsFromJson( )), attributeForDistinct: $checkedConvert('attributeForDistinct', (v) => v as String?), + maxFacetHits: + $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), attributesToRetrieve: $checkedConvert('attributesToRetrieve', (v) => (v as List?)?.map((e) => e as String).toList()), ranking: $checkedConvert('ranking', @@ -157,8 +153,7 @@ RecommendSearchParams _$RecommendSearchParamsFromJson( removeWordsIfNoResults: $checkedConvert('removeWordsIfNoResults', (v) => $enumDecodeNullable(_$RemoveWordsIfNoResultsEnumMap, v)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -180,8 +175,6 @@ RecommendSearchParams _$RecommendSearchParamsFromJson( $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -264,6 +257,7 @@ Map _$RecommendSearchParamsToJson( writeNotNull('userData', instance.userData); writeNotNull('customNormalization', instance.customNormalization); writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('attributesToRetrieve', instance.attributesToRetrieve); writeNotNull('ranking', instance.ranking); writeNotNull('relevancyStrictness', instance.relevancyStrictness); @@ -304,7 +298,6 @@ Map _$RecommendSearchParamsToJson( 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/client_search/lib/src/model/base_index_settings.dart b/packages/client_search/lib/src/model/base_index_settings.dart index 1d3769d..ab405f0 100644 --- a/packages/client_search/lib/src/model/base_index_settings.dart +++ b/packages/client_search/lib/src/model/base_index_settings.dart @@ -27,6 +27,7 @@ final class BaseIndexSettings { this.userData, this.customNormalization, this.attributeForDistinct, + this.maxFacetHits, }); /// 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 { @JsonKey(name: r'attributeForDistinct') final String? attributeForDistinct; + /// 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). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + @override bool operator ==(Object other) => identical(this, other) || @@ -120,7 +126,8 @@ final class BaseIndexSettings { other.searchableAttributes == searchableAttributes && other.userData == userData && other.customNormalization == customNormalization && - other.attributeForDistinct == attributeForDistinct; + other.attributeForDistinct == attributeForDistinct && + other.maxFacetHits == maxFacetHits; @override int get hashCode => @@ -140,7 +147,8 @@ final class BaseIndexSettings { searchableAttributes.hashCode + userData.hashCode + customNormalization.hashCode + - attributeForDistinct.hashCode; + attributeForDistinct.hashCode + + maxFacetHits.hashCode; factory BaseIndexSettings.fromJson(Map json) => _$BaseIndexSettingsFromJson(json); diff --git a/packages/client_search/lib/src/model/base_index_settings.g.dart b/packages/client_search/lib/src/model/base_index_settings.g.dart index 2d5fe18..7d1c260 100644 --- a/packages/client_search/lib/src/model/base_index_settings.g.dart +++ b/packages/client_search/lib/src/model/base_index_settings.g.dart @@ -55,6 +55,8 @@ BaseIndexSettings _$BaseIndexSettingsFromJson(Map json) => )), attributeForDistinct: $checkedConvert('attributeForDistinct', (v) => v as String?), + maxFacetHits: + $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), ); return val; }, @@ -90,6 +92,7 @@ Map _$BaseIndexSettingsToJson(BaseIndexSettings instance) { writeNotNull('userData', instance.userData); writeNotNull('customNormalization', instance.customNormalization); writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('maxFacetHits', instance.maxFacetHits); return val; } diff --git a/packages/client_search/lib/src/model/base_search_params.dart b/packages/client_search/lib/src/model/base_search_params.dart index 2e7673d..7d67403 100644 --- a/packages/client_search/lib/src/model/base_search_params.dart +++ b/packages/client_search/lib/src/model/base_search_params.dart @@ -140,9 +140,11 @@ final class BaseSearchParams { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -252,7 +254,7 @@ final class BaseSearchParams { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + diff --git a/packages/client_search/lib/src/model/base_search_params.g.dart b/packages/client_search/lib/src/model/base_search_params.g.dart index 6222a9f..f49c46c 100644 --- a/packages/client_search/lib/src/model/base_search_params.g.dart +++ b/packages/client_search/lib/src/model/base_search_params.g.dart @@ -38,13 +38,7 @@ BaseSearchParams _$BaseSearchParamsFromJson(Map json) => aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) diff --git a/packages/client_search/lib/src/model/base_search_params_without_query.dart b/packages/client_search/lib/src/model/base_search_params_without_query.dart index 14e2e6e..2bd2014 100644 --- a/packages/client_search/lib/src/model/base_search_params_without_query.dart +++ b/packages/client_search/lib/src/model/base_search_params_without_query.dart @@ -135,9 +135,11 @@ final class BaseSearchParamsWithoutQuery { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -245,7 +247,7 @@ final class BaseSearchParamsWithoutQuery { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + diff --git a/packages/client_search/lib/src/model/base_search_params_without_query.g.dart b/packages/client_search/lib/src/model/base_search_params_without_query.g.dart index 02715e2..f881eaf 100644 --- a/packages/client_search/lib/src/model/base_search_params_without_query.g.dart +++ b/packages/client_search/lib/src/model/base_search_params_without_query.g.dart @@ -38,13 +38,7 @@ BaseSearchParamsWithoutQuery _$BaseSearchParamsWithoutQueryFromJson( aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) diff --git a/packages/client_search/lib/src/model/browse_params_object.dart b/packages/client_search/lib/src/model/browse_params_object.dart index 12fc0bd..5625ddc 100644 --- a/packages/client_search/lib/src/model/browse_params_object.dart +++ b/packages/client_search/lib/src/model/browse_params_object.dart @@ -87,7 +87,6 @@ final class BrowseParamsObject { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -193,9 +192,11 @@ final class BrowseParamsObject { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -364,9 +365,11 @@ final class BrowseParamsObject { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -403,11 +406,6 @@ final class BrowseParamsObject { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -514,7 +512,6 @@ final class BrowseParamsObject { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -545,7 +542,7 @@ final class BrowseParamsObject { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + @@ -586,7 +583,7 @@ final class BrowseParamsObject { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -595,7 +592,6 @@ final class BrowseParamsObject { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/client_search/lib/src/model/browse_params_object.g.dart b/packages/client_search/lib/src/model/browse_params_object.g.dart index 12bc6a2..14d2186 100644 --- a/packages/client_search/lib/src/model/browse_params_object.g.dart +++ b/packages/client_search/lib/src/model/browse_params_object.g.dart @@ -38,13 +38,7 @@ BrowseParamsObject _$BrowseParamsObjectFromJson(Map json) => aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) @@ -129,8 +123,7 @@ BrowseParamsObject _$BrowseParamsObjectFromJson(Map json) => ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -152,8 +145,6 @@ BrowseParamsObject _$BrowseParamsObjectFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -264,7 +255,6 @@ Map _$BrowseParamsObjectToJson(BrowseParamsObject instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/client_search/lib/src/model/consequence_params.dart b/packages/client_search/lib/src/model/consequence_params.dart index d4411f6..b818dfa 100644 --- a/packages/client_search/lib/src/model/consequence_params.dart +++ b/packages/client_search/lib/src/model/consequence_params.dart @@ -86,7 +86,6 @@ final class ConsequenceParams { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -190,9 +189,11 @@ final class ConsequenceParams { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -361,9 +362,11 @@ final class ConsequenceParams { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -400,11 +403,6 @@ final class ConsequenceParams { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -524,7 +522,6 @@ final class ConsequenceParams { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -556,7 +553,7 @@ final class ConsequenceParams { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + @@ -597,7 +594,7 @@ final class ConsequenceParams { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -606,7 +603,6 @@ final class ConsequenceParams { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/client_search/lib/src/model/consequence_params.g.dart b/packages/client_search/lib/src/model/consequence_params.g.dart index 82861f7..91f10eb 100644 --- a/packages/client_search/lib/src/model/consequence_params.g.dart +++ b/packages/client_search/lib/src/model/consequence_params.g.dart @@ -37,13 +37,7 @@ ConsequenceParams _$ConsequenceParamsFromJson(Map json) => aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) @@ -128,8 +122,7 @@ ConsequenceParams _$ConsequenceParamsFromJson(Map json) => ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -151,8 +144,6 @@ ConsequenceParams _$ConsequenceParamsFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -266,7 +257,6 @@ Map _$ConsequenceParamsToJson(ConsequenceParams instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/client_search/lib/src/model/delete_by_params.dart b/packages/client_search/lib/src/model/delete_by_params.dart index 68c7f48..787bcaf 100644 --- a/packages/client_search/lib/src/model/delete_by_params.dart +++ b/packages/client_search/lib/src/model/delete_by_params.dart @@ -54,9 +54,11 @@ final class DeleteByParams { @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -83,7 +85,7 @@ final class DeleteByParams { tagFilters.hashCode + aroundLatLng.hashCode + aroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode; factory DeleteByParams.fromJson(Map json) => diff --git a/packages/client_search/lib/src/model/delete_by_params.g.dart b/packages/client_search/lib/src/model/delete_by_params.g.dart index 5aedc36..48cd7be 100644 --- a/packages/client_search/lib/src/model/delete_by_params.g.dart +++ b/packages/client_search/lib/src/model/delete_by_params.g.dart @@ -18,13 +18,7 @@ DeleteByParams _$DeleteByParamsFromJson(Map json) => tagFilters: $checkedConvert('tagFilters', (v) => v), aroundLatLng: $checkedConvert('aroundLatLng', (v) => v as String?), aroundRadius: $checkedConvert('aroundRadius', (v) => v), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) diff --git a/packages/client_search/lib/src/model/index_settings.dart b/packages/client_search/lib/src/model/index_settings.dart index 019daf5..21f010e 100644 --- a/packages/client_search/lib/src/model/index_settings.dart +++ b/packages/client_search/lib/src/model/index_settings.dart @@ -35,6 +35,7 @@ final class IndexSettings { this.userData, this.customNormalization, this.attributeForDistinct, + this.maxFacetHits, this.attributesToRetrieve, this.ranking, this.customRanking, @@ -72,7 +73,6 @@ final class IndexSettings { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -150,6 +150,11 @@ final class IndexSettings { @JsonKey(name: r'attributeForDistinct') final String? attributeForDistinct; + /// 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). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + /// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. @JsonKey(name: r'attributesToRetrieve') final List? attributesToRetrieve; @@ -267,9 +272,11 @@ final class IndexSettings { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -306,11 +313,6 @@ final class IndexSettings { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -361,6 +363,7 @@ final class IndexSettings { other.userData == userData && other.customNormalization == customNormalization && other.attributeForDistinct == attributeForDistinct && + other.maxFacetHits == maxFacetHits && other.attributesToRetrieve == attributesToRetrieve && other.ranking == ranking && other.customRanking == customRanking && @@ -400,7 +403,6 @@ final class IndexSettings { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -428,6 +430,7 @@ final class IndexSettings { userData.hashCode + customNormalization.hashCode + attributeForDistinct.hashCode + + maxFacetHits.hashCode + attributesToRetrieve.hashCode + ranking.hashCode + customRanking.hashCode + @@ -456,7 +459,7 @@ final class IndexSettings { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -465,7 +468,6 @@ final class IndexSettings { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/client_search/lib/src/model/index_settings.g.dart b/packages/client_search/lib/src/model/index_settings.g.dart index 2132b6d..87e6c4c 100644 --- a/packages/client_search/lib/src/model/index_settings.g.dart +++ b/packages/client_search/lib/src/model/index_settings.g.dart @@ -55,6 +55,8 @@ IndexSettings _$IndexSettingsFromJson(Map json) => )), attributeForDistinct: $checkedConvert('attributeForDistinct', (v) => v as String?), + maxFacetHits: + $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), attributesToRetrieve: $checkedConvert('attributesToRetrieve', (v) => (v as List?)?.map((e) => e as String).toList()), ranking: $checkedConvert('ranking', @@ -113,8 +115,7 @@ IndexSettings _$IndexSettingsFromJson(Map json) => ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -136,8 +137,6 @@ IndexSettings _$IndexSettingsFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -188,6 +187,7 @@ Map _$IndexSettingsToJson(IndexSettings instance) { writeNotNull('userData', instance.userData); writeNotNull('customNormalization', instance.customNormalization); writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('attributesToRetrieve', instance.attributesToRetrieve); writeNotNull('ranking', instance.ranking); writeNotNull('customRanking', instance.customRanking); @@ -234,7 +234,6 @@ Map _$IndexSettingsToJson(IndexSettings instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/client_search/lib/src/model/index_settings_as_search_params.dart b/packages/client_search/lib/src/model/index_settings_as_search_params.dart index 6a770d0..4c8cdfe 100644 --- a/packages/client_search/lib/src/model/index_settings_as_search_params.dart +++ b/packages/client_search/lib/src/model/index_settings_as_search_params.dart @@ -55,7 +55,6 @@ final class IndexSettingsAsSearchParams { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -181,9 +180,11 @@ final class IndexSettingsAsSearchParams { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -220,11 +221,6 @@ final class IndexSettingsAsSearchParams { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -295,7 +291,6 @@ final class IndexSettingsAsSearchParams { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -334,7 +329,7 @@ final class IndexSettingsAsSearchParams { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -343,7 +338,6 @@ final class IndexSettingsAsSearchParams { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/client_search/lib/src/model/index_settings_as_search_params.g.dart b/packages/client_search/lib/src/model/index_settings_as_search_params.g.dart index d0bc710..d91c840 100644 --- a/packages/client_search/lib/src/model/index_settings_as_search_params.g.dart +++ b/packages/client_search/lib/src/model/index_settings_as_search_params.g.dart @@ -71,8 +71,7 @@ IndexSettingsAsSearchParams _$IndexSettingsAsSearchParamsFromJson( ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -94,8 +93,6 @@ IndexSettingsAsSearchParams _$IndexSettingsAsSearchParamsFromJson( $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -172,7 +169,6 @@ Map _$IndexSettingsAsSearchParamsToJson( 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/client_search/lib/src/model/search_for_facets.dart b/packages/client_search/lib/src/model/search_for_facets.dart index a31d480..c97e484 100644 --- a/packages/client_search/lib/src/model/search_for_facets.dart +++ b/packages/client_search/lib/src/model/search_for_facets.dart @@ -89,7 +89,6 @@ final class SearchForFacets { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -99,6 +98,7 @@ final class SearchForFacets { required this.facet, required this.indexName, this.facetQuery, + this.maxFacetHits, required this.type, }); @@ -202,9 +202,11 @@ final class SearchForFacets { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -373,9 +375,11 @@ final class SearchForFacets { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -412,11 +416,6 @@ final class SearchForFacets { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -456,6 +455,11 @@ final class SearchForFacets { @JsonKey(name: r'facetQuery') final String? facetQuery; + /// 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). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + @JsonKey(name: r'type') final SearchTypeFacet type; @@ -535,7 +539,6 @@ final class SearchForFacets { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -546,6 +549,7 @@ final class SearchForFacets { other.facet == facet && other.indexName == indexName && other.facetQuery == facetQuery && + other.maxFacetHits == maxFacetHits && other.type == type; @override @@ -570,7 +574,7 @@ final class SearchForFacets { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + @@ -611,7 +615,7 @@ final class SearchForFacets { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -620,7 +624,6 @@ final class SearchForFacets { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + @@ -630,6 +633,7 @@ final class SearchForFacets { facet.hashCode + indexName.hashCode + facetQuery.hashCode + + maxFacetHits.hashCode + type.hashCode; factory SearchForFacets.fromJson(Map json) => diff --git a/packages/client_search/lib/src/model/search_for_facets.g.dart b/packages/client_search/lib/src/model/search_for_facets.g.dart index cc577ea..10156ef 100644 --- a/packages/client_search/lib/src/model/search_for_facets.g.dart +++ b/packages/client_search/lib/src/model/search_for_facets.g.dart @@ -39,13 +39,7 @@ SearchForFacets _$SearchForFacetsFromJson(Map json) => aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) @@ -130,8 +124,7 @@ SearchForFacets _$SearchForFacetsFromJson(Map json) => ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -153,8 +146,6 @@ SearchForFacets _$SearchForFacetsFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -173,6 +164,8 @@ SearchForFacets _$SearchForFacetsFromJson(Map json) => facet: $checkedConvert('facet', (v) => v as String), indexName: $checkedConvert('indexName', (v) => v as String), facetQuery: $checkedConvert('facetQuery', (v) => v as String?), + maxFacetHits: + $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), type: $checkedConvert( 'type', (v) => $enumDecode(_$SearchTypeFacetEnumMap, v)), ); @@ -270,7 +263,6 @@ Map _$SearchForFacetsToJson(SearchForFacets instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', @@ -281,6 +273,7 @@ Map _$SearchForFacetsToJson(SearchForFacets instance) { val['facet'] = instance.facet; val['indexName'] = instance.indexName; writeNotNull('facetQuery', instance.facetQuery); + writeNotNull('maxFacetHits', instance.maxFacetHits); val['type'] = instance.type.toJson(); return val; } diff --git a/packages/client_search/lib/src/model/search_for_hits.dart b/packages/client_search/lib/src/model/search_for_hits.dart index 89529e6..1c8da98 100644 --- a/packages/client_search/lib/src/model/search_for_hits.dart +++ b/packages/client_search/lib/src/model/search_for_hits.dart @@ -89,7 +89,6 @@ final class SearchForHits { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -200,9 +199,11 @@ final class SearchForHits { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -371,9 +372,11 @@ final class SearchForHits { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -410,11 +413,6 @@ final class SearchForHits { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -525,7 +523,6 @@ final class SearchForHits { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -558,7 +555,7 @@ final class SearchForHits { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + @@ -599,7 +596,7 @@ final class SearchForHits { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -608,7 +605,6 @@ final class SearchForHits { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/client_search/lib/src/model/search_for_hits.g.dart b/packages/client_search/lib/src/model/search_for_hits.g.dart index 3ffb21a..6fbd471 100644 --- a/packages/client_search/lib/src/model/search_for_hits.g.dart +++ b/packages/client_search/lib/src/model/search_for_hits.g.dart @@ -39,13 +39,7 @@ SearchForHits _$SearchForHitsFromJson(Map json) => aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) @@ -130,8 +124,7 @@ SearchForHits _$SearchForHitsFromJson(Map json) => ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -153,8 +146,6 @@ SearchForHits _$SearchForHitsFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -268,7 +259,6 @@ Map _$SearchForHitsToJson(SearchForHits instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/client_search/lib/src/model/search_params_object.dart b/packages/client_search/lib/src/model/search_params_object.dart index fb0c972..9872e6a 100644 --- a/packages/client_search/lib/src/model/search_params_object.dart +++ b/packages/client_search/lib/src/model/search_params_object.dart @@ -87,7 +87,6 @@ final class SearchParamsObject { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -192,9 +191,11 @@ final class SearchParamsObject { @JsonKey(name: r'minimumAroundRadius') final int? minimumAroundRadius; - /// 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). + /// One of types: + /// - [List>] + /// - [String] @JsonKey(name: r'insideBoundingBox') - final List>? insideBoundingBox; + final dynamic insideBoundingBox; /// 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`. @JsonKey(name: r'insidePolygon') @@ -363,9 +364,11 @@ final class SearchParamsObject { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -402,11 +405,6 @@ final class SearchParamsObject { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -509,7 +507,6 @@ final class SearchParamsObject { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -539,7 +536,7 @@ final class SearchParamsObject { aroundRadius.hashCode + aroundPrecision.hashCode + minimumAroundRadius.hashCode + - insideBoundingBox.hashCode + + (insideBoundingBox == null ? 0 : insideBoundingBox.hashCode) + insidePolygon.hashCode + naturalLanguages.hashCode + ruleContexts.hashCode + @@ -580,7 +577,7 @@ final class SearchParamsObject { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -589,7 +586,6 @@ final class SearchParamsObject { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/client_search/lib/src/model/search_params_object.g.dart b/packages/client_search/lib/src/model/search_params_object.g.dart index 7cd278b..8b20770 100644 --- a/packages/client_search/lib/src/model/search_params_object.g.dart +++ b/packages/client_search/lib/src/model/search_params_object.g.dart @@ -38,13 +38,7 @@ SearchParamsObject _$SearchParamsObjectFromJson(Map json) => aroundPrecision: $checkedConvert('aroundPrecision', (v) => v), minimumAroundRadius: $checkedConvert( 'minimumAroundRadius', (v) => (v as num?)?.toInt()), - insideBoundingBox: $checkedConvert( - 'insideBoundingBox', - (v) => (v as List?) - ?.map((e) => (e as List) - .map((e) => (e as num).toDouble()) - .toList()) - .toList()), + insideBoundingBox: $checkedConvert('insideBoundingBox', (v) => v), insidePolygon: $checkedConvert( 'insidePolygon', (v) => (v as List?) @@ -129,8 +123,7 @@ SearchParamsObject _$SearchParamsObjectFromJson(Map json) => ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -152,8 +145,6 @@ SearchParamsObject _$SearchParamsObjectFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -263,7 +254,6 @@ Map _$SearchParamsObjectToJson(SearchParamsObject instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity', diff --git a/packages/client_search/lib/src/model/settings_response.dart b/packages/client_search/lib/src/model/settings_response.dart index 4144968..8897baf 100644 --- a/packages/client_search/lib/src/model/settings_response.dart +++ b/packages/client_search/lib/src/model/settings_response.dart @@ -35,6 +35,7 @@ final class SettingsResponse { this.userData, this.customNormalization, this.attributeForDistinct, + this.maxFacetHits, this.attributesToRetrieve, this.ranking, this.customRanking, @@ -72,7 +73,6 @@ final class SettingsResponse { this.replaceSynonymsInHighlight, this.minProximity, this.responseFields, - this.maxFacetHits, this.maxValuesPerFacet, this.sortFacetValuesBy, this.attributeCriteriaComputedByMinProximity, @@ -151,6 +151,11 @@ final class SettingsResponse { @JsonKey(name: r'attributeForDistinct') final String? attributeForDistinct; + /// 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). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + /// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. @JsonKey(name: r'attributesToRetrieve') final List? attributesToRetrieve; @@ -268,9 +273,11 @@ final class SettingsResponse { @JsonKey(name: r'advancedSyntax') final bool? advancedSyntax; - /// 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). + /// One of types: + /// - [String] + /// - [List] @JsonKey(name: r'optionalWords') - final List? optionalWords; + final dynamic optionalWords; /// 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. @JsonKey(name: r'disableExactOnAttributes') @@ -307,11 +314,6 @@ final class SettingsResponse { @JsonKey(name: r'responseFields') final List? responseFields; - /// 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). - // maximum: 100 - @JsonKey(name: r'maxFacetHits') - final int? maxFacetHits; - /// Maximum number of facet values to return for each facet. // maximum: 1000 @JsonKey(name: r'maxValuesPerFacet') @@ -366,6 +368,7 @@ final class SettingsResponse { other.userData == userData && other.customNormalization == customNormalization && other.attributeForDistinct == attributeForDistinct && + other.maxFacetHits == maxFacetHits && other.attributesToRetrieve == attributesToRetrieve && other.ranking == ranking && other.customRanking == customRanking && @@ -405,7 +408,6 @@ final class SettingsResponse { other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && other.minProximity == minProximity && other.responseFields == responseFields && - other.maxFacetHits == maxFacetHits && other.maxValuesPerFacet == maxValuesPerFacet && other.sortFacetValuesBy == sortFacetValuesBy && other.attributeCriteriaComputedByMinProximity == @@ -434,6 +436,7 @@ final class SettingsResponse { userData.hashCode + customNormalization.hashCode + attributeForDistinct.hashCode + + maxFacetHits.hashCode + attributesToRetrieve.hashCode + ranking.hashCode + customRanking.hashCode + @@ -462,7 +465,7 @@ final class SettingsResponse { mode.hashCode + semanticSearch.hashCode + advancedSyntax.hashCode + - optionalWords.hashCode + + (optionalWords == null ? 0 : optionalWords.hashCode) + disableExactOnAttributes.hashCode + exactOnSingleWordQuery.hashCode + alternativesAsExact.hashCode + @@ -471,7 +474,6 @@ final class SettingsResponse { replaceSynonymsInHighlight.hashCode + minProximity.hashCode + responseFields.hashCode + - maxFacetHits.hashCode + maxValuesPerFacet.hashCode + sortFacetValuesBy.hashCode + attributeCriteriaComputedByMinProximity.hashCode + diff --git a/packages/client_search/lib/src/model/settings_response.g.dart b/packages/client_search/lib/src/model/settings_response.g.dart index 07cbbdf..4a5dc18 100644 --- a/packages/client_search/lib/src/model/settings_response.g.dart +++ b/packages/client_search/lib/src/model/settings_response.g.dart @@ -55,6 +55,8 @@ SettingsResponse _$SettingsResponseFromJson(Map json) => )), attributeForDistinct: $checkedConvert('attributeForDistinct', (v) => v as String?), + maxFacetHits: + $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), attributesToRetrieve: $checkedConvert('attributesToRetrieve', (v) => (v as List?)?.map((e) => e as String).toList()), ranking: $checkedConvert('ranking', @@ -113,8 +115,7 @@ SettingsResponse _$SettingsResponseFromJson(Map json) => ? null : SemanticSearch.fromJson(v as Map)), advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), - optionalWords: $checkedConvert('optionalWords', - (v) => (v as List?)?.map((e) => e as String).toList()), + optionalWords: $checkedConvert('optionalWords', (v) => v), disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', (v) => (v as List?)?.map((e) => e as String).toList()), exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', @@ -136,8 +137,6 @@ SettingsResponse _$SettingsResponseFromJson(Map json) => $checkedConvert('minProximity', (v) => (v as num?)?.toInt()), responseFields: $checkedConvert('responseFields', (v) => (v as List?)?.map((e) => e as String).toList()), - maxFacetHits: - $checkedConvert('maxFacetHits', (v) => (v as num?)?.toInt()), maxValuesPerFacet: $checkedConvert('maxValuesPerFacet', (v) => (v as num?)?.toInt()), sortFacetValuesBy: @@ -189,6 +188,7 @@ Map _$SettingsResponseToJson(SettingsResponse instance) { writeNotNull('userData', instance.userData); writeNotNull('customNormalization', instance.customNormalization); writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('attributesToRetrieve', instance.attributesToRetrieve); writeNotNull('ranking', instance.ranking); writeNotNull('customRanking', instance.customRanking); @@ -235,7 +235,6 @@ Map _$SettingsResponseToJson(SettingsResponse instance) { 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); writeNotNull('minProximity', instance.minProximity); writeNotNull('responseFields', instance.responseFields); - writeNotNull('maxFacetHits', instance.maxFacetHits); writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); writeNotNull('attributeCriteriaComputedByMinProximity',