From de2f4097a71b6b28df4994b25ac0e73f3ae81b3e Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Fri, 15 Nov 2024 14:42:21 +0000 Subject: [PATCH] fix(specs): make the searchParams compatible with v4 [skip-bc] (#4108) (generated) [skip ci] Co-authored-by: Pierre Millot --- .../Models/Ingestion/AuthInput.cs | 2 +- .../Models/Ingestion/AuthInputPartial.cs | 2 +- .../Models/QuerySuggestions/Languages.cs | 2 +- .../Models/Recommend/AroundPrecision.cs | 2 +- .../Models/Recommend/FacetFilters.cs | 2 +- .../Models/Recommend/FallbackParams.cs | 34 ++- .../Models/Recommend/HighlightResult.cs | 4 +- .../Models/Recommend/IgnorePlurals.cs | 2 +- .../Models/Recommend/InsideBoundingBox.cs | 217 ++++++++++++++++++ .../Models/Recommend/NumericFilters.cs | 2 +- .../Models/Recommend/OptionalFilters.cs | 2 +- .../Models/Recommend/OptionalWords.cs | 217 ++++++++++++++++++ .../Models/Recommend/ReRankingApplyFilter.cs | 2 +- .../Models/Recommend/RecommendSearchParams.cs | 34 ++- .../Models/Recommend/RemoveStopWords.cs | 2 +- .../Models/Recommend/SnippetResult.cs | 4 +- .../Models/Recommend/TagFilters.cs | 2 +- .../Models/Search/AroundPrecision.cs | 2 +- .../Models/Search/AutomaticFacetFilters.cs | 4 +- .../Models/Search/BrowseParamsObject.cs | 24 +- .../Models/Search/ConsequenceParams.cs | 24 +- .../Models/Search/DeleteByParams.cs | 7 +- .../Models/Search/FacetFilters.cs | 2 +- .../Models/Search/HighlightResult.cs | 4 +- .../Models/Search/IgnorePlurals.cs | 2 +- .../Models/Search/IndexSettings.cs | 27 ++- .../Models/Search/InsideBoundingBox.cs | 217 ++++++++++++++++++ .../Models/Search/NumericFilters.cs | 2 +- .../Models/Search/OptionalFilters.cs | 2 +- .../Models/Search/OptionalWords.cs | 217 ++++++++++++++++++ .../Models/Search/ReRankingApplyFilter.cs | 2 +- .../Models/Search/RemoveStopWords.cs | 2 +- .../Models/Search/SearchForFacets.cs | 34 ++- .../Models/Search/SearchForHits.cs | 24 +- .../Models/Search/SearchParamsObject.cs | 24 +- .../Models/Search/SettingsResponse.cs | 27 ++- .../Models/Search/SnippetResult.cs | 4 +- .../algoliasearch/Models/Search/TagFilters.cs | 2 +- .../lib/src/model/base_index_settings.dart | 12 +- .../lib/src/model/base_index_settings.g.dart | 3 + .../model/base_recommend_index_settings.dart | 18 +- .../base_recommend_index_settings.g.dart | 6 +- .../model/base_recommend_search_params.dart | 8 +- .../model/base_recommend_search_params.g.dart | 8 +- .../lib/src/model/base_search_params.dart | 8 +- .../lib/src/model/base_search_params.g.dart | 8 +- .../base_search_params_without_query.dart | 8 +- .../base_search_params_without_query.g.dart | 8 +- .../lib/src/model/browse_params_object.dart | 24 +- .../lib/src/model/browse_params_object.g.dart | 14 +- .../lib/src/model/consequence_params.dart | 24 +- .../lib/src/model/consequence_params.g.dart | 14 +- .../lib/src/model/fallback_params.dart | 32 +-- .../lib/src/model/fallback_params.g.dart | 17 +- .../lib/src/model/index_settings.dart | 24 +- .../lib/src/model/index_settings.g.dart | 9 +- .../index_settings_as_search_params.dart | 16 +- .../index_settings_as_search_params.g.dart | 6 +- .../src/model/recommend_index_settings.dart | 26 ++- .../src/model/recommend_index_settings.g.dart | 9 +- .../src/model/recommend_search_params.dart | 32 +-- .../src/model/recommend_search_params.g.dart | 17 +- .../lib/src/model/search_for_facets.dart | 32 +-- .../lib/src/model/search_for_facets.g.dart | 17 +- .../lib/src/model/search_for_hits.dart | 24 +- .../lib/src/model/search_for_hits.g.dart | 14 +- .../lib/src/model/search_params_object.dart | 24 +- .../lib/src/model/search_params_object.g.dart | 14 +- .../lib/src/model/settings_response.dart | 24 +- .../lib/src/model/settings_response.g.dart | 9 +- .../lib/src/model/base_index_settings.dart | 12 +- .../lib/src/model/base_index_settings.g.dart | 3 + .../model/base_recommend_index_settings.dart | 18 +- .../base_recommend_index_settings.g.dart | 6 +- .../model/base_recommend_search_params.dart | 8 +- .../model/base_recommend_search_params.g.dart | 8 +- .../lib/src/model/fallback_params.dart | 32 +-- .../lib/src/model/fallback_params.g.dart | 17 +- .../src/model/recommend_index_settings.dart | 26 ++- .../src/model/recommend_index_settings.g.dart | 9 +- .../src/model/recommend_search_params.dart | 32 +-- .../src/model/recommend_search_params.g.dart | 17 +- .../lib/src/model/base_index_settings.dart | 12 +- .../lib/src/model/base_index_settings.g.dart | 3 + .../lib/src/model/base_search_params.dart | 8 +- .../lib/src/model/base_search_params.g.dart | 8 +- .../base_search_params_without_query.dart | 8 +- .../base_search_params_without_query.g.dart | 8 +- .../lib/src/model/browse_params_object.dart | 24 +- .../lib/src/model/browse_params_object.g.dart | 14 +- .../lib/src/model/consequence_params.dart | 24 +- .../lib/src/model/consequence_params.g.dart | 14 +- .../lib/src/model/delete_by_params.dart | 8 +- .../lib/src/model/delete_by_params.g.dart | 8 +- .../lib/src/model/index_settings.dart | 24 +- .../lib/src/model/index_settings.g.dart | 9 +- .../index_settings_as_search_params.dart | 16 +- .../index_settings_as_search_params.g.dart | 6 +- .../lib/src/model/search_for_facets.dart | 32 +-- .../lib/src/model/search_for_facets.g.dart | 17 +- .../lib/src/model/search_for_hits.dart | 24 +- .../lib/src/model/search_for_hits.g.dart | 14 +- .../lib/src/model/search_params_object.dart | 24 +- .../lib/src/model/search_params_object.g.dart | 14 +- .../lib/src/model/settings_response.dart | 24 +- .../lib/src/model/settings_response.g.dart | 9 +- .../recommend/model_fallback_params.go | 184 ++++++++------- .../recommend/model_inside_bounding_box.go | 90 ++++++++ .../algolia/recommend/model_optional_words.go | 90 ++++++++ .../model_recommend_search_params.go | 184 ++++++++------- .../search/model_browse_params_object.go | 139 +++++------ .../search/model_consequence_params.go | 139 +++++------ .../algolia/search/model_delete_by_params.go | 50 ++-- .../algolia/search/model_index_settings.go | 138 ++++++----- .../search/model_inside_bounding_box.go | 90 ++++++++ .../algolia/search/model_optional_words.go | 90 ++++++++ .../algolia/search/model_search_for_facets.go | 188 ++++++++------- .../algolia/search/model_search_for_hits.go | 139 +++++------ .../search/model_search_params_object.go | 139 +++++------ .../algolia/search/model_settings_response.go | 138 ++++++----- .../model/recommend/FallbackParams.java | 96 +++----- .../model/recommend/InsideBoundingBox.java | 111 +++++++++ .../model/recommend/OptionalWords.java | 111 +++++++++ .../recommend/RecommendSearchParams.java | 96 +++----- .../model/search/BrowseParamsObject.java | 75 +----- .../model/search/ConsequenceParams.java | 75 +----- .../algolia/model/search/DeleteByParams.java | 22 +- .../algolia/model/search/IndexSettings.java | 74 ++---- .../model/search/InsideBoundingBox.java | 111 +++++++++ .../algolia/model/search/OptionalWords.java | 111 +++++++++ .../algolia/model/search/SearchForFacets.java | 96 +++----- .../algolia/model/search/SearchForHits.java | 75 +----- .../model/search/SearchParamsObject.java | 75 +----- .../model/search/SettingsResponse.java | 74 ++---- .../packages/algoliasearch/builds/models.ts | 76 +++--- .../lite/model/baseIndexSettings.ts | 5 + .../lite/model/baseRecommendIndexSettings.ts | 11 +- .../lite/model/baseRecommendSearchParams.ts | 6 +- .../model/baseSearchParamsWithoutQuery.ts | 6 +- .../algoliasearch/lite/model/index.ts | 2 + .../lite/model/indexSettingsAsSearchParams.ts | 11 +- .../lite/model/insideBoundingBox.ts | 3 + .../algoliasearch/lite/model/optionalWords.ts | 3 + .../client-composition/model/index.ts | 2 + .../model/insetsQueryParameters.ts | 6 +- .../model/insideBoundingBox.ts | 3 + .../client-composition/model/optionalWords.ts | 3 + .../client-composition/model/params.ts | 6 +- .../client-search/model/baseIndexSettings.ts | 5 + .../model/baseSearchParamsWithoutQuery.ts | 6 +- .../client-search/model/deleteByParams.ts | 6 +- .../packages/client-search/model/index.ts | 2 + .../model/indexSettingsAsSearchParams.ts | 11 +- .../client-search/model/insideBoundingBox.ts | 3 + .../client-search/model/optionalWords.ts | 3 + .../recommend/model/baseIndexSettings.ts | 5 + .../model/baseRecommendIndexSettings.ts | 11 +- .../model/baseRecommendSearchParams.ts | 6 +- .../packages/recommend/model/index.ts | 2 + .../recommend/model/insideBoundingBox.ts | 3 + .../packages/recommend/model/optionalWords.ts | 3 + .../client/model/recommend/FallbackParams.kt | 18 +- .../model/recommend/InsideBoundingBox.kt | 49 ++++ .../client/model/recommend/OptionalWords.kt | 49 ++++ .../model/recommend/RecommendSearchParams.kt | 18 +- .../client/model/search/BrowseParamsObject.kt | 14 +- .../client/model/search/ConsequenceParams.kt | 14 +- .../client/model/search/DeleteByParams.kt | 5 +- .../client/model/search/IndexSettings.kt | 13 +- .../client/model/search/InsideBoundingBox.kt | 49 ++++ .../client/model/search/OptionalWords.kt | 49 ++++ .../client/model/search/SearchForFacets.kt | 18 +- .../client/model/search/SearchForHits.kt | 14 +- .../client/model/search/SearchParamsObject.kt | 14 +- .../client/model/search/SettingsResponse.kt | 13 +- .../lib/Api/SearchClient.php | 2 +- .../lib/Model/Recommend/FallbackParams.php | 78 +++---- .../lib/Model/Recommend/InsideBoundingBox.php | 188 +++++++++++++++ .../lib/Model/Recommend/OptionalWords.php | 188 +++++++++++++++ .../Model/Recommend/RecommendSearchParams.php | 78 +++---- .../lib/Model/Search/BrowseParams.php | 46 +--- .../lib/Model/Search/BrowseParamsObject.php | 46 +--- .../lib/Model/Search/ConsequenceParams.php | 46 +--- .../lib/Model/Search/DeleteByParams.php | 8 +- .../lib/Model/Search/IndexSettings.php | 70 +++--- .../lib/Model/Search/InsideBoundingBox.php | 188 +++++++++++++++ .../lib/Model/Search/OptionalWords.php | 188 +++++++++++++++ .../lib/Model/Search/SearchForFacets.php | 78 +++---- .../lib/Model/Search/SearchForHits.php | 46 +--- .../lib/Model/Search/SearchParams.php | 46 +--- .../lib/Model/Search/SearchParamsObject.php | 46 +--- .../lib/Model/Search/SearchQuery.php | 78 +++---- .../lib/Model/Search/SettingsResponse.php | 70 +++--- .../recommend/models/fallback_params.py | 24 +- .../recommend/models/inside_bounding_box.py | 110 +++++++++ .../recommend/models/optional_words.py | 110 +++++++++ .../models/recommend_search_params.py | 24 +- .../search/models/browse_params_object.py | 21 +- .../search/models/consequence_params.py | 21 +- .../search/models/delete_by_params.py | 9 +- .../search/models/index_settings.py | 15 +- .../search/models/inside_bounding_box.py | 110 +++++++++ .../search/models/optional_words.py | 110 +++++++++ .../search/models/search_for_facets.py | 24 +- .../search/models/search_for_hits.py | 21 +- .../search/models/search_params_object.py | 21 +- .../search/models/settings_response.py | 15 +- .../models/recommend/fallback_params.rb | 41 ++-- .../models/recommend/inside_bounding_box.rb | 108 +++++++++ .../models/recommend/optional_words.rb | 108 +++++++++ .../recommend/recommend_search_params.rb | 41 ++-- .../models/search/browse_params_object.rb | 30 +-- .../models/search/consequence_params.rb | 30 +-- .../algolia/models/search/delete_by_params.rb | 11 +- .../algolia/models/search/index_settings.rb | 33 ++- .../models/search/inside_bounding_box.rb | 108 +++++++++ .../algolia/models/search/optional_words.rb | 108 +++++++++ .../models/search/search_for_facets.rb | 41 ++-- .../algolia/models/search/search_for_hits.rb | 30 +-- .../models/search/search_params_object.rb | 30 +-- .../models/search/settings_response.rb | 33 ++- .../recommend/BaseIndexSettings.scala | 6 +- .../BaseRecommendIndexSettings.scala | 19 +- .../recommend/BaseRecommendSearchParams.scala | 7 +- .../recommend/FallbackParams.scala | 30 +-- .../recommend/InsideBoundingBox.scala | 70 ++++++ .../algoliasearch/recommend/JsonSupport.scala | 2 + .../recommend/OptionalWords.scala | 69 ++++++ .../recommend/RecommendIndexSettings.scala | 23 +- .../recommend/RecommendSearchParams.scala | 30 +-- .../search/BaseIndexSettings.scala | 6 +- .../search/BaseSearchParams.scala | 7 +- .../search/BaseSearchParamsWithoutQuery.scala | 7 +- .../search/BrowseParamsObject.scala | 26 +-- .../search/ConsequenceParams.scala | 26 +-- .../algoliasearch/search/DeleteByParams.scala | 7 +- .../algoliasearch/search/IndexSettings.scala | 23 +- .../search/IndexSettingsAsSearchParams.scala | 19 +- .../search/InsideBoundingBox.scala | 74 ++++++ .../algoliasearch/search/JsonSupport.scala | 2 + .../algoliasearch/search/OptionalWords.scala | 73 ++++++ .../search/SearchForFacets.scala | 30 +-- .../algoliasearch/search/SearchForHits.scala | 26 +-- .../search/SearchParamsObject.scala | 26 +-- .../search/SettingsResponse.scala | 23 +- .../Models/BaseRecommendIndexSettings.swift | 25 +- .../Models/BaseRecommendSearchParams.swift | 7 +- .../Recommend/Models/FallbackParams.swift | 41 ++-- .../Models/RecommendBaseIndexSettings.swift | 13 +- .../Models/RecommendIndexSettings.swift | 34 +-- .../Models/RecommendInsideBoundingBox.swift | 51 ++++ .../Models/RecommendOptionalWords.swift | 51 ++++ .../Models/RecommendSearchParams.swift | 41 ++-- .../Search/Models/BrowseParamsObject.swift | 32 +-- .../Search/Models/DeleteByParams.swift | 7 +- .../Sources/Search/Models/IndexSettings.swift | 34 +-- .../Models/SearchBaseIndexSettings.swift | 13 +- .../Models/SearchBaseSearchParams.swift | 7 +- .../SearchBaseSearchParamsWithoutQuery.swift | 7 +- .../Models/SearchConsequenceParams.swift | 32 +-- .../Search/Models/SearchForFacets.swift | 41 ++-- .../Sources/Search/Models/SearchForHits.swift | 32 +-- .../SearchIndexSettingsAsSearchParams.swift | 25 +- .../Models/SearchInsideBoundingBox.swift | 51 ++++ .../Search/Models/SearchOptionalWords.swift | 51 ++++ .../Models/SearchSearchParamsObject.swift | 32 +-- .../Search/Models/SettingsResponse.swift | 34 +-- docs/bundled/search-snippets.json | 10 +- docs/snippets/csharp/src/Search.cs | 2 +- docs/snippets/go/src/search.go | 4 +- .../src/test/java/com/algolia/Search.java | 2 +- .../kotlin/com/algolia/snippets/Search.kt | 2 +- docs/snippets/swift/Sources/Search.swift | 2 +- specs/bundled/algoliasearch.yml | 177 ++++++-------- specs/bundled/composition.doc.yml | 110 +++++---- specs/bundled/composition.yml | 106 +++++---- specs/bundled/crawler.doc.yml | 121 +++++----- specs/bundled/crawler.yml | 121 +++++----- specs/bundled/recommend.doc.yml | 38 +-- specs/bundled/recommend.yml | 36 +-- specs/bundled/search.doc.yml | 132 ++++++----- specs/bundled/search.yml | 128 ++++++----- .../src/generated/client/Search.test.cs | 2 +- .../src/generated/requests/Search.test.cs | 16 +- tests/output/go/tests/client/search_test.go | 4 +- tests/output/go/tests/requests/search_test.go | 12 +- .../java/com/algolia/client/Search.test.java | 2 +- .../com/algolia/requests/Search.test.java | 8 +- .../kotlin/com/algolia/client/SearchTest.kt | 2 +- .../kotlin/com/algolia/requests/SearchTest.kt | 6 +- .../algoliasearch/requests/SearchTest.scala | 7 +- .../swift/Tests/client/SearchTests.swift | 2 +- .../swift/Tests/requests/SearchTests.swift | 15 +- 293 files changed, 6894 insertions(+), 4122 deletions(-) create mode 100644 clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/InsideBoundingBox.cs create mode 100644 clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/OptionalWords.cs create mode 100644 clients/algoliasearch-client-csharp/algoliasearch/Models/Search/InsideBoundingBox.cs create mode 100644 clients/algoliasearch-client-csharp/algoliasearch/Models/Search/OptionalWords.cs create mode 100644 clients/algoliasearch-client-go/algolia/recommend/model_inside_bounding_box.go create mode 100644 clients/algoliasearch-client-go/algolia/recommend/model_optional_words.go create mode 100644 clients/algoliasearch-client-go/algolia/search/model_inside_bounding_box.go create mode 100644 clients/algoliasearch-client-go/algolia/search/model_optional_words.go create mode 100644 clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/InsideBoundingBox.java create mode 100644 clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/OptionalWords.java create mode 100644 clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/InsideBoundingBox.java create mode 100644 clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/OptionalWords.java create mode 100644 clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/insideBoundingBox.ts create mode 100644 clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/optionalWords.ts create mode 100644 clients/algoliasearch-client-javascript/packages/client-composition/model/insideBoundingBox.ts create mode 100644 clients/algoliasearch-client-javascript/packages/client-composition/model/optionalWords.ts create mode 100644 clients/algoliasearch-client-javascript/packages/client-search/model/insideBoundingBox.ts create mode 100644 clients/algoliasearch-client-javascript/packages/client-search/model/optionalWords.ts create mode 100644 clients/algoliasearch-client-javascript/packages/recommend/model/insideBoundingBox.ts create mode 100644 clients/algoliasearch-client-javascript/packages/recommend/model/optionalWords.ts create mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/InsideBoundingBox.kt create mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/OptionalWords.kt create mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/InsideBoundingBox.kt create mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/OptionalWords.kt create mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/InsideBoundingBox.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/OptionalWords.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Search/InsideBoundingBox.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Search/OptionalWords.php create mode 100644 clients/algoliasearch-client-python/algoliasearch/recommend/models/inside_bounding_box.py create mode 100644 clients/algoliasearch-client-python/algoliasearch/recommend/models/optional_words.py create mode 100644 clients/algoliasearch-client-python/algoliasearch/search/models/inside_bounding_box.py create mode 100644 clients/algoliasearch-client-python/algoliasearch/search/models/optional_words.py create mode 100644 clients/algoliasearch-client-ruby/lib/algolia/models/recommend/inside_bounding_box.rb create mode 100644 clients/algoliasearch-client-ruby/lib/algolia/models/recommend/optional_words.rb create mode 100644 clients/algoliasearch-client-ruby/lib/algolia/models/search/inside_bounding_box.rb create mode 100644 clients/algoliasearch-client-ruby/lib/algolia/models/search/optional_words.rb create mode 100644 clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/InsideBoundingBox.scala create mode 100644 clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/OptionalWords.scala create mode 100644 clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/InsideBoundingBox.scala create mode 100644 clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/OptionalWords.scala create mode 100644 clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendInsideBoundingBox.swift create mode 100644 clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendOptionalWords.swift create mode 100644 clients/algoliasearch-client-swift/Sources/Search/Models/SearchInsideBoundingBox.swift create mode 100644 clients/algoliasearch-client-swift/Sources/Search/Models/SearchOptionalWords.swift diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthInput.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthInput.cs index 595953151c..57169ecaf2 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthInput.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthInput.cs @@ -84,7 +84,7 @@ public AuthInput(AuthAlgoliaInsights actualInstance) /// Initializes a new instance of the AuthInput class /// with a Dictionary{string, string} /// - /// An instance of Dictionary<string, string>. + /// An instance of Dictionary. public AuthInput(Dictionary actualInstance) { ActualInstance = actualInstance; diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthInputPartial.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthInputPartial.cs index 31a178c43d..a7b3ebd507 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthInputPartial.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthInputPartial.cs @@ -84,7 +84,7 @@ public AuthInputPartial(AuthAlgoliaInsightsPartial actualInstance) /// Initializes a new instance of the AuthInputPartial class /// with a Dictionary{string, string} /// - /// An instance of Dictionary<string, string>. + /// An instance of Dictionary. public AuthInputPartial(Dictionary actualInstance) { ActualInstance = actualInstance; diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/QuerySuggestions/Languages.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/QuerySuggestions/Languages.cs index 6c1903f010..937a88df3b 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/QuerySuggestions/Languages.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/QuerySuggestions/Languages.cs @@ -24,7 +24,7 @@ public partial class Languages : AbstractSchema /// Initializes a new instance of the Languages class /// with a List{String} /// - /// An instance of List<string>. + /// An instance of List. public Languages(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/AroundPrecision.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/AroundPrecision.cs index 16ce85dfd4..043f257423 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/AroundPrecision.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/AroundPrecision.cs @@ -34,7 +34,7 @@ public AroundPrecision(int actualInstance) /// Initializes a new instance of the AroundPrecision class /// with a List{Range} /// - /// An instance of List<Range>. + /// An instance of List. public AroundPrecision(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/FacetFilters.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/FacetFilters.cs index a59ad0b297..34cb46f033 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/FacetFilters.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/FacetFilters.cs @@ -24,7 +24,7 @@ public partial class FacetFilters : AbstractSchema /// Initializes a new instance of the FacetFilters class /// with a List{FacetFilters} /// - /// An instance of List<FacetFilters>. + /// An instance of List. public FacetFilters(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/FallbackParams.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/FallbackParams.cs index 7b604ea892..c2cc4db404 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/FallbackParams.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/FallbackParams.cs @@ -141,11 +141,10 @@ public FallbackParams() public int? MinimumAroundRadius { get; set; } /// - /// 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). + /// Gets or Sets InsideBoundingBox /// - /// 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). [JsonPropertyName("insideBoundingBox")] - public List> InsideBoundingBox { get; set; } + public InsideBoundingBox InsideBoundingBox { get; set; } /// /// 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`. @@ -357,6 +356,13 @@ public FallbackParams() [JsonPropertyName("attributeForDistinct")] public string AttributeForDistinct { get; set; } + /// + /// 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 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). + [JsonPropertyName("maxFacetHits")] + public int? MaxFacetHits { get; set; } + /// /// 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. /// @@ -502,11 +508,10 @@ public FallbackParams() public bool? AdvancedSyntax { get; set; } /// - /// 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). + /// Gets or Sets OptionalWords /// - /// 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). [JsonPropertyName("optionalWords")] - public List OptionalWords { get; set; } + public OptionalWords OptionalWords { get; set; } /// /// 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. @@ -556,13 +561,6 @@ public FallbackParams() [JsonPropertyName("responseFields")] public List ResponseFields { get; set; } - /// - /// 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 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). - [JsonPropertyName("maxFacetHits")] - public int? MaxFacetHits { get; set; } - /// /// Maximum number of facet values to return for each facet. /// @@ -657,6 +655,7 @@ public override string ToString() sb.Append(" UserData: ").Append(UserData).Append("\n"); sb.Append(" CustomNormalization: ").Append(CustomNormalization).Append("\n"); sb.Append(" AttributeForDistinct: ").Append(AttributeForDistinct).Append("\n"); + sb.Append(" MaxFacetHits: ").Append(MaxFacetHits).Append("\n"); sb.Append(" AttributesToRetrieve: ").Append(AttributesToRetrieve).Append("\n"); sb.Append(" Ranking: ").Append(Ranking).Append("\n"); sb.Append(" RelevancyStrictness: ").Append(RelevancyStrictness).Append("\n"); @@ -689,7 +688,6 @@ public override string ToString() sb.Append(" ReplaceSynonymsInHighlight: ").Append(ReplaceSynonymsInHighlight).Append("\n"); sb.Append(" MinProximity: ").Append(MinProximity).Append("\n"); sb.Append(" ResponseFields: ").Append(ResponseFields).Append("\n"); - sb.Append(" MaxFacetHits: ").Append(MaxFacetHits).Append("\n"); sb.Append(" MaxValuesPerFacet: ").Append(MaxValuesPerFacet).Append("\n"); sb.Append(" SortFacetValuesBy: ").Append(SortFacetValuesBy).Append("\n"); sb.Append(" AttributeCriteriaComputedByMinProximity: ").Append(AttributeCriteriaComputedByMinProximity).Append("\n"); @@ -737,7 +735,7 @@ public override bool Equals(object obj) (AroundRadius == input.AroundRadius || (AroundRadius != null && AroundRadius.Equals(input.AroundRadius))) && (AroundPrecision == input.AroundPrecision || (AroundPrecision != null && AroundPrecision.Equals(input.AroundPrecision))) && (MinimumAroundRadius == input.MinimumAroundRadius || MinimumAroundRadius.Equals(input.MinimumAroundRadius)) && - (InsideBoundingBox == input.InsideBoundingBox || InsideBoundingBox != null && input.InsideBoundingBox != null && InsideBoundingBox.SequenceEqual(input.InsideBoundingBox)) && + (InsideBoundingBox == input.InsideBoundingBox || (InsideBoundingBox != null && InsideBoundingBox.Equals(input.InsideBoundingBox))) && (InsidePolygon == input.InsidePolygon || InsidePolygon != null && input.InsidePolygon != null && InsidePolygon.SequenceEqual(input.InsidePolygon)) && (NaturalLanguages == input.NaturalLanguages || NaturalLanguages != null && input.NaturalLanguages != null && NaturalLanguages.SequenceEqual(input.NaturalLanguages)) && (RuleContexts == input.RuleContexts || RuleContexts != null && input.RuleContexts != null && RuleContexts.SequenceEqual(input.RuleContexts)) && @@ -768,6 +766,7 @@ public override bool Equals(object obj) (UserData == input.UserData || (UserData != null && UserData.Equals(input.UserData))) && (CustomNormalization == input.CustomNormalization || CustomNormalization != null && input.CustomNormalization != null && CustomNormalization.SequenceEqual(input.CustomNormalization)) && (AttributeForDistinct == input.AttributeForDistinct || (AttributeForDistinct != null && AttributeForDistinct.Equals(input.AttributeForDistinct))) && + (MaxFacetHits == input.MaxFacetHits || MaxFacetHits.Equals(input.MaxFacetHits)) && (AttributesToRetrieve == input.AttributesToRetrieve || AttributesToRetrieve != null && input.AttributesToRetrieve != null && AttributesToRetrieve.SequenceEqual(input.AttributesToRetrieve)) && (Ranking == input.Ranking || Ranking != null && input.Ranking != null && Ranking.SequenceEqual(input.Ranking)) && (RelevancyStrictness == input.RelevancyStrictness || RelevancyStrictness.Equals(input.RelevancyStrictness)) && @@ -791,7 +790,7 @@ public override bool Equals(object obj) (QueryType == input.QueryType || QueryType.Equals(input.QueryType)) && (RemoveWordsIfNoResults == input.RemoveWordsIfNoResults || RemoveWordsIfNoResults.Equals(input.RemoveWordsIfNoResults)) && (AdvancedSyntax == input.AdvancedSyntax || AdvancedSyntax.Equals(input.AdvancedSyntax)) && - (OptionalWords == input.OptionalWords || OptionalWords != null && input.OptionalWords != null && OptionalWords.SequenceEqual(input.OptionalWords)) && + (OptionalWords == input.OptionalWords || (OptionalWords != null && OptionalWords.Equals(input.OptionalWords))) && (DisableExactOnAttributes == input.DisableExactOnAttributes || DisableExactOnAttributes != null && input.DisableExactOnAttributes != null && DisableExactOnAttributes.SequenceEqual(input.DisableExactOnAttributes)) && (ExactOnSingleWordQuery == input.ExactOnSingleWordQuery || ExactOnSingleWordQuery.Equals(input.ExactOnSingleWordQuery)) && (AlternativesAsExact == input.AlternativesAsExact || AlternativesAsExact != null && input.AlternativesAsExact != null && AlternativesAsExact.SequenceEqual(input.AlternativesAsExact)) && @@ -800,7 +799,6 @@ public override bool Equals(object obj) (ReplaceSynonymsInHighlight == input.ReplaceSynonymsInHighlight || ReplaceSynonymsInHighlight.Equals(input.ReplaceSynonymsInHighlight)) && (MinProximity == input.MinProximity || MinProximity.Equals(input.MinProximity)) && (ResponseFields == input.ResponseFields || ResponseFields != null && input.ResponseFields != null && ResponseFields.SequenceEqual(input.ResponseFields)) && - (MaxFacetHits == input.MaxFacetHits || MaxFacetHits.Equals(input.MaxFacetHits)) && (MaxValuesPerFacet == input.MaxValuesPerFacet || MaxValuesPerFacet.Equals(input.MaxValuesPerFacet)) && (SortFacetValuesBy == input.SortFacetValuesBy || (SortFacetValuesBy != null && SortFacetValuesBy.Equals(input.SortFacetValuesBy))) && (AttributeCriteriaComputedByMinProximity == input.AttributeCriteriaComputedByMinProximity || AttributeCriteriaComputedByMinProximity.Equals(input.AttributeCriteriaComputedByMinProximity)) && @@ -963,6 +961,7 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + AttributeForDistinct.GetHashCode(); } + hashCode = (hashCode * 59) + MaxFacetHits.GetHashCode(); if (AttributesToRetrieve != null) { hashCode = (hashCode * 59) + AttributesToRetrieve.GetHashCode(); @@ -1049,7 +1048,6 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + ResponseFields.GetHashCode(); } - hashCode = (hashCode * 59) + MaxFacetHits.GetHashCode(); hashCode = (hashCode * 59) + MaxValuesPerFacet.GetHashCode(); if (SortFacetValuesBy != null) { diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/HighlightResult.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/HighlightResult.cs index 17c106918a..0b1ad18dc2 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/HighlightResult.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/HighlightResult.cs @@ -34,7 +34,7 @@ public HighlightResult(HighlightResultOption actualInstance) /// Initializes a new instance of the HighlightResult class /// with a Dictionary{string, HighlightResult} /// - /// An instance of Dictionary<string, HighlightResult>. + /// An instance of Dictionary. public HighlightResult(Dictionary actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); @@ -44,7 +44,7 @@ public HighlightResult(Dictionary actualInstance) /// Initializes a new instance of the HighlightResult class /// with a List{HighlightResult} /// - /// An instance of List<HighlightResult>. + /// An instance of List. public HighlightResult(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/IgnorePlurals.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/IgnorePlurals.cs index f7c39877f4..be85f3b396 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/IgnorePlurals.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/IgnorePlurals.cs @@ -24,7 +24,7 @@ public partial class IgnorePlurals : AbstractSchema /// Initializes a new instance of the IgnorePlurals class /// with a List{SupportedLanguage} /// - /// An instance of List<SupportedLanguage>. + /// An instance of List. public IgnorePlurals(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/InsideBoundingBox.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/InsideBoundingBox.cs new file mode 100644 index 0000000000..606d4d1834 --- /dev/null +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/InsideBoundingBox.cs @@ -0,0 +1,217 @@ +// +// 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. +// +using System; +using System.Text; +using System.Linq; +using System.Text.Json.Serialization; +using System.Collections.Generic; +using Algolia.Search.Serializer; +using System.Text.Json; +using System.IO; +using System.Reflection; +using Algolia.Search.Models.Common; + +namespace Algolia.Search.Models.Recommend; + +/// +/// InsideBoundingBox +/// +[JsonConverter(typeof(InsideBoundingBoxJsonConverter))] +public partial class InsideBoundingBox : AbstractSchema +{ + /// + /// Initializes a new instance of the InsideBoundingBox class. + /// + public InsideBoundingBox() + { + } + + /// + /// Initializes a new instance of the InsideBoundingBox class + /// with a string + /// + /// An instance of string. + public InsideBoundingBox(string actualInstance) + { + ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the InsideBoundingBox class + /// with a List{List{double}} + /// + /// An instance of List>. + public InsideBoundingBox(List> actualInstance) + { + ActualInstance = actualInstance; + } + + + /// + /// Gets or Sets ActualInstance + /// + public sealed override object ActualInstance { get; set; } + + /// + /// Get the actual instance of `string`. If the actual instance is not `string`, + /// the InvalidClassException will be thrown + /// + /// An instance of string + public string AsString() + { + return (string)ActualInstance; + } + + /// + /// Get the actual instance of `List{List{double}}`. If the actual instance is not `List{List{double}}`, + /// the InvalidClassException will be thrown + /// + /// An instance of List<List<double>> + public List> AsListListDouble() + { + return (List>)ActualInstance; + } + + + /// + /// Check if the actual instance is of `string` type. + /// + /// Whether or not the instance is the type + public bool IsString() + { + return ActualInstance.GetType() == typeof(string); + } + + /// + /// Check if the actual instance is of `List{List{double}}` type. + /// + /// Whether or not the instance is the type + public bool IsListListDouble() + { + return ActualInstance.GetType() == typeof(List>); + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class InsideBoundingBox {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonSerializer.Serialize(ActualInstance, JsonConfig.Options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is not InsideBoundingBox input) + { + return false; + } + + return ActualInstance.Equals(input.ActualInstance); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); + return hashCode; + } + } +} + + + + + +/// +/// Custom JSON converter for InsideBoundingBox +/// +public class InsideBoundingBoxJsonConverter : JsonConverter +{ + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return objectType == typeof(InsideBoundingBox); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Serializer options + /// The object converted from the JSON string + public override InsideBoundingBox Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var jsonDocument = JsonDocument.ParseValue(ref reader); + var root = jsonDocument.RootElement; + if (root.ValueKind == JsonValueKind.String) + { + try + { + return new InsideBoundingBox(jsonDocument.Deserialize(JsonConfig.Options)); + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine($"Failed to deserialize into string: {exception}"); + } + } + if (root.ValueKind == JsonValueKind.Array) + { + try + { + return new InsideBoundingBox(jsonDocument.Deserialize>>(JsonConfig.Options)); + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine($"Failed to deserialize into List>: {exception}"); + } + } + throw new InvalidDataException($"The JSON string cannot be deserialized into any schema defined."); + } + + /// + /// To write the JSON string + /// + /// JSON writer + /// InsideBoundingBox to be converted into a JSON string + /// JSON Serializer options + public override void Write(Utf8JsonWriter writer, InsideBoundingBox value, JsonSerializerOptions options) + { + writer.WriteRawValue(value.ToJson()); + } +} + diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/NumericFilters.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/NumericFilters.cs index 5212c2acee..dceb25e717 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/NumericFilters.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/NumericFilters.cs @@ -24,7 +24,7 @@ public partial class NumericFilters : AbstractSchema /// Initializes a new instance of the NumericFilters class /// with a List{NumericFilters} /// - /// An instance of List<NumericFilters>. + /// An instance of List. public NumericFilters(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/OptionalFilters.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/OptionalFilters.cs index c75fd29ffd..ddc3810d7e 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/OptionalFilters.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/OptionalFilters.cs @@ -24,7 +24,7 @@ public partial class OptionalFilters : AbstractSchema /// Initializes a new instance of the OptionalFilters class /// with a List{OptionalFilters} /// - /// An instance of List<OptionalFilters>. + /// An instance of List. public OptionalFilters(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/OptionalWords.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/OptionalWords.cs new file mode 100644 index 0000000000..931347c357 --- /dev/null +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/OptionalWords.cs @@ -0,0 +1,217 @@ +// +// 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. +// +using System; +using System.Text; +using System.Linq; +using System.Text.Json.Serialization; +using System.Collections.Generic; +using Algolia.Search.Serializer; +using System.Text.Json; +using System.IO; +using System.Reflection; +using Algolia.Search.Models.Common; + +namespace Algolia.Search.Models.Recommend; + +/// +/// OptionalWords +/// +[JsonConverter(typeof(OptionalWordsJsonConverter))] +public partial class OptionalWords : AbstractSchema +{ + /// + /// Initializes a new instance of the OptionalWords class. + /// + public OptionalWords() + { + } + + /// + /// Initializes a new instance of the OptionalWords class + /// with a string + /// + /// An instance of string. + public OptionalWords(string actualInstance) + { + ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the OptionalWords class + /// with a List{String} + /// + /// An instance of List. + public OptionalWords(List actualInstance) + { + ActualInstance = actualInstance; + } + + + /// + /// Gets or Sets ActualInstance + /// + public sealed override object ActualInstance { get; set; } + + /// + /// Get the actual instance of `string`. If the actual instance is not `string`, + /// the InvalidClassException will be thrown + /// + /// An instance of string + public string AsString() + { + return (string)ActualInstance; + } + + /// + /// Get the actual instance of `List{string}`. If the actual instance is not `List{string}`, + /// the InvalidClassException will be thrown + /// + /// An instance of List<string> + public List AsListString() + { + return (List)ActualInstance; + } + + + /// + /// Check if the actual instance is of `string` type. + /// + /// Whether or not the instance is the type + public bool IsString() + { + return ActualInstance.GetType() == typeof(string); + } + + /// + /// Check if the actual instance is of `List{string}` type. + /// + /// Whether or not the instance is the type + public bool IsListString() + { + return ActualInstance.GetType() == typeof(List); + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OptionalWords {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonSerializer.Serialize(ActualInstance, JsonConfig.Options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is not OptionalWords input) + { + return false; + } + + return ActualInstance.Equals(input.ActualInstance); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); + return hashCode; + } + } +} + + + + + +/// +/// Custom JSON converter for OptionalWords +/// +public class OptionalWordsJsonConverter : JsonConverter +{ + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return objectType == typeof(OptionalWords); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Serializer options + /// The object converted from the JSON string + public override OptionalWords Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var jsonDocument = JsonDocument.ParseValue(ref reader); + var root = jsonDocument.RootElement; + if (root.ValueKind == JsonValueKind.String) + { + try + { + return new OptionalWords(jsonDocument.Deserialize(JsonConfig.Options)); + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine($"Failed to deserialize into string: {exception}"); + } + } + if (root.ValueKind == JsonValueKind.Array) + { + try + { + return new OptionalWords(jsonDocument.Deserialize>(JsonConfig.Options)); + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine($"Failed to deserialize into List: {exception}"); + } + } + throw new InvalidDataException($"The JSON string cannot be deserialized into any schema defined."); + } + + /// + /// To write the JSON string + /// + /// JSON writer + /// OptionalWords to be converted into a JSON string + /// JSON Serializer options + public override void Write(Utf8JsonWriter writer, OptionalWords value, JsonSerializerOptions options) + { + writer.WriteRawValue(value.ToJson()); + } +} + diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/ReRankingApplyFilter.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/ReRankingApplyFilter.cs index c63ad365ad..40c7a2ebbf 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/ReRankingApplyFilter.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/ReRankingApplyFilter.cs @@ -24,7 +24,7 @@ public partial class ReRankingApplyFilter : AbstractSchema /// Initializes a new instance of the ReRankingApplyFilter class /// with a List{ReRankingApplyFilter} /// - /// An instance of List<ReRankingApplyFilter>. + /// An instance of List. public ReRankingApplyFilter(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendSearchParams.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendSearchParams.cs index 4b9b09d77c..0aec27d752 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendSearchParams.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendSearchParams.cs @@ -141,11 +141,10 @@ public RecommendSearchParams() public int? MinimumAroundRadius { get; set; } /// - /// 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). + /// Gets or Sets InsideBoundingBox /// - /// 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). [JsonPropertyName("insideBoundingBox")] - public List> InsideBoundingBox { get; set; } + public InsideBoundingBox InsideBoundingBox { get; set; } /// /// 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`. @@ -357,6 +356,13 @@ public RecommendSearchParams() [JsonPropertyName("attributeForDistinct")] public string AttributeForDistinct { get; set; } + /// + /// 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 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). + [JsonPropertyName("maxFacetHits")] + public int? MaxFacetHits { get; set; } + /// /// 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. /// @@ -502,11 +508,10 @@ public RecommendSearchParams() public bool? AdvancedSyntax { get; set; } /// - /// 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). + /// Gets or Sets OptionalWords /// - /// 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). [JsonPropertyName("optionalWords")] - public List OptionalWords { get; set; } + public OptionalWords OptionalWords { get; set; } /// /// 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. @@ -556,13 +561,6 @@ public RecommendSearchParams() [JsonPropertyName("responseFields")] public List ResponseFields { get; set; } - /// - /// 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 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). - [JsonPropertyName("maxFacetHits")] - public int? MaxFacetHits { get; set; } - /// /// Maximum number of facet values to return for each facet. /// @@ -657,6 +655,7 @@ public override string ToString() sb.Append(" UserData: ").Append(UserData).Append("\n"); sb.Append(" CustomNormalization: ").Append(CustomNormalization).Append("\n"); sb.Append(" AttributeForDistinct: ").Append(AttributeForDistinct).Append("\n"); + sb.Append(" MaxFacetHits: ").Append(MaxFacetHits).Append("\n"); sb.Append(" AttributesToRetrieve: ").Append(AttributesToRetrieve).Append("\n"); sb.Append(" Ranking: ").Append(Ranking).Append("\n"); sb.Append(" RelevancyStrictness: ").Append(RelevancyStrictness).Append("\n"); @@ -689,7 +688,6 @@ public override string ToString() sb.Append(" ReplaceSynonymsInHighlight: ").Append(ReplaceSynonymsInHighlight).Append("\n"); sb.Append(" MinProximity: ").Append(MinProximity).Append("\n"); sb.Append(" ResponseFields: ").Append(ResponseFields).Append("\n"); - sb.Append(" MaxFacetHits: ").Append(MaxFacetHits).Append("\n"); sb.Append(" MaxValuesPerFacet: ").Append(MaxValuesPerFacet).Append("\n"); sb.Append(" SortFacetValuesBy: ").Append(SortFacetValuesBy).Append("\n"); sb.Append(" AttributeCriteriaComputedByMinProximity: ").Append(AttributeCriteriaComputedByMinProximity).Append("\n"); @@ -737,7 +735,7 @@ public override bool Equals(object obj) (AroundRadius == input.AroundRadius || (AroundRadius != null && AroundRadius.Equals(input.AroundRadius))) && (AroundPrecision == input.AroundPrecision || (AroundPrecision != null && AroundPrecision.Equals(input.AroundPrecision))) && (MinimumAroundRadius == input.MinimumAroundRadius || MinimumAroundRadius.Equals(input.MinimumAroundRadius)) && - (InsideBoundingBox == input.InsideBoundingBox || InsideBoundingBox != null && input.InsideBoundingBox != null && InsideBoundingBox.SequenceEqual(input.InsideBoundingBox)) && + (InsideBoundingBox == input.InsideBoundingBox || (InsideBoundingBox != null && InsideBoundingBox.Equals(input.InsideBoundingBox))) && (InsidePolygon == input.InsidePolygon || InsidePolygon != null && input.InsidePolygon != null && InsidePolygon.SequenceEqual(input.InsidePolygon)) && (NaturalLanguages == input.NaturalLanguages || NaturalLanguages != null && input.NaturalLanguages != null && NaturalLanguages.SequenceEqual(input.NaturalLanguages)) && (RuleContexts == input.RuleContexts || RuleContexts != null && input.RuleContexts != null && RuleContexts.SequenceEqual(input.RuleContexts)) && @@ -768,6 +766,7 @@ public override bool Equals(object obj) (UserData == input.UserData || (UserData != null && UserData.Equals(input.UserData))) && (CustomNormalization == input.CustomNormalization || CustomNormalization != null && input.CustomNormalization != null && CustomNormalization.SequenceEqual(input.CustomNormalization)) && (AttributeForDistinct == input.AttributeForDistinct || (AttributeForDistinct != null && AttributeForDistinct.Equals(input.AttributeForDistinct))) && + (MaxFacetHits == input.MaxFacetHits || MaxFacetHits.Equals(input.MaxFacetHits)) && (AttributesToRetrieve == input.AttributesToRetrieve || AttributesToRetrieve != null && input.AttributesToRetrieve != null && AttributesToRetrieve.SequenceEqual(input.AttributesToRetrieve)) && (Ranking == input.Ranking || Ranking != null && input.Ranking != null && Ranking.SequenceEqual(input.Ranking)) && (RelevancyStrictness == input.RelevancyStrictness || RelevancyStrictness.Equals(input.RelevancyStrictness)) && @@ -791,7 +790,7 @@ public override bool Equals(object obj) (QueryType == input.QueryType || QueryType.Equals(input.QueryType)) && (RemoveWordsIfNoResults == input.RemoveWordsIfNoResults || RemoveWordsIfNoResults.Equals(input.RemoveWordsIfNoResults)) && (AdvancedSyntax == input.AdvancedSyntax || AdvancedSyntax.Equals(input.AdvancedSyntax)) && - (OptionalWords == input.OptionalWords || OptionalWords != null && input.OptionalWords != null && OptionalWords.SequenceEqual(input.OptionalWords)) && + (OptionalWords == input.OptionalWords || (OptionalWords != null && OptionalWords.Equals(input.OptionalWords))) && (DisableExactOnAttributes == input.DisableExactOnAttributes || DisableExactOnAttributes != null && input.DisableExactOnAttributes != null && DisableExactOnAttributes.SequenceEqual(input.DisableExactOnAttributes)) && (ExactOnSingleWordQuery == input.ExactOnSingleWordQuery || ExactOnSingleWordQuery.Equals(input.ExactOnSingleWordQuery)) && (AlternativesAsExact == input.AlternativesAsExact || AlternativesAsExact != null && input.AlternativesAsExact != null && AlternativesAsExact.SequenceEqual(input.AlternativesAsExact)) && @@ -800,7 +799,6 @@ public override bool Equals(object obj) (ReplaceSynonymsInHighlight == input.ReplaceSynonymsInHighlight || ReplaceSynonymsInHighlight.Equals(input.ReplaceSynonymsInHighlight)) && (MinProximity == input.MinProximity || MinProximity.Equals(input.MinProximity)) && (ResponseFields == input.ResponseFields || ResponseFields != null && input.ResponseFields != null && ResponseFields.SequenceEqual(input.ResponseFields)) && - (MaxFacetHits == input.MaxFacetHits || MaxFacetHits.Equals(input.MaxFacetHits)) && (MaxValuesPerFacet == input.MaxValuesPerFacet || MaxValuesPerFacet.Equals(input.MaxValuesPerFacet)) && (SortFacetValuesBy == input.SortFacetValuesBy || (SortFacetValuesBy != null && SortFacetValuesBy.Equals(input.SortFacetValuesBy))) && (AttributeCriteriaComputedByMinProximity == input.AttributeCriteriaComputedByMinProximity || AttributeCriteriaComputedByMinProximity.Equals(input.AttributeCriteriaComputedByMinProximity)) && @@ -963,6 +961,7 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + AttributeForDistinct.GetHashCode(); } + hashCode = (hashCode * 59) + MaxFacetHits.GetHashCode(); if (AttributesToRetrieve != null) { hashCode = (hashCode * 59) + AttributesToRetrieve.GetHashCode(); @@ -1049,7 +1048,6 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + ResponseFields.GetHashCode(); } - hashCode = (hashCode * 59) + MaxFacetHits.GetHashCode(); hashCode = (hashCode * 59) + MaxValuesPerFacet.GetHashCode(); if (SortFacetValuesBy != null) { diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RemoveStopWords.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RemoveStopWords.cs index 1e8a5a4c40..cac7d18873 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RemoveStopWords.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RemoveStopWords.cs @@ -24,7 +24,7 @@ public partial class RemoveStopWords : AbstractSchema /// Initializes a new instance of the RemoveStopWords class /// with a List{SupportedLanguage} /// - /// An instance of List<SupportedLanguage>. + /// An instance of List. public RemoveStopWords(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/SnippetResult.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/SnippetResult.cs index daf91fbbff..32036e8030 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/SnippetResult.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/SnippetResult.cs @@ -34,7 +34,7 @@ public SnippetResult(SnippetResultOption actualInstance) /// Initializes a new instance of the SnippetResult class /// with a Dictionary{string, SnippetResult} /// - /// An instance of Dictionary<string, SnippetResult>. + /// An instance of Dictionary. public SnippetResult(Dictionary actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); @@ -44,7 +44,7 @@ public SnippetResult(Dictionary actualInstance) /// Initializes a new instance of the SnippetResult class /// with a List{SnippetResult} /// - /// An instance of List<SnippetResult>. + /// An instance of List. public SnippetResult(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/TagFilters.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/TagFilters.cs index dff0af969c..ecb3bba8f8 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/TagFilters.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/TagFilters.cs @@ -24,7 +24,7 @@ public partial class TagFilters : AbstractSchema /// Initializes a new instance of the TagFilters class /// with a List{TagFilters} /// - /// An instance of List<TagFilters>. + /// An instance of List. public TagFilters(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/AroundPrecision.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/AroundPrecision.cs index b90f59c6dd..5f14f3025d 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/AroundPrecision.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/AroundPrecision.cs @@ -34,7 +34,7 @@ public AroundPrecision(int actualInstance) /// Initializes a new instance of the AroundPrecision class /// with a List{Range} /// - /// An instance of List<Range>. + /// An instance of List. public AroundPrecision(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/AutomaticFacetFilters.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/AutomaticFacetFilters.cs index bcf22977a4..0f1681c4c2 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/AutomaticFacetFilters.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/AutomaticFacetFilters.cs @@ -24,7 +24,7 @@ public partial class AutomaticFacetFilters : AbstractSchema /// Initializes a new instance of the AutomaticFacetFilters class /// with a List{AutomaticFacetFilter} /// - /// An instance of List<AutomaticFacetFilter>. + /// An instance of List. public AutomaticFacetFilters(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); @@ -34,7 +34,7 @@ public AutomaticFacetFilters(List actualInstance) /// Initializes a new instance of the AutomaticFacetFilters class /// with a List{String} /// - /// An instance of List<string>. + /// An instance of List. public AutomaticFacetFilters(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/BrowseParamsObject.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/BrowseParamsObject.cs index 242de00afc..a4a0ce9b2f 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/BrowseParamsObject.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/BrowseParamsObject.cs @@ -175,11 +175,10 @@ public BrowseParamsObject() public int? MinimumAroundRadius { get; set; } /// - /// 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). + /// Gets or Sets InsideBoundingBox /// - /// 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). [JsonPropertyName("insideBoundingBox")] - public List> InsideBoundingBox { get; set; } + public InsideBoundingBox InsideBoundingBox { get; set; } /// /// 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`. @@ -437,11 +436,10 @@ public BrowseParamsObject() public bool? AdvancedSyntax { get; set; } /// - /// 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). + /// Gets or Sets OptionalWords /// - /// 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). [JsonPropertyName("optionalWords")] - public List OptionalWords { get; set; } + public OptionalWords OptionalWords { get; set; } /// /// 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. @@ -491,13 +489,6 @@ public BrowseParamsObject() [JsonPropertyName("responseFields")] public List ResponseFields { get; set; } - /// - /// 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 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). - [JsonPropertyName("maxFacetHits")] - public int? MaxFacetHits { get; set; } - /// /// Maximum number of facet values to return for each facet. /// @@ -622,7 +613,6 @@ public override string ToString() sb.Append(" ReplaceSynonymsInHighlight: ").Append(ReplaceSynonymsInHighlight).Append("\n"); sb.Append(" MinProximity: ").Append(MinProximity).Append("\n"); sb.Append(" ResponseFields: ").Append(ResponseFields).Append("\n"); - sb.Append(" MaxFacetHits: ").Append(MaxFacetHits).Append("\n"); sb.Append(" MaxValuesPerFacet: ").Append(MaxValuesPerFacet).Append("\n"); sb.Append(" SortFacetValuesBy: ").Append(SortFacetValuesBy).Append("\n"); sb.Append(" AttributeCriteriaComputedByMinProximity: ").Append(AttributeCriteriaComputedByMinProximity).Append("\n"); @@ -675,7 +665,7 @@ public override bool Equals(object obj) (AroundRadius == input.AroundRadius || (AroundRadius != null && AroundRadius.Equals(input.AroundRadius))) && (AroundPrecision == input.AroundPrecision || (AroundPrecision != null && AroundPrecision.Equals(input.AroundPrecision))) && (MinimumAroundRadius == input.MinimumAroundRadius || MinimumAroundRadius.Equals(input.MinimumAroundRadius)) && - (InsideBoundingBox == input.InsideBoundingBox || InsideBoundingBox != null && input.InsideBoundingBox != null && InsideBoundingBox.SequenceEqual(input.InsideBoundingBox)) && + (InsideBoundingBox == input.InsideBoundingBox || (InsideBoundingBox != null && InsideBoundingBox.Equals(input.InsideBoundingBox))) && (InsidePolygon == input.InsidePolygon || InsidePolygon != null && input.InsidePolygon != null && InsidePolygon.SequenceEqual(input.InsidePolygon)) && (NaturalLanguages == input.NaturalLanguages || NaturalLanguages != null && input.NaturalLanguages != null && NaturalLanguages.SequenceEqual(input.NaturalLanguages)) && (RuleContexts == input.RuleContexts || RuleContexts != null && input.RuleContexts != null && RuleContexts.SequenceEqual(input.RuleContexts)) && @@ -716,7 +706,7 @@ public override bool Equals(object obj) (Mode == input.Mode || Mode.Equals(input.Mode)) && (SemanticSearch == input.SemanticSearch || (SemanticSearch != null && SemanticSearch.Equals(input.SemanticSearch))) && (AdvancedSyntax == input.AdvancedSyntax || AdvancedSyntax.Equals(input.AdvancedSyntax)) && - (OptionalWords == input.OptionalWords || OptionalWords != null && input.OptionalWords != null && OptionalWords.SequenceEqual(input.OptionalWords)) && + (OptionalWords == input.OptionalWords || (OptionalWords != null && OptionalWords.Equals(input.OptionalWords))) && (DisableExactOnAttributes == input.DisableExactOnAttributes || DisableExactOnAttributes != null && input.DisableExactOnAttributes != null && DisableExactOnAttributes.SequenceEqual(input.DisableExactOnAttributes)) && (ExactOnSingleWordQuery == input.ExactOnSingleWordQuery || ExactOnSingleWordQuery.Equals(input.ExactOnSingleWordQuery)) && (AlternativesAsExact == input.AlternativesAsExact || AlternativesAsExact != null && input.AlternativesAsExact != null && AlternativesAsExact.SequenceEqual(input.AlternativesAsExact)) && @@ -725,7 +715,6 @@ public override bool Equals(object obj) (ReplaceSynonymsInHighlight == input.ReplaceSynonymsInHighlight || ReplaceSynonymsInHighlight.Equals(input.ReplaceSynonymsInHighlight)) && (MinProximity == input.MinProximity || MinProximity.Equals(input.MinProximity)) && (ResponseFields == input.ResponseFields || ResponseFields != null && input.ResponseFields != null && ResponseFields.SequenceEqual(input.ResponseFields)) && - (MaxFacetHits == input.MaxFacetHits || MaxFacetHits.Equals(input.MaxFacetHits)) && (MaxValuesPerFacet == input.MaxValuesPerFacet || MaxValuesPerFacet.Equals(input.MaxValuesPerFacet)) && (SortFacetValuesBy == input.SortFacetValuesBy || (SortFacetValuesBy != null && SortFacetValuesBy.Equals(input.SortFacetValuesBy))) && (AttributeCriteriaComputedByMinProximity == input.AttributeCriteriaComputedByMinProximity || AttributeCriteriaComputedByMinProximity.Equals(input.AttributeCriteriaComputedByMinProximity)) && @@ -930,7 +919,6 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + ResponseFields.GetHashCode(); } - hashCode = (hashCode * 59) + MaxFacetHits.GetHashCode(); hashCode = (hashCode * 59) + MaxValuesPerFacet.GetHashCode(); if (SortFacetValuesBy != null) { diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/ConsequenceParams.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/ConsequenceParams.cs index ec19bb64f2..149a6acc53 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/ConsequenceParams.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/ConsequenceParams.cs @@ -168,11 +168,10 @@ public ConsequenceParams() public int? MinimumAroundRadius { get; set; } /// - /// 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). + /// Gets or Sets InsideBoundingBox /// - /// 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). [JsonPropertyName("insideBoundingBox")] - public List> InsideBoundingBox { get; set; } + public InsideBoundingBox InsideBoundingBox { get; set; } /// /// 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`. @@ -430,11 +429,10 @@ public ConsequenceParams() public bool? AdvancedSyntax { get; set; } /// - /// 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). + /// Gets or Sets OptionalWords /// - /// 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). [JsonPropertyName("optionalWords")] - public List OptionalWords { get; set; } + public OptionalWords OptionalWords { get; set; } /// /// 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. @@ -484,13 +482,6 @@ public ConsequenceParams() [JsonPropertyName("responseFields")] public List ResponseFields { get; set; } - /// - /// 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 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). - [JsonPropertyName("maxFacetHits")] - public int? MaxFacetHits { get; set; } - /// /// Maximum number of facet values to return for each facet. /// @@ -625,7 +616,6 @@ public override string ToString() sb.Append(" ReplaceSynonymsInHighlight: ").Append(ReplaceSynonymsInHighlight).Append("\n"); sb.Append(" MinProximity: ").Append(MinProximity).Append("\n"); sb.Append(" ResponseFields: ").Append(ResponseFields).Append("\n"); - sb.Append(" MaxFacetHits: ").Append(MaxFacetHits).Append("\n"); sb.Append(" MaxValuesPerFacet: ").Append(MaxValuesPerFacet).Append("\n"); sb.Append(" SortFacetValuesBy: ").Append(SortFacetValuesBy).Append("\n"); sb.Append(" AttributeCriteriaComputedByMinProximity: ").Append(AttributeCriteriaComputedByMinProximity).Append("\n"); @@ -679,7 +669,7 @@ public override bool Equals(object obj) (AroundRadius == input.AroundRadius || (AroundRadius != null && AroundRadius.Equals(input.AroundRadius))) && (AroundPrecision == input.AroundPrecision || (AroundPrecision != null && AroundPrecision.Equals(input.AroundPrecision))) && (MinimumAroundRadius == input.MinimumAroundRadius || MinimumAroundRadius.Equals(input.MinimumAroundRadius)) && - (InsideBoundingBox == input.InsideBoundingBox || InsideBoundingBox != null && input.InsideBoundingBox != null && InsideBoundingBox.SequenceEqual(input.InsideBoundingBox)) && + (InsideBoundingBox == input.InsideBoundingBox || (InsideBoundingBox != null && InsideBoundingBox.Equals(input.InsideBoundingBox))) && (InsidePolygon == input.InsidePolygon || InsidePolygon != null && input.InsidePolygon != null && InsidePolygon.SequenceEqual(input.InsidePolygon)) && (NaturalLanguages == input.NaturalLanguages || NaturalLanguages != null && input.NaturalLanguages != null && NaturalLanguages.SequenceEqual(input.NaturalLanguages)) && (RuleContexts == input.RuleContexts || RuleContexts != null && input.RuleContexts != null && RuleContexts.SequenceEqual(input.RuleContexts)) && @@ -720,7 +710,7 @@ public override bool Equals(object obj) (Mode == input.Mode || Mode.Equals(input.Mode)) && (SemanticSearch == input.SemanticSearch || (SemanticSearch != null && SemanticSearch.Equals(input.SemanticSearch))) && (AdvancedSyntax == input.AdvancedSyntax || AdvancedSyntax.Equals(input.AdvancedSyntax)) && - (OptionalWords == input.OptionalWords || OptionalWords != null && input.OptionalWords != null && OptionalWords.SequenceEqual(input.OptionalWords)) && + (OptionalWords == input.OptionalWords || (OptionalWords != null && OptionalWords.Equals(input.OptionalWords))) && (DisableExactOnAttributes == input.DisableExactOnAttributes || DisableExactOnAttributes != null && input.DisableExactOnAttributes != null && DisableExactOnAttributes.SequenceEqual(input.DisableExactOnAttributes)) && (ExactOnSingleWordQuery == input.ExactOnSingleWordQuery || ExactOnSingleWordQuery.Equals(input.ExactOnSingleWordQuery)) && (AlternativesAsExact == input.AlternativesAsExact || AlternativesAsExact != null && input.AlternativesAsExact != null && AlternativesAsExact.SequenceEqual(input.AlternativesAsExact)) && @@ -729,7 +719,6 @@ public override bool Equals(object obj) (ReplaceSynonymsInHighlight == input.ReplaceSynonymsInHighlight || ReplaceSynonymsInHighlight.Equals(input.ReplaceSynonymsInHighlight)) && (MinProximity == input.MinProximity || MinProximity.Equals(input.MinProximity)) && (ResponseFields == input.ResponseFields || ResponseFields != null && input.ResponseFields != null && ResponseFields.SequenceEqual(input.ResponseFields)) && - (MaxFacetHits == input.MaxFacetHits || MaxFacetHits.Equals(input.MaxFacetHits)) && (MaxValuesPerFacet == input.MaxValuesPerFacet || MaxValuesPerFacet.Equals(input.MaxValuesPerFacet)) && (SortFacetValuesBy == input.SortFacetValuesBy || (SortFacetValuesBy != null && SortFacetValuesBy.Equals(input.SortFacetValuesBy))) && (AttributeCriteriaComputedByMinProximity == input.AttributeCriteriaComputedByMinProximity || AttributeCriteriaComputedByMinProximity.Equals(input.AttributeCriteriaComputedByMinProximity)) && @@ -932,7 +921,6 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + ResponseFields.GetHashCode(); } - hashCode = (hashCode * 59) + MaxFacetHits.GetHashCode(); hashCode = (hashCode * 59) + MaxValuesPerFacet.GetHashCode(); if (SortFacetValuesBy != null) { diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/DeleteByParams.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/DeleteByParams.cs index 5de4f68750..32a9d48ac4 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/DeleteByParams.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/DeleteByParams.cs @@ -62,11 +62,10 @@ public DeleteByParams() public AroundRadius AroundRadius { get; set; } /// - /// 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). + /// Gets or Sets InsideBoundingBox /// - /// 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). [JsonPropertyName("insideBoundingBox")] - public List> InsideBoundingBox { get; set; } + public InsideBoundingBox InsideBoundingBox { get; set; } /// /// 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`. @@ -123,7 +122,7 @@ public override bool Equals(object obj) (TagFilters == input.TagFilters || (TagFilters != null && TagFilters.Equals(input.TagFilters))) && (AroundLatLng == input.AroundLatLng || (AroundLatLng != null && AroundLatLng.Equals(input.AroundLatLng))) && (AroundRadius == input.AroundRadius || (AroundRadius != null && AroundRadius.Equals(input.AroundRadius))) && - (InsideBoundingBox == input.InsideBoundingBox || InsideBoundingBox != null && input.InsideBoundingBox != null && InsideBoundingBox.SequenceEqual(input.InsideBoundingBox)) && + (InsideBoundingBox == input.InsideBoundingBox || (InsideBoundingBox != null && InsideBoundingBox.Equals(input.InsideBoundingBox))) && (InsidePolygon == input.InsidePolygon || InsidePolygon != null && input.InsidePolygon != null && InsidePolygon.SequenceEqual(input.InsidePolygon)); } diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/FacetFilters.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/FacetFilters.cs index e6e96cfc69..8f3bf05175 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/FacetFilters.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/FacetFilters.cs @@ -24,7 +24,7 @@ public partial class FacetFilters : AbstractSchema /// Initializes a new instance of the FacetFilters class /// with a List{FacetFilters} /// - /// An instance of List<FacetFilters>. + /// An instance of List. public FacetFilters(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/HighlightResult.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/HighlightResult.cs index 3d0042a80d..709c71fa16 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/HighlightResult.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/HighlightResult.cs @@ -34,7 +34,7 @@ public HighlightResult(HighlightResultOption actualInstance) /// Initializes a new instance of the HighlightResult class /// with a Dictionary{string, HighlightResult} /// - /// An instance of Dictionary<string, HighlightResult>. + /// An instance of Dictionary. public HighlightResult(Dictionary actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); @@ -44,7 +44,7 @@ public HighlightResult(Dictionary actualInstance) /// Initializes a new instance of the HighlightResult class /// with a List{HighlightResult} /// - /// An instance of List<HighlightResult>. + /// An instance of List. public HighlightResult(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/IgnorePlurals.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/IgnorePlurals.cs index 92bb35af7c..dd8316457b 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/IgnorePlurals.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/IgnorePlurals.cs @@ -24,7 +24,7 @@ public partial class IgnorePlurals : AbstractSchema /// Initializes a new instance of the IgnorePlurals class /// with a List{SupportedLanguage} /// - /// An instance of List<SupportedLanguage>. + /// An instance of List. public IgnorePlurals(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/IndexSettings.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/IndexSettings.cs index cf3f5790e9..e540362c16 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/IndexSettings.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/IndexSettings.cs @@ -166,6 +166,13 @@ public IndexSettings() [JsonPropertyName("attributeForDistinct")] public string AttributeForDistinct { get; set; } + /// + /// 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 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). + [JsonPropertyName("maxFacetHits")] + public int? MaxFacetHits { get; set; } + /// /// 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. /// @@ -338,11 +345,10 @@ public IndexSettings() public bool? AdvancedSyntax { get; set; } /// - /// 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). + /// Gets or Sets OptionalWords /// - /// 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). [JsonPropertyName("optionalWords")] - public List OptionalWords { get; set; } + public OptionalWords OptionalWords { get; set; } /// /// 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. @@ -392,13 +398,6 @@ public IndexSettings() [JsonPropertyName("responseFields")] public List ResponseFields { get; set; } - /// - /// 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 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). - [JsonPropertyName("maxFacetHits")] - public int? MaxFacetHits { get; set; } - /// /// Maximum number of facet values to return for each facet. /// @@ -464,6 +463,7 @@ public override string ToString() sb.Append(" UserData: ").Append(UserData).Append("\n"); sb.Append(" CustomNormalization: ").Append(CustomNormalization).Append("\n"); sb.Append(" AttributeForDistinct: ").Append(AttributeForDistinct).Append("\n"); + sb.Append(" MaxFacetHits: ").Append(MaxFacetHits).Append("\n"); sb.Append(" AttributesToRetrieve: ").Append(AttributesToRetrieve).Append("\n"); sb.Append(" Ranking: ").Append(Ranking).Append("\n"); sb.Append(" CustomRanking: ").Append(CustomRanking).Append("\n"); @@ -501,7 +501,6 @@ public override string ToString() sb.Append(" ReplaceSynonymsInHighlight: ").Append(ReplaceSynonymsInHighlight).Append("\n"); sb.Append(" MinProximity: ").Append(MinProximity).Append("\n"); sb.Append(" ResponseFields: ").Append(ResponseFields).Append("\n"); - sb.Append(" MaxFacetHits: ").Append(MaxFacetHits).Append("\n"); sb.Append(" MaxValuesPerFacet: ").Append(MaxValuesPerFacet).Append("\n"); sb.Append(" SortFacetValuesBy: ").Append(SortFacetValuesBy).Append("\n"); sb.Append(" AttributeCriteriaComputedByMinProximity: ").Append(AttributeCriteriaComputedByMinProximity).Append("\n"); @@ -551,6 +550,7 @@ public override bool Equals(object obj) (UserData == input.UserData || (UserData != null && UserData.Equals(input.UserData))) && (CustomNormalization == input.CustomNormalization || CustomNormalization != null && input.CustomNormalization != null && CustomNormalization.SequenceEqual(input.CustomNormalization)) && (AttributeForDistinct == input.AttributeForDistinct || (AttributeForDistinct != null && AttributeForDistinct.Equals(input.AttributeForDistinct))) && + (MaxFacetHits == input.MaxFacetHits || MaxFacetHits.Equals(input.MaxFacetHits)) && (AttributesToRetrieve == input.AttributesToRetrieve || AttributesToRetrieve != null && input.AttributesToRetrieve != null && AttributesToRetrieve.SequenceEqual(input.AttributesToRetrieve)) && (Ranking == input.Ranking || Ranking != null && input.Ranking != null && Ranking.SequenceEqual(input.Ranking)) && (CustomRanking == input.CustomRanking || CustomRanking != null && input.CustomRanking != null && CustomRanking.SequenceEqual(input.CustomRanking)) && @@ -579,7 +579,7 @@ public override bool Equals(object obj) (Mode == input.Mode || Mode.Equals(input.Mode)) && (SemanticSearch == input.SemanticSearch || (SemanticSearch != null && SemanticSearch.Equals(input.SemanticSearch))) && (AdvancedSyntax == input.AdvancedSyntax || AdvancedSyntax.Equals(input.AdvancedSyntax)) && - (OptionalWords == input.OptionalWords || OptionalWords != null && input.OptionalWords != null && OptionalWords.SequenceEqual(input.OptionalWords)) && + (OptionalWords == input.OptionalWords || (OptionalWords != null && OptionalWords.Equals(input.OptionalWords))) && (DisableExactOnAttributes == input.DisableExactOnAttributes || DisableExactOnAttributes != null && input.DisableExactOnAttributes != null && DisableExactOnAttributes.SequenceEqual(input.DisableExactOnAttributes)) && (ExactOnSingleWordQuery == input.ExactOnSingleWordQuery || ExactOnSingleWordQuery.Equals(input.ExactOnSingleWordQuery)) && (AlternativesAsExact == input.AlternativesAsExact || AlternativesAsExact != null && input.AlternativesAsExact != null && AlternativesAsExact.SequenceEqual(input.AlternativesAsExact)) && @@ -588,7 +588,6 @@ public override bool Equals(object obj) (ReplaceSynonymsInHighlight == input.ReplaceSynonymsInHighlight || ReplaceSynonymsInHighlight.Equals(input.ReplaceSynonymsInHighlight)) && (MinProximity == input.MinProximity || MinProximity.Equals(input.MinProximity)) && (ResponseFields == input.ResponseFields || ResponseFields != null && input.ResponseFields != null && ResponseFields.SequenceEqual(input.ResponseFields)) && - (MaxFacetHits == input.MaxFacetHits || MaxFacetHits.Equals(input.MaxFacetHits)) && (MaxValuesPerFacet == input.MaxValuesPerFacet || MaxValuesPerFacet.Equals(input.MaxValuesPerFacet)) && (SortFacetValuesBy == input.SortFacetValuesBy || (SortFacetValuesBy != null && SortFacetValuesBy.Equals(input.SortFacetValuesBy))) && (AttributeCriteriaComputedByMinProximity == input.AttributeCriteriaComputedByMinProximity || AttributeCriteriaComputedByMinProximity.Equals(input.AttributeCriteriaComputedByMinProximity)) && @@ -668,6 +667,7 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + AttributeForDistinct.GetHashCode(); } + hashCode = (hashCode * 59) + MaxFacetHits.GetHashCode(); if (AttributesToRetrieve != null) { hashCode = (hashCode * 59) + AttributesToRetrieve.GetHashCode(); @@ -768,7 +768,6 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + ResponseFields.GetHashCode(); } - hashCode = (hashCode * 59) + MaxFacetHits.GetHashCode(); hashCode = (hashCode * 59) + MaxValuesPerFacet.GetHashCode(); if (SortFacetValuesBy != null) { diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/InsideBoundingBox.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/InsideBoundingBox.cs new file mode 100644 index 0000000000..2f76c9bcd6 --- /dev/null +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/InsideBoundingBox.cs @@ -0,0 +1,217 @@ +// +// 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. +// +using System; +using System.Text; +using System.Linq; +using System.Text.Json.Serialization; +using System.Collections.Generic; +using Algolia.Search.Serializer; +using System.Text.Json; +using System.IO; +using System.Reflection; +using Algolia.Search.Models.Common; + +namespace Algolia.Search.Models.Search; + +/// +/// InsideBoundingBox +/// +[JsonConverter(typeof(InsideBoundingBoxJsonConverter))] +public partial class InsideBoundingBox : AbstractSchema +{ + /// + /// Initializes a new instance of the InsideBoundingBox class. + /// + public InsideBoundingBox() + { + } + + /// + /// Initializes a new instance of the InsideBoundingBox class + /// with a string + /// + /// An instance of string. + public InsideBoundingBox(string actualInstance) + { + ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the InsideBoundingBox class + /// with a List{List{double}} + /// + /// An instance of List>. + public InsideBoundingBox(List> actualInstance) + { + ActualInstance = actualInstance; + } + + + /// + /// Gets or Sets ActualInstance + /// + public sealed override object ActualInstance { get; set; } + + /// + /// Get the actual instance of `string`. If the actual instance is not `string`, + /// the InvalidClassException will be thrown + /// + /// An instance of string + public string AsString() + { + return (string)ActualInstance; + } + + /// + /// Get the actual instance of `List{List{double}}`. If the actual instance is not `List{List{double}}`, + /// the InvalidClassException will be thrown + /// + /// An instance of List<List<double>> + public List> AsListListDouble() + { + return (List>)ActualInstance; + } + + + /// + /// Check if the actual instance is of `string` type. + /// + /// Whether or not the instance is the type + public bool IsString() + { + return ActualInstance.GetType() == typeof(string); + } + + /// + /// Check if the actual instance is of `List{List{double}}` type. + /// + /// Whether or not the instance is the type + public bool IsListListDouble() + { + return ActualInstance.GetType() == typeof(List>); + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class InsideBoundingBox {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonSerializer.Serialize(ActualInstance, JsonConfig.Options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is not InsideBoundingBox input) + { + return false; + } + + return ActualInstance.Equals(input.ActualInstance); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); + return hashCode; + } + } +} + + + + + +/// +/// Custom JSON converter for InsideBoundingBox +/// +public class InsideBoundingBoxJsonConverter : JsonConverter +{ + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return objectType == typeof(InsideBoundingBox); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Serializer options + /// The object converted from the JSON string + public override InsideBoundingBox Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var jsonDocument = JsonDocument.ParseValue(ref reader); + var root = jsonDocument.RootElement; + if (root.ValueKind == JsonValueKind.String) + { + try + { + return new InsideBoundingBox(jsonDocument.Deserialize(JsonConfig.Options)); + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine($"Failed to deserialize into string: {exception}"); + } + } + if (root.ValueKind == JsonValueKind.Array) + { + try + { + return new InsideBoundingBox(jsonDocument.Deserialize>>(JsonConfig.Options)); + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine($"Failed to deserialize into List>: {exception}"); + } + } + throw new InvalidDataException($"The JSON string cannot be deserialized into any schema defined."); + } + + /// + /// To write the JSON string + /// + /// JSON writer + /// InsideBoundingBox to be converted into a JSON string + /// JSON Serializer options + public override void Write(Utf8JsonWriter writer, InsideBoundingBox value, JsonSerializerOptions options) + { + writer.WriteRawValue(value.ToJson()); + } +} + diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/NumericFilters.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/NumericFilters.cs index ab62c4700d..d92b214088 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/NumericFilters.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/NumericFilters.cs @@ -24,7 +24,7 @@ public partial class NumericFilters : AbstractSchema /// Initializes a new instance of the NumericFilters class /// with a List{NumericFilters} /// - /// An instance of List<NumericFilters>. + /// An instance of List. public NumericFilters(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/OptionalFilters.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/OptionalFilters.cs index 5d87c043c2..4b82011b93 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/OptionalFilters.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/OptionalFilters.cs @@ -24,7 +24,7 @@ public partial class OptionalFilters : AbstractSchema /// Initializes a new instance of the OptionalFilters class /// with a List{OptionalFilters} /// - /// An instance of List<OptionalFilters>. + /// An instance of List. public OptionalFilters(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/OptionalWords.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/OptionalWords.cs new file mode 100644 index 0000000000..f00adcd05b --- /dev/null +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/OptionalWords.cs @@ -0,0 +1,217 @@ +// +// 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. +// +using System; +using System.Text; +using System.Linq; +using System.Text.Json.Serialization; +using System.Collections.Generic; +using Algolia.Search.Serializer; +using System.Text.Json; +using System.IO; +using System.Reflection; +using Algolia.Search.Models.Common; + +namespace Algolia.Search.Models.Search; + +/// +/// OptionalWords +/// +[JsonConverter(typeof(OptionalWordsJsonConverter))] +public partial class OptionalWords : AbstractSchema +{ + /// + /// Initializes a new instance of the OptionalWords class. + /// + public OptionalWords() + { + } + + /// + /// Initializes a new instance of the OptionalWords class + /// with a string + /// + /// An instance of string. + public OptionalWords(string actualInstance) + { + ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the OptionalWords class + /// with a List{String} + /// + /// An instance of List. + public OptionalWords(List actualInstance) + { + ActualInstance = actualInstance; + } + + + /// + /// Gets or Sets ActualInstance + /// + public sealed override object ActualInstance { get; set; } + + /// + /// Get the actual instance of `string`. If the actual instance is not `string`, + /// the InvalidClassException will be thrown + /// + /// An instance of string + public string AsString() + { + return (string)ActualInstance; + } + + /// + /// Get the actual instance of `List{string}`. If the actual instance is not `List{string}`, + /// the InvalidClassException will be thrown + /// + /// An instance of List<string> + public List AsListString() + { + return (List)ActualInstance; + } + + + /// + /// Check if the actual instance is of `string` type. + /// + /// Whether or not the instance is the type + public bool IsString() + { + return ActualInstance.GetType() == typeof(string); + } + + /// + /// Check if the actual instance is of `List{string}` type. + /// + /// Whether or not the instance is the type + public bool IsListString() + { + return ActualInstance.GetType() == typeof(List); + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OptionalWords {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonSerializer.Serialize(ActualInstance, JsonConfig.Options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is not OptionalWords input) + { + return false; + } + + return ActualInstance.Equals(input.ActualInstance); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); + return hashCode; + } + } +} + + + + + +/// +/// Custom JSON converter for OptionalWords +/// +public class OptionalWordsJsonConverter : JsonConverter +{ + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return objectType == typeof(OptionalWords); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Serializer options + /// The object converted from the JSON string + public override OptionalWords Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var jsonDocument = JsonDocument.ParseValue(ref reader); + var root = jsonDocument.RootElement; + if (root.ValueKind == JsonValueKind.String) + { + try + { + return new OptionalWords(jsonDocument.Deserialize(JsonConfig.Options)); + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine($"Failed to deserialize into string: {exception}"); + } + } + if (root.ValueKind == JsonValueKind.Array) + { + try + { + return new OptionalWords(jsonDocument.Deserialize>(JsonConfig.Options)); + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine($"Failed to deserialize into List: {exception}"); + } + } + throw new InvalidDataException($"The JSON string cannot be deserialized into any schema defined."); + } + + /// + /// To write the JSON string + /// + /// JSON writer + /// OptionalWords to be converted into a JSON string + /// JSON Serializer options + public override void Write(Utf8JsonWriter writer, OptionalWords value, JsonSerializerOptions options) + { + writer.WriteRawValue(value.ToJson()); + } +} + diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/ReRankingApplyFilter.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/ReRankingApplyFilter.cs index f32be33bc3..10ba076a38 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/ReRankingApplyFilter.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/ReRankingApplyFilter.cs @@ -24,7 +24,7 @@ public partial class ReRankingApplyFilter : AbstractSchema /// Initializes a new instance of the ReRankingApplyFilter class /// with a List{ReRankingApplyFilter} /// - /// An instance of List<ReRankingApplyFilter>. + /// An instance of List. public ReRankingApplyFilter(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/RemoveStopWords.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/RemoveStopWords.cs index 71417d5caf..9cbcbd3d56 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/RemoveStopWords.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/RemoveStopWords.cs @@ -24,7 +24,7 @@ public partial class RemoveStopWords : AbstractSchema /// Initializes a new instance of the RemoveStopWords class /// with a List{SupportedLanguage} /// - /// An instance of List<SupportedLanguage>. + /// An instance of List. public RemoveStopWords(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SearchForFacets.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SearchForFacets.cs index 1affc271ec..e67b69f6b8 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SearchForFacets.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SearchForFacets.cs @@ -199,11 +199,10 @@ public SearchForFacets(string facet, string indexName, SearchTypeFacet? type) public int? MinimumAroundRadius { get; set; } /// - /// 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). + /// Gets or Sets InsideBoundingBox /// - /// 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). [JsonPropertyName("insideBoundingBox")] - public List> InsideBoundingBox { get; set; } + public InsideBoundingBox InsideBoundingBox { get; set; } /// /// 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`. @@ -461,11 +460,10 @@ public SearchForFacets(string facet, string indexName, SearchTypeFacet? type) public bool? AdvancedSyntax { get; set; } /// - /// 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). + /// Gets or Sets OptionalWords /// - /// 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). [JsonPropertyName("optionalWords")] - public List OptionalWords { get; set; } + public OptionalWords OptionalWords { get; set; } /// /// 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. @@ -515,13 +513,6 @@ public SearchForFacets(string facet, string indexName, SearchTypeFacet? type) [JsonPropertyName("responseFields")] public List ResponseFields { get; set; } - /// - /// 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 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). - [JsonPropertyName("maxFacetHits")] - public int? MaxFacetHits { get; set; } - /// /// Maximum number of facet values to return for each facet. /// @@ -583,6 +574,13 @@ public SearchForFacets(string facet, string indexName, SearchTypeFacet? type) [JsonPropertyName("facetQuery")] public string FacetQuery { get; set; } + /// + /// 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 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). + [JsonPropertyName("maxFacetHits")] + public int? MaxFacetHits { get; set; } + /// /// Returns the string presentation of the object /// @@ -661,7 +659,6 @@ public override string ToString() sb.Append(" ReplaceSynonymsInHighlight: ").Append(ReplaceSynonymsInHighlight).Append("\n"); sb.Append(" MinProximity: ").Append(MinProximity).Append("\n"); sb.Append(" ResponseFields: ").Append(ResponseFields).Append("\n"); - sb.Append(" MaxFacetHits: ").Append(MaxFacetHits).Append("\n"); sb.Append(" MaxValuesPerFacet: ").Append(MaxValuesPerFacet).Append("\n"); sb.Append(" SortFacetValuesBy: ").Append(SortFacetValuesBy).Append("\n"); sb.Append(" AttributeCriteriaComputedByMinProximity: ").Append(AttributeCriteriaComputedByMinProximity).Append("\n"); @@ -671,6 +668,7 @@ public override string ToString() sb.Append(" Facet: ").Append(Facet).Append("\n"); sb.Append(" IndexName: ").Append(IndexName).Append("\n"); sb.Append(" FacetQuery: ").Append(FacetQuery).Append("\n"); + sb.Append(" MaxFacetHits: ").Append(MaxFacetHits).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -718,7 +716,7 @@ public override bool Equals(object obj) (AroundRadius == input.AroundRadius || (AroundRadius != null && AroundRadius.Equals(input.AroundRadius))) && (AroundPrecision == input.AroundPrecision || (AroundPrecision != null && AroundPrecision.Equals(input.AroundPrecision))) && (MinimumAroundRadius == input.MinimumAroundRadius || MinimumAroundRadius.Equals(input.MinimumAroundRadius)) && - (InsideBoundingBox == input.InsideBoundingBox || InsideBoundingBox != null && input.InsideBoundingBox != null && InsideBoundingBox.SequenceEqual(input.InsideBoundingBox)) && + (InsideBoundingBox == input.InsideBoundingBox || (InsideBoundingBox != null && InsideBoundingBox.Equals(input.InsideBoundingBox))) && (InsidePolygon == input.InsidePolygon || InsidePolygon != null && input.InsidePolygon != null && InsidePolygon.SequenceEqual(input.InsidePolygon)) && (NaturalLanguages == input.NaturalLanguages || NaturalLanguages != null && input.NaturalLanguages != null && NaturalLanguages.SequenceEqual(input.NaturalLanguages)) && (RuleContexts == input.RuleContexts || RuleContexts != null && input.RuleContexts != null && RuleContexts.SequenceEqual(input.RuleContexts)) && @@ -759,7 +757,7 @@ public override bool Equals(object obj) (Mode == input.Mode || Mode.Equals(input.Mode)) && (SemanticSearch == input.SemanticSearch || (SemanticSearch != null && SemanticSearch.Equals(input.SemanticSearch))) && (AdvancedSyntax == input.AdvancedSyntax || AdvancedSyntax.Equals(input.AdvancedSyntax)) && - (OptionalWords == input.OptionalWords || OptionalWords != null && input.OptionalWords != null && OptionalWords.SequenceEqual(input.OptionalWords)) && + (OptionalWords == input.OptionalWords || (OptionalWords != null && OptionalWords.Equals(input.OptionalWords))) && (DisableExactOnAttributes == input.DisableExactOnAttributes || DisableExactOnAttributes != null && input.DisableExactOnAttributes != null && DisableExactOnAttributes.SequenceEqual(input.DisableExactOnAttributes)) && (ExactOnSingleWordQuery == input.ExactOnSingleWordQuery || ExactOnSingleWordQuery.Equals(input.ExactOnSingleWordQuery)) && (AlternativesAsExact == input.AlternativesAsExact || AlternativesAsExact != null && input.AlternativesAsExact != null && AlternativesAsExact.SequenceEqual(input.AlternativesAsExact)) && @@ -768,7 +766,6 @@ public override bool Equals(object obj) (ReplaceSynonymsInHighlight == input.ReplaceSynonymsInHighlight || ReplaceSynonymsInHighlight.Equals(input.ReplaceSynonymsInHighlight)) && (MinProximity == input.MinProximity || MinProximity.Equals(input.MinProximity)) && (ResponseFields == input.ResponseFields || ResponseFields != null && input.ResponseFields != null && ResponseFields.SequenceEqual(input.ResponseFields)) && - (MaxFacetHits == input.MaxFacetHits || MaxFacetHits.Equals(input.MaxFacetHits)) && (MaxValuesPerFacet == input.MaxValuesPerFacet || MaxValuesPerFacet.Equals(input.MaxValuesPerFacet)) && (SortFacetValuesBy == input.SortFacetValuesBy || (SortFacetValuesBy != null && SortFacetValuesBy.Equals(input.SortFacetValuesBy))) && (AttributeCriteriaComputedByMinProximity == input.AttributeCriteriaComputedByMinProximity || AttributeCriteriaComputedByMinProximity.Equals(input.AttributeCriteriaComputedByMinProximity)) && @@ -778,6 +775,7 @@ public override bool Equals(object obj) (Facet == input.Facet || (Facet != null && Facet.Equals(input.Facet))) && (IndexName == input.IndexName || (IndexName != null && IndexName.Equals(input.IndexName))) && (FacetQuery == input.FacetQuery || (FacetQuery != null && FacetQuery.Equals(input.FacetQuery))) && + (MaxFacetHits == input.MaxFacetHits || MaxFacetHits.Equals(input.MaxFacetHits)) && (Type == input.Type || Type.Equals(input.Type)); } @@ -980,7 +978,6 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + ResponseFields.GetHashCode(); } - hashCode = (hashCode * 59) + MaxFacetHits.GetHashCode(); hashCode = (hashCode * 59) + MaxValuesPerFacet.GetHashCode(); if (SortFacetValuesBy != null) { @@ -1008,6 +1005,7 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + FacetQuery.GetHashCode(); } + hashCode = (hashCode * 59) + MaxFacetHits.GetHashCode(); hashCode = (hashCode * 59) + Type.GetHashCode(); return hashCode; } diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SearchForHits.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SearchForHits.cs index a03e2e8c00..87cb18b5e4 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SearchForHits.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SearchForHits.cs @@ -195,11 +195,10 @@ public SearchForHits(string indexName) public int? MinimumAroundRadius { get; set; } /// - /// 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). + /// Gets or Sets InsideBoundingBox /// - /// 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). [JsonPropertyName("insideBoundingBox")] - public List> InsideBoundingBox { get; set; } + public InsideBoundingBox InsideBoundingBox { get; set; } /// /// 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`. @@ -457,11 +456,10 @@ public SearchForHits(string indexName) public bool? AdvancedSyntax { get; set; } /// - /// 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). + /// Gets or Sets OptionalWords /// - /// 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). [JsonPropertyName("optionalWords")] - public List OptionalWords { get; set; } + public OptionalWords OptionalWords { get; set; } /// /// 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. @@ -511,13 +509,6 @@ public SearchForHits(string indexName) [JsonPropertyName("responseFields")] public List ResponseFields { get; set; } - /// - /// 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 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). - [JsonPropertyName("maxFacetHits")] - public int? MaxFacetHits { get; set; } - /// /// Maximum number of facet values to return for each facet. /// @@ -643,7 +634,6 @@ public override string ToString() sb.Append(" ReplaceSynonymsInHighlight: ").Append(ReplaceSynonymsInHighlight).Append("\n"); sb.Append(" MinProximity: ").Append(MinProximity).Append("\n"); sb.Append(" ResponseFields: ").Append(ResponseFields).Append("\n"); - sb.Append(" MaxFacetHits: ").Append(MaxFacetHits).Append("\n"); sb.Append(" MaxValuesPerFacet: ").Append(MaxValuesPerFacet).Append("\n"); sb.Append(" SortFacetValuesBy: ").Append(SortFacetValuesBy).Append("\n"); sb.Append(" AttributeCriteriaComputedByMinProximity: ").Append(AttributeCriteriaComputedByMinProximity).Append("\n"); @@ -698,7 +688,7 @@ public override bool Equals(object obj) (AroundRadius == input.AroundRadius || (AroundRadius != null && AroundRadius.Equals(input.AroundRadius))) && (AroundPrecision == input.AroundPrecision || (AroundPrecision != null && AroundPrecision.Equals(input.AroundPrecision))) && (MinimumAroundRadius == input.MinimumAroundRadius || MinimumAroundRadius.Equals(input.MinimumAroundRadius)) && - (InsideBoundingBox == input.InsideBoundingBox || InsideBoundingBox != null && input.InsideBoundingBox != null && InsideBoundingBox.SequenceEqual(input.InsideBoundingBox)) && + (InsideBoundingBox == input.InsideBoundingBox || (InsideBoundingBox != null && InsideBoundingBox.Equals(input.InsideBoundingBox))) && (InsidePolygon == input.InsidePolygon || InsidePolygon != null && input.InsidePolygon != null && InsidePolygon.SequenceEqual(input.InsidePolygon)) && (NaturalLanguages == input.NaturalLanguages || NaturalLanguages != null && input.NaturalLanguages != null && NaturalLanguages.SequenceEqual(input.NaturalLanguages)) && (RuleContexts == input.RuleContexts || RuleContexts != null && input.RuleContexts != null && RuleContexts.SequenceEqual(input.RuleContexts)) && @@ -739,7 +729,7 @@ public override bool Equals(object obj) (Mode == input.Mode || Mode.Equals(input.Mode)) && (SemanticSearch == input.SemanticSearch || (SemanticSearch != null && SemanticSearch.Equals(input.SemanticSearch))) && (AdvancedSyntax == input.AdvancedSyntax || AdvancedSyntax.Equals(input.AdvancedSyntax)) && - (OptionalWords == input.OptionalWords || OptionalWords != null && input.OptionalWords != null && OptionalWords.SequenceEqual(input.OptionalWords)) && + (OptionalWords == input.OptionalWords || (OptionalWords != null && OptionalWords.Equals(input.OptionalWords))) && (DisableExactOnAttributes == input.DisableExactOnAttributes || DisableExactOnAttributes != null && input.DisableExactOnAttributes != null && DisableExactOnAttributes.SequenceEqual(input.DisableExactOnAttributes)) && (ExactOnSingleWordQuery == input.ExactOnSingleWordQuery || ExactOnSingleWordQuery.Equals(input.ExactOnSingleWordQuery)) && (AlternativesAsExact == input.AlternativesAsExact || AlternativesAsExact != null && input.AlternativesAsExact != null && AlternativesAsExact.SequenceEqual(input.AlternativesAsExact)) && @@ -748,7 +738,6 @@ public override bool Equals(object obj) (ReplaceSynonymsInHighlight == input.ReplaceSynonymsInHighlight || ReplaceSynonymsInHighlight.Equals(input.ReplaceSynonymsInHighlight)) && (MinProximity == input.MinProximity || MinProximity.Equals(input.MinProximity)) && (ResponseFields == input.ResponseFields || ResponseFields != null && input.ResponseFields != null && ResponseFields.SequenceEqual(input.ResponseFields)) && - (MaxFacetHits == input.MaxFacetHits || MaxFacetHits.Equals(input.MaxFacetHits)) && (MaxValuesPerFacet == input.MaxValuesPerFacet || MaxValuesPerFacet.Equals(input.MaxValuesPerFacet)) && (SortFacetValuesBy == input.SortFacetValuesBy || (SortFacetValuesBy != null && SortFacetValuesBy.Equals(input.SortFacetValuesBy))) && (AttributeCriteriaComputedByMinProximity == input.AttributeCriteriaComputedByMinProximity || AttributeCriteriaComputedByMinProximity.Equals(input.AttributeCriteriaComputedByMinProximity)) && @@ -958,7 +947,6 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + ResponseFields.GetHashCode(); } - hashCode = (hashCode * 59) + MaxFacetHits.GetHashCode(); hashCode = (hashCode * 59) + MaxValuesPerFacet.GetHashCode(); if (SortFacetValuesBy != null) { diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SearchParamsObject.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SearchParamsObject.cs index 8b462c4fb2..af0516df5b 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SearchParamsObject.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SearchParamsObject.cs @@ -175,11 +175,10 @@ public SearchParamsObject() public int? MinimumAroundRadius { get; set; } /// - /// 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). + /// Gets or Sets InsideBoundingBox /// - /// 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). [JsonPropertyName("insideBoundingBox")] - public List> InsideBoundingBox { get; set; } + public InsideBoundingBox InsideBoundingBox { get; set; } /// /// 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`. @@ -437,11 +436,10 @@ public SearchParamsObject() public bool? AdvancedSyntax { get; set; } /// - /// 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). + /// Gets or Sets OptionalWords /// - /// 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). [JsonPropertyName("optionalWords")] - public List OptionalWords { get; set; } + public OptionalWords OptionalWords { get; set; } /// /// 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. @@ -491,13 +489,6 @@ public SearchParamsObject() [JsonPropertyName("responseFields")] public List ResponseFields { get; set; } - /// - /// 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 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). - [JsonPropertyName("maxFacetHits")] - public int? MaxFacetHits { get; set; } - /// /// Maximum number of facet values to return for each facet. /// @@ -615,7 +606,6 @@ public override string ToString() sb.Append(" ReplaceSynonymsInHighlight: ").Append(ReplaceSynonymsInHighlight).Append("\n"); sb.Append(" MinProximity: ").Append(MinProximity).Append("\n"); sb.Append(" ResponseFields: ").Append(ResponseFields).Append("\n"); - sb.Append(" MaxFacetHits: ").Append(MaxFacetHits).Append("\n"); sb.Append(" MaxValuesPerFacet: ").Append(MaxValuesPerFacet).Append("\n"); sb.Append(" SortFacetValuesBy: ").Append(SortFacetValuesBy).Append("\n"); sb.Append(" AttributeCriteriaComputedByMinProximity: ").Append(AttributeCriteriaComputedByMinProximity).Append("\n"); @@ -667,7 +657,7 @@ public override bool Equals(object obj) (AroundRadius == input.AroundRadius || (AroundRadius != null && AroundRadius.Equals(input.AroundRadius))) && (AroundPrecision == input.AroundPrecision || (AroundPrecision != null && AroundPrecision.Equals(input.AroundPrecision))) && (MinimumAroundRadius == input.MinimumAroundRadius || MinimumAroundRadius.Equals(input.MinimumAroundRadius)) && - (InsideBoundingBox == input.InsideBoundingBox || InsideBoundingBox != null && input.InsideBoundingBox != null && InsideBoundingBox.SequenceEqual(input.InsideBoundingBox)) && + (InsideBoundingBox == input.InsideBoundingBox || (InsideBoundingBox != null && InsideBoundingBox.Equals(input.InsideBoundingBox))) && (InsidePolygon == input.InsidePolygon || InsidePolygon != null && input.InsidePolygon != null && InsidePolygon.SequenceEqual(input.InsidePolygon)) && (NaturalLanguages == input.NaturalLanguages || NaturalLanguages != null && input.NaturalLanguages != null && NaturalLanguages.SequenceEqual(input.NaturalLanguages)) && (RuleContexts == input.RuleContexts || RuleContexts != null && input.RuleContexts != null && RuleContexts.SequenceEqual(input.RuleContexts)) && @@ -708,7 +698,7 @@ public override bool Equals(object obj) (Mode == input.Mode || Mode.Equals(input.Mode)) && (SemanticSearch == input.SemanticSearch || (SemanticSearch != null && SemanticSearch.Equals(input.SemanticSearch))) && (AdvancedSyntax == input.AdvancedSyntax || AdvancedSyntax.Equals(input.AdvancedSyntax)) && - (OptionalWords == input.OptionalWords || OptionalWords != null && input.OptionalWords != null && OptionalWords.SequenceEqual(input.OptionalWords)) && + (OptionalWords == input.OptionalWords || (OptionalWords != null && OptionalWords.Equals(input.OptionalWords))) && (DisableExactOnAttributes == input.DisableExactOnAttributes || DisableExactOnAttributes != null && input.DisableExactOnAttributes != null && DisableExactOnAttributes.SequenceEqual(input.DisableExactOnAttributes)) && (ExactOnSingleWordQuery == input.ExactOnSingleWordQuery || ExactOnSingleWordQuery.Equals(input.ExactOnSingleWordQuery)) && (AlternativesAsExact == input.AlternativesAsExact || AlternativesAsExact != null && input.AlternativesAsExact != null && AlternativesAsExact.SequenceEqual(input.AlternativesAsExact)) && @@ -717,7 +707,6 @@ public override bool Equals(object obj) (ReplaceSynonymsInHighlight == input.ReplaceSynonymsInHighlight || ReplaceSynonymsInHighlight.Equals(input.ReplaceSynonymsInHighlight)) && (MinProximity == input.MinProximity || MinProximity.Equals(input.MinProximity)) && (ResponseFields == input.ResponseFields || ResponseFields != null && input.ResponseFields != null && ResponseFields.SequenceEqual(input.ResponseFields)) && - (MaxFacetHits == input.MaxFacetHits || MaxFacetHits.Equals(input.MaxFacetHits)) && (MaxValuesPerFacet == input.MaxValuesPerFacet || MaxValuesPerFacet.Equals(input.MaxValuesPerFacet)) && (SortFacetValuesBy == input.SortFacetValuesBy || (SortFacetValuesBy != null && SortFacetValuesBy.Equals(input.SortFacetValuesBy))) && (AttributeCriteriaComputedByMinProximity == input.AttributeCriteriaComputedByMinProximity || AttributeCriteriaComputedByMinProximity.Equals(input.AttributeCriteriaComputedByMinProximity)) && @@ -921,7 +910,6 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + ResponseFields.GetHashCode(); } - hashCode = (hashCode * 59) + MaxFacetHits.GetHashCode(); hashCode = (hashCode * 59) + MaxValuesPerFacet.GetHashCode(); if (SortFacetValuesBy != null) { diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SettingsResponse.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SettingsResponse.cs index d9990e39dd..2102170c97 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SettingsResponse.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SettingsResponse.cs @@ -166,6 +166,13 @@ public SettingsResponse() [JsonPropertyName("attributeForDistinct")] public string AttributeForDistinct { get; set; } + /// + /// 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 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). + [JsonPropertyName("maxFacetHits")] + public int? MaxFacetHits { get; set; } + /// /// 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. /// @@ -338,11 +345,10 @@ public SettingsResponse() public bool? AdvancedSyntax { get; set; } /// - /// 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). + /// Gets or Sets OptionalWords /// - /// 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). [JsonPropertyName("optionalWords")] - public List OptionalWords { get; set; } + public OptionalWords OptionalWords { get; set; } /// /// 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. @@ -392,13 +398,6 @@ public SettingsResponse() [JsonPropertyName("responseFields")] public List ResponseFields { get; set; } - /// - /// 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 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). - [JsonPropertyName("maxFacetHits")] - public int? MaxFacetHits { get; set; } - /// /// Maximum number of facet values to return for each facet. /// @@ -471,6 +470,7 @@ public override string ToString() sb.Append(" UserData: ").Append(UserData).Append("\n"); sb.Append(" CustomNormalization: ").Append(CustomNormalization).Append("\n"); sb.Append(" AttributeForDistinct: ").Append(AttributeForDistinct).Append("\n"); + sb.Append(" MaxFacetHits: ").Append(MaxFacetHits).Append("\n"); sb.Append(" AttributesToRetrieve: ").Append(AttributesToRetrieve).Append("\n"); sb.Append(" Ranking: ").Append(Ranking).Append("\n"); sb.Append(" CustomRanking: ").Append(CustomRanking).Append("\n"); @@ -508,7 +508,6 @@ public override string ToString() sb.Append(" ReplaceSynonymsInHighlight: ").Append(ReplaceSynonymsInHighlight).Append("\n"); sb.Append(" MinProximity: ").Append(MinProximity).Append("\n"); sb.Append(" ResponseFields: ").Append(ResponseFields).Append("\n"); - sb.Append(" MaxFacetHits: ").Append(MaxFacetHits).Append("\n"); sb.Append(" MaxValuesPerFacet: ").Append(MaxValuesPerFacet).Append("\n"); sb.Append(" SortFacetValuesBy: ").Append(SortFacetValuesBy).Append("\n"); sb.Append(" AttributeCriteriaComputedByMinProximity: ").Append(AttributeCriteriaComputedByMinProximity).Append("\n"); @@ -559,6 +558,7 @@ public override bool Equals(object obj) (UserData == input.UserData || (UserData != null && UserData.Equals(input.UserData))) && (CustomNormalization == input.CustomNormalization || CustomNormalization != null && input.CustomNormalization != null && CustomNormalization.SequenceEqual(input.CustomNormalization)) && (AttributeForDistinct == input.AttributeForDistinct || (AttributeForDistinct != null && AttributeForDistinct.Equals(input.AttributeForDistinct))) && + (MaxFacetHits == input.MaxFacetHits || MaxFacetHits.Equals(input.MaxFacetHits)) && (AttributesToRetrieve == input.AttributesToRetrieve || AttributesToRetrieve != null && input.AttributesToRetrieve != null && AttributesToRetrieve.SequenceEqual(input.AttributesToRetrieve)) && (Ranking == input.Ranking || Ranking != null && input.Ranking != null && Ranking.SequenceEqual(input.Ranking)) && (CustomRanking == input.CustomRanking || CustomRanking != null && input.CustomRanking != null && CustomRanking.SequenceEqual(input.CustomRanking)) && @@ -587,7 +587,7 @@ public override bool Equals(object obj) (Mode == input.Mode || Mode.Equals(input.Mode)) && (SemanticSearch == input.SemanticSearch || (SemanticSearch != null && SemanticSearch.Equals(input.SemanticSearch))) && (AdvancedSyntax == input.AdvancedSyntax || AdvancedSyntax.Equals(input.AdvancedSyntax)) && - (OptionalWords == input.OptionalWords || OptionalWords != null && input.OptionalWords != null && OptionalWords.SequenceEqual(input.OptionalWords)) && + (OptionalWords == input.OptionalWords || (OptionalWords != null && OptionalWords.Equals(input.OptionalWords))) && (DisableExactOnAttributes == input.DisableExactOnAttributes || DisableExactOnAttributes != null && input.DisableExactOnAttributes != null && DisableExactOnAttributes.SequenceEqual(input.DisableExactOnAttributes)) && (ExactOnSingleWordQuery == input.ExactOnSingleWordQuery || ExactOnSingleWordQuery.Equals(input.ExactOnSingleWordQuery)) && (AlternativesAsExact == input.AlternativesAsExact || AlternativesAsExact != null && input.AlternativesAsExact != null && AlternativesAsExact.SequenceEqual(input.AlternativesAsExact)) && @@ -596,7 +596,6 @@ public override bool Equals(object obj) (ReplaceSynonymsInHighlight == input.ReplaceSynonymsInHighlight || ReplaceSynonymsInHighlight.Equals(input.ReplaceSynonymsInHighlight)) && (MinProximity == input.MinProximity || MinProximity.Equals(input.MinProximity)) && (ResponseFields == input.ResponseFields || ResponseFields != null && input.ResponseFields != null && ResponseFields.SequenceEqual(input.ResponseFields)) && - (MaxFacetHits == input.MaxFacetHits || MaxFacetHits.Equals(input.MaxFacetHits)) && (MaxValuesPerFacet == input.MaxValuesPerFacet || MaxValuesPerFacet.Equals(input.MaxValuesPerFacet)) && (SortFacetValuesBy == input.SortFacetValuesBy || (SortFacetValuesBy != null && SortFacetValuesBy.Equals(input.SortFacetValuesBy))) && (AttributeCriteriaComputedByMinProximity == input.AttributeCriteriaComputedByMinProximity || AttributeCriteriaComputedByMinProximity.Equals(input.AttributeCriteriaComputedByMinProximity)) && @@ -677,6 +676,7 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + AttributeForDistinct.GetHashCode(); } + hashCode = (hashCode * 59) + MaxFacetHits.GetHashCode(); if (AttributesToRetrieve != null) { hashCode = (hashCode * 59) + AttributesToRetrieve.GetHashCode(); @@ -777,7 +777,6 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + ResponseFields.GetHashCode(); } - hashCode = (hashCode * 59) + MaxFacetHits.GetHashCode(); hashCode = (hashCode * 59) + MaxValuesPerFacet.GetHashCode(); if (SortFacetValuesBy != null) { diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SnippetResult.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SnippetResult.cs index b82a385b27..1fabe1c75e 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SnippetResult.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/SnippetResult.cs @@ -34,7 +34,7 @@ public SnippetResult(SnippetResultOption actualInstance) /// Initializes a new instance of the SnippetResult class /// with a Dictionary{string, SnippetResult} /// - /// An instance of Dictionary<string, SnippetResult>. + /// An instance of Dictionary. public SnippetResult(Dictionary actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); @@ -44,7 +44,7 @@ public SnippetResult(Dictionary actualInstance) /// Initializes a new instance of the SnippetResult class /// with a List{SnippetResult} /// - /// An instance of List<SnippetResult>. + /// An instance of List. public SnippetResult(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/TagFilters.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/TagFilters.cs index c51edca3fa..9c13ee3560 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/TagFilters.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/TagFilters.cs @@ -24,7 +24,7 @@ public partial class TagFilters : AbstractSchema /// Initializes a new instance of the TagFilters class /// with a List{TagFilters} /// - /// An instance of List<TagFilters>. + /// An instance of List. public TagFilters(List actualInstance) { ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_index_settings.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_index_settings.dart index 516ec1f546..4e5c264df1 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_index_settings.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_index_settings.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_index_settings.g.dart index 2d5fe182fc..7d1c260bad 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_index_settings.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_recommend_index_settings.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_recommend_index_settings.dart index 3707f35de2..0bc246b70b 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_recommend_index_settings.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_recommend_index_settings.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_recommend_index_settings.g.dart index 3c0684f9d2..6ed70e8636 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_recommend_index_settings.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_recommend_search_params.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_recommend_search_params.dart index 7b9a93c666..e302fa1908 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_recommend_search_params.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_recommend_search_params.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_recommend_search_params.g.dart index 439e57dfaf..e6788d7092 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_recommend_search_params.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params.dart index 979fd35238..aeb85a7246 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params.g.dart index 6222a9f8e2..f49c46cd20 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params_without_query.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params_without_query.dart index 8fd30b7d63..ebcc6ba798 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params_without_query.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params_without_query.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params_without_query.g.dart index 02715e207f..f881eaf7e1 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params_without_query.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/browse_params_object.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/browse_params_object.dart index 57d42834ab..589a9588fc 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/browse_params_object.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/browse_params_object.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/browse_params_object.g.dart index 12bc6a26bf..14d21860be 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/browse_params_object.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/consequence_params.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/consequence_params.dart index 3b47942219..42018ab0d0 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/consequence_params.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/consequence_params.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/consequence_params.g.dart index 82861f7839..91f10eb5d6 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/consequence_params.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/fallback_params.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/fallback_params.dart index 5a1f64705a..293618d76c 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/fallback_params.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/fallback_params.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/fallback_params.g.dart index 7745b327fb..95a74455ee 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/fallback_params.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings.dart index a48cd8875b..a789381223 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings.g.dart index 2132b6dfa3..87e6c4ce0c 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings_as_search_params.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings_as_search_params.dart index 61d5b61314..97803f0146 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings_as_search_params.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings_as_search_params.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings_as_search_params.g.dart index d0bc7106e0..d91c8408bf 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings_as_search_params.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommend_index_settings.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommend_index_settings.dart index 405e31724a..5c735660d5 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommend_index_settings.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommend_index_settings.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommend_index_settings.g.dart index 79e862e694..1033f0f58d 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommend_index_settings.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommend_search_params.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommend_search_params.dart index 589f6f8460..31a0fd795e 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommend_search_params.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommend_search_params.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommend_search_params.g.dart index cab82103c7..b077e58fbd 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommend_search_params.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_facets.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_facets.dart index 7e9c0e27cf..ce07b81ea7 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_facets.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_facets.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_facets.g.dart index cc577ea0a2..10156ef871 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_facets.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_hits.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_hits.dart index 47e1665d28..ba28835f5a 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_hits.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_hits.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_hits.g.dart index 3ffb21ae91..6fbd4715b8 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_hits.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_params_object.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_params_object.dart index ff88660c8c..fb4f951c13 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_params_object.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_params_object.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_params_object.g.dart index 7cd278bd90..8b20770d5d 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_params_object.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/settings_response.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/settings_response.dart index 7e77e3895a..6e330abd5f 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/settings_response.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/settings_response.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/settings_response.g.dart index 07cbbdf65e..4a5dc1803e 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/settings_response.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_index_settings.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_index_settings.dart index 465e4fa52b..f4bc591863 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_index_settings.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_index_settings.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_index_settings.g.dart index 2d5fe182fc..7d1c260bad 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_index_settings.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_index_settings.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_index_settings.dart index 01c76b00a3..083607cea7 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_index_settings.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_index_settings.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_index_settings.g.dart index 3c0684f9d2..6ed70e8636 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_index_settings.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_search_params.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_search_params.dart index f31feb44bc..3664b5530a 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_search_params.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_search_params.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_search_params.g.dart index 439e57dfaf..e6788d7092 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_search_params.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/fallback_params.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/fallback_params.dart index 5274bb17da..2760dc83d5 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/fallback_params.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/fallback_params.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/fallback_params.g.dart index 7745b327fb..95a74455ee 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/fallback_params.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_index_settings.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_index_settings.dart index 2bba9c0389..cc0d274ebb 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_index_settings.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_index_settings.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_index_settings.g.dart index 79e862e694..1033f0f58d 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_index_settings.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_search_params.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_search_params.dart index 8970418fca..87848d10ac 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_search_params.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_search_params.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_search_params.g.dart index cab82103c7..b077e58fbd 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_search_params.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_index_settings.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_index_settings.dart index 1d3769db2d..ab405f0455 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_index_settings.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_index_settings.g.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_index_settings.g.dart index 2d5fe182fc..7d1c260bad 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_index_settings.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params.dart index 2e7673d7c7..7d67403f0b 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params.g.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params.g.dart index 6222a9f8e2..f49c46cd20 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params_without_query.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params_without_query.dart index 14e2e6e3dd..2bd201417a 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params_without_query.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params_without_query.g.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params_without_query.g.dart index 02715e207f..f881eaf7e1 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params_without_query.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/browse_params_object.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/browse_params_object.dart index 12fc0bd3c3..5625ddc6b9 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/browse_params_object.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/browse_params_object.g.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/browse_params_object.g.dart index 12bc6a26bf..14d21860be 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/browse_params_object.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/consequence_params.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/consequence_params.dart index d4411f6409..b818dfaace 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/consequence_params.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/consequence_params.g.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/consequence_params.g.dart index 82861f7839..91f10eb5d6 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/consequence_params.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/delete_by_params.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/delete_by_params.dart index 68c7f4872e..787bcafa6a 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/delete_by_params.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/delete_by_params.g.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/delete_by_params.g.dart index 5aedc3630b..48cd7bed8c 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/delete_by_params.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings.dart index 019daf5952..21f010e98e 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings.g.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings.g.dart index 2132b6dfa3..87e6c4ce0c 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings_as_search_params.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings_as_search_params.dart index 6a770d046b..4c8cdfe79b 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings_as_search_params.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings_as_search_params.g.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings_as_search_params.g.dart index d0bc7106e0..d91c8408bf 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings_as_search_params.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_facets.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_facets.dart index a31d4800a5..c97e484725 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_facets.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_facets.g.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_facets.g.dart index cc577ea0a2..10156ef871 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_facets.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_hits.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_hits.dart index 89529e6d52..1c8da98569 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_hits.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_hits.g.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_hits.g.dart index 3ffb21ae91..6fbd4715b8 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_hits.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_params_object.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_params_object.dart index fb0c972eb7..9872e6a48e 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_params_object.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_params_object.g.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_params_object.g.dart index 7cd278bd90..8b20770d5d 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_params_object.g.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/settings_response.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/settings_response.dart index 414496877b..8897baf2d5 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/settings_response.dart +++ b/clients/algoliasearch-client-dart/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/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/settings_response.g.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/settings_response.g.dart index 07cbbdf65e..4a5dc1803e 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/settings_response.g.dart +++ b/clients/algoliasearch-client-dart/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', diff --git a/clients/algoliasearch-client-go/algolia/recommend/model_fallback_params.go b/clients/algoliasearch-client-go/algolia/recommend/model_fallback_params.go index 2112115fc5..e0343a4923 100644 --- a/clients/algoliasearch-client-go/algolia/recommend/model_fallback_params.go +++ b/clients/algoliasearch-client-go/algolia/recommend/model_fallback_params.go @@ -4,6 +4,8 @@ package recommend import ( "encoding/json" "fmt" + + "github.com/algolia/algoliasearch-client-go/v4/algolia/utils" ) // FallbackParams struct for FallbackParams. @@ -31,9 +33,8 @@ type FallbackParams struct { AroundRadius *AroundRadius `json:"aroundRadius,omitempty"` AroundPrecision *AroundPrecision `json:"aroundPrecision,omitempty"` // Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - MinimumAroundRadius *int32 `json:"minimumAroundRadius,omitempty"` - // 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). - InsideBoundingBox [][]float64 `json:"insideBoundingBox,omitempty"` + MinimumAroundRadius *int32 `json:"minimumAroundRadius,omitempty"` + InsideBoundingBox utils.Nullable[InsideBoundingBox] `json:"insideBoundingBox,omitempty"` // 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`. InsidePolygon [][]float64 `json:"insidePolygon,omitempty"` // ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. @@ -94,6 +95,8 @@ type FallbackParams struct { CustomNormalization *map[string]map[string]string `json:"customNormalization,omitempty"` // Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. AttributeForDistinct *string `json:"attributeForDistinct,omitempty"` + // 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). + MaxFacetHits *int32 `json:"maxFacetHits,omitempty"` // 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. AttributesToRetrieve []string `json:"attributesToRetrieve,omitempty"` // Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/). @@ -134,9 +137,8 @@ type FallbackParams struct { QueryType *QueryType `json:"queryType,omitempty"` RemoveWordsIfNoResults *RemoveWordsIfNoResults `json:"removeWordsIfNoResults,omitempty"` // Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` - // 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). - OptionalWords []string `json:"optionalWords,omitempty"` + AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` + OptionalWords utils.Nullable[OptionalWords] `json:"optionalWords,omitempty"` // 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. DisableExactOnAttributes []string `json:"disableExactOnAttributes,omitempty"` ExactOnSingleWordQuery *ExactOnSingleWordQuery `json:"exactOnSingleWordQuery,omitempty"` @@ -151,8 +153,6 @@ type FallbackParams struct { MinProximity *int32 `json:"minProximity,omitempty"` // Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. ResponseFields []string `json:"responseFields,omitempty"` - // 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). - MaxFacetHits *int32 `json:"maxFacetHits,omitempty"` // Maximum number of facet values to return for each facet. MaxValuesPerFacet *int32 `json:"maxValuesPerFacet,omitempty"` // Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). @@ -257,7 +257,7 @@ func WithFallbackParamsMinimumAroundRadius(val int32) FallbackParamsOption { } } -func WithFallbackParamsInsideBoundingBox(val [][]float64) FallbackParamsOption { +func WithFallbackParamsInsideBoundingBox(val utils.Nullable[InsideBoundingBox]) FallbackParamsOption { return func(f *FallbackParams) { f.InsideBoundingBox = val } @@ -443,6 +443,12 @@ func WithFallbackParamsAttributeForDistinct(val string) FallbackParamsOption { } } +func WithFallbackParamsMaxFacetHits(val int32) FallbackParamsOption { + return func(f *FallbackParams) { + f.MaxFacetHits = &val + } +} + func WithFallbackParamsAttributesToRetrieve(val []string) FallbackParamsOption { return func(f *FallbackParams) { f.AttributesToRetrieve = val @@ -581,7 +587,7 @@ func WithFallbackParamsAdvancedSyntax(val bool) FallbackParamsOption { } } -func WithFallbackParamsOptionalWords(val []string) FallbackParamsOption { +func WithFallbackParamsOptionalWords(val utils.Nullable[OptionalWords]) FallbackParamsOption { return func(f *FallbackParams) { f.OptionalWords = val } @@ -635,12 +641,6 @@ func WithFallbackParamsResponseFields(val []string) FallbackParamsOption { } } -func WithFallbackParamsMaxFacetHits(val int32) FallbackParamsOption { - return func(f *FallbackParams) { - f.MaxFacetHits = &val - } -} - func WithFallbackParamsMaxValuesPerFacet(val int32) FallbackParamsOption { return func(f *FallbackParams) { f.MaxValuesPerFacet = &val @@ -1189,39 +1189,50 @@ func (o *FallbackParams) SetMinimumAroundRadius(v int32) *FallbackParams { return o } -// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise. -func (o *FallbackParams) GetInsideBoundingBox() [][]float64 { - if o == nil || o.InsideBoundingBox == nil { - var ret [][]float64 +// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FallbackParams) GetInsideBoundingBox() InsideBoundingBox { + if o == nil || o.InsideBoundingBox.Get() == nil { + var ret InsideBoundingBox return ret } - return o.InsideBoundingBox + return *o.InsideBoundingBox.Get() } // GetInsideBoundingBoxOk returns a tuple with the InsideBoundingBox field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *FallbackParams) GetInsideBoundingBoxOk() ([][]float64, bool) { - if o == nil || o.InsideBoundingBox == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *FallbackParams) GetInsideBoundingBoxOk() (*InsideBoundingBox, bool) { + if o == nil { return nil, false } - return o.InsideBoundingBox, true + return o.InsideBoundingBox.Get(), o.InsideBoundingBox.IsSet() } // HasInsideBoundingBox returns a boolean if a field has been set. func (o *FallbackParams) HasInsideBoundingBox() bool { - if o != nil && o.InsideBoundingBox != nil { + if o != nil && o.InsideBoundingBox.IsSet() { return true } return false } -// SetInsideBoundingBox gets a reference to the given [][]float64 and assigns it to the InsideBoundingBox field. -func (o *FallbackParams) SetInsideBoundingBox(v [][]float64) *FallbackParams { - o.InsideBoundingBox = v +// SetInsideBoundingBox gets a reference to the given utils.Nullable[InsideBoundingBox] and assigns it to the InsideBoundingBox field. +func (o *FallbackParams) SetInsideBoundingBox(v *InsideBoundingBox) *FallbackParams { + o.InsideBoundingBox.Set(v) return o } +// SetInsideBoundingBoxNil sets the value for InsideBoundingBox to be an explicit nil. +func (o *FallbackParams) SetInsideBoundingBoxNil() { + o.InsideBoundingBox.Set(nil) +} + +// UnsetInsideBoundingBox ensures that no value is present for InsideBoundingBox, not even an explicit nil. +func (o *FallbackParams) UnsetInsideBoundingBox() { + o.InsideBoundingBox.Unset() +} + // GetInsidePolygon returns the InsidePolygon field value if set, zero value otherwise. func (o *FallbackParams) GetInsidePolygon() [][]float64 { if o == nil || o.InsidePolygon == nil { @@ -2212,6 +2223,39 @@ func (o *FallbackParams) SetAttributeForDistinct(v string) *FallbackParams { return o } +// GetMaxFacetHits returns the MaxFacetHits field value if set, zero value otherwise. +func (o *FallbackParams) GetMaxFacetHits() int32 { + if o == nil || o.MaxFacetHits == nil { + var ret int32 + return ret + } + return *o.MaxFacetHits +} + +// GetMaxFacetHitsOk returns a tuple with the MaxFacetHits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FallbackParams) GetMaxFacetHitsOk() (*int32, bool) { + if o == nil || o.MaxFacetHits == nil { + return nil, false + } + return o.MaxFacetHits, true +} + +// HasMaxFacetHits returns a boolean if a field has been set. +func (o *FallbackParams) HasMaxFacetHits() bool { + if o != nil && o.MaxFacetHits != nil { + return true + } + + return false +} + +// SetMaxFacetHits gets a reference to the given int32 and assigns it to the MaxFacetHits field. +func (o *FallbackParams) SetMaxFacetHits(v int32) *FallbackParams { + o.MaxFacetHits = &v + return o +} + // GetAttributesToRetrieve returns the AttributesToRetrieve field value if set, zero value otherwise. func (o *FallbackParams) GetAttributesToRetrieve() []string { if o == nil || o.AttributesToRetrieve == nil { @@ -2971,39 +3015,50 @@ func (o *FallbackParams) SetAdvancedSyntax(v bool) *FallbackParams { return o } -// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise. -func (o *FallbackParams) GetOptionalWords() []string { - if o == nil || o.OptionalWords == nil { - var ret []string +// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FallbackParams) GetOptionalWords() OptionalWords { + if o == nil || o.OptionalWords.Get() == nil { + var ret OptionalWords return ret } - return o.OptionalWords + return *o.OptionalWords.Get() } // GetOptionalWordsOk returns a tuple with the OptionalWords field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *FallbackParams) GetOptionalWordsOk() ([]string, bool) { - if o == nil || o.OptionalWords == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *FallbackParams) GetOptionalWordsOk() (*OptionalWords, bool) { + if o == nil { return nil, false } - return o.OptionalWords, true + return o.OptionalWords.Get(), o.OptionalWords.IsSet() } // HasOptionalWords returns a boolean if a field has been set. func (o *FallbackParams) HasOptionalWords() bool { - if o != nil && o.OptionalWords != nil { + if o != nil && o.OptionalWords.IsSet() { return true } return false } -// SetOptionalWords gets a reference to the given []string and assigns it to the OptionalWords field. -func (o *FallbackParams) SetOptionalWords(v []string) *FallbackParams { - o.OptionalWords = v +// SetOptionalWords gets a reference to the given utils.Nullable[OptionalWords] and assigns it to the OptionalWords field. +func (o *FallbackParams) SetOptionalWords(v *OptionalWords) *FallbackParams { + o.OptionalWords.Set(v) return o } +// SetOptionalWordsNil sets the value for OptionalWords to be an explicit nil. +func (o *FallbackParams) SetOptionalWordsNil() { + o.OptionalWords.Set(nil) +} + +// UnsetOptionalWords ensures that no value is present for OptionalWords, not even an explicit nil. +func (o *FallbackParams) UnsetOptionalWords() { + o.OptionalWords.Unset() +} + // GetDisableExactOnAttributes returns the DisableExactOnAttributes field value if set, zero value otherwise. func (o *FallbackParams) GetDisableExactOnAttributes() []string { if o == nil || o.DisableExactOnAttributes == nil { @@ -3268,39 +3323,6 @@ func (o *FallbackParams) SetResponseFields(v []string) *FallbackParams { return o } -// GetMaxFacetHits returns the MaxFacetHits field value if set, zero value otherwise. -func (o *FallbackParams) GetMaxFacetHits() int32 { - if o == nil || o.MaxFacetHits == nil { - var ret int32 - return ret - } - return *o.MaxFacetHits -} - -// GetMaxFacetHitsOk returns a tuple with the MaxFacetHits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FallbackParams) GetMaxFacetHitsOk() (*int32, bool) { - if o == nil || o.MaxFacetHits == nil { - return nil, false - } - return o.MaxFacetHits, true -} - -// HasMaxFacetHits returns a boolean if a field has been set. -func (o *FallbackParams) HasMaxFacetHits() bool { - if o != nil && o.MaxFacetHits != nil { - return true - } - - return false -} - -// SetMaxFacetHits gets a reference to the given int32 and assigns it to the MaxFacetHits field. -func (o *FallbackParams) SetMaxFacetHits(v int32) *FallbackParams { - o.MaxFacetHits = &v - return o -} - // GetMaxValuesPerFacet returns the MaxValuesPerFacet field value if set, zero value otherwise. func (o *FallbackParams) GetMaxValuesPerFacet() int32 { if o == nil || o.MaxValuesPerFacet == nil { @@ -3546,8 +3568,8 @@ func (o FallbackParams) MarshalJSON() ([]byte, error) { if o.MinimumAroundRadius != nil { toSerialize["minimumAroundRadius"] = o.MinimumAroundRadius } - if o.InsideBoundingBox != nil { - toSerialize["insideBoundingBox"] = o.InsideBoundingBox + if o.InsideBoundingBox.IsSet() { + toSerialize["insideBoundingBox"] = o.InsideBoundingBox.Get() } if o.InsidePolygon != nil { toSerialize["insidePolygon"] = o.InsidePolygon @@ -3639,6 +3661,9 @@ func (o FallbackParams) MarshalJSON() ([]byte, error) { if o.AttributeForDistinct != nil { toSerialize["attributeForDistinct"] = o.AttributeForDistinct } + if o.MaxFacetHits != nil { + toSerialize["maxFacetHits"] = o.MaxFacetHits + } if o.AttributesToRetrieve != nil { toSerialize["attributesToRetrieve"] = o.AttributesToRetrieve } @@ -3708,8 +3733,8 @@ func (o FallbackParams) MarshalJSON() ([]byte, error) { if o.AdvancedSyntax != nil { toSerialize["advancedSyntax"] = o.AdvancedSyntax } - if o.OptionalWords != nil { - toSerialize["optionalWords"] = o.OptionalWords + if o.OptionalWords.IsSet() { + toSerialize["optionalWords"] = o.OptionalWords.Get() } if o.DisableExactOnAttributes != nil { toSerialize["disableExactOnAttributes"] = o.DisableExactOnAttributes @@ -3735,9 +3760,6 @@ func (o FallbackParams) MarshalJSON() ([]byte, error) { if o.ResponseFields != nil { toSerialize["responseFields"] = o.ResponseFields } - if o.MaxFacetHits != nil { - toSerialize["maxFacetHits"] = o.MaxFacetHits - } if o.MaxValuesPerFacet != nil { toSerialize["maxValuesPerFacet"] = o.MaxValuesPerFacet } @@ -3812,6 +3834,7 @@ func (o FallbackParams) String() string { out += fmt.Sprintf(" userData=%v\n", o.UserData) out += fmt.Sprintf(" customNormalization=%v\n", o.CustomNormalization) out += fmt.Sprintf(" attributeForDistinct=%v\n", o.AttributeForDistinct) + out += fmt.Sprintf(" maxFacetHits=%v\n", o.MaxFacetHits) out += fmt.Sprintf(" attributesToRetrieve=%v\n", o.AttributesToRetrieve) out += fmt.Sprintf(" ranking=%v\n", o.Ranking) out += fmt.Sprintf(" relevancyStrictness=%v\n", o.RelevancyStrictness) @@ -3844,7 +3867,6 @@ func (o FallbackParams) String() string { out += fmt.Sprintf(" replaceSynonymsInHighlight=%v\n", o.ReplaceSynonymsInHighlight) out += fmt.Sprintf(" minProximity=%v\n", o.MinProximity) out += fmt.Sprintf(" responseFields=%v\n", o.ResponseFields) - out += fmt.Sprintf(" maxFacetHits=%v\n", o.MaxFacetHits) out += fmt.Sprintf(" maxValuesPerFacet=%v\n", o.MaxValuesPerFacet) out += fmt.Sprintf(" sortFacetValuesBy=%v\n", o.SortFacetValuesBy) out += fmt.Sprintf(" attributeCriteriaComputedByMinProximity=%v\n", o.AttributeCriteriaComputedByMinProximity) diff --git a/clients/algoliasearch-client-go/algolia/recommend/model_inside_bounding_box.go b/clients/algoliasearch-client-go/algolia/recommend/model_inside_bounding_box.go new file mode 100644 index 0000000000..7b30728315 --- /dev/null +++ b/clients/algoliasearch-client-go/algolia/recommend/model_inside_bounding_box.go @@ -0,0 +1,90 @@ +// 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. +package recommend + +import ( + "encoding/json" + "fmt" +) + +// InsideBoundingBox - struct for InsideBoundingBox. +type InsideBoundingBox struct { + ArrayOfArrayOfFloat64 *[][]float64 + String *string +} + +// stringAsInsideBoundingBox is a convenience function that returns string wrapped in InsideBoundingBox. +func StringAsInsideBoundingBox(v string) *InsideBoundingBox { + return &InsideBoundingBox{ + String: &v, + } +} + +// [][]float64AsInsideBoundingBox is a convenience function that returns [][]float64 wrapped in InsideBoundingBox. +func ArrayOfArrayOfFloat64AsInsideBoundingBox(v [][]float64) *InsideBoundingBox { + return &InsideBoundingBox{ + ArrayOfArrayOfFloat64: &v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct. +func (dst *InsideBoundingBox) UnmarshalJSON(data []byte) error { + var err error + // this object is nullable so check if the payload is null or empty string + if string(data) == "" || string(data) == "{}" { + return nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil && validateStruct(dst.String) == nil { + return nil // found the correct type + } else { + dst.String = nil + } + // try to unmarshal data into ArrayOfArrayOfFloat64 + err = newStrictDecoder(data).Decode(&dst.ArrayOfArrayOfFloat64) + if err == nil && validateStruct(dst.ArrayOfArrayOfFloat64) == nil { + return nil // found the correct type + } else { + dst.ArrayOfArrayOfFloat64 = nil + } + + return fmt.Errorf("Data failed to match schemas in oneOf(InsideBoundingBox)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON. +func (src InsideBoundingBox) MarshalJSON() ([]byte, error) { + if src.ArrayOfArrayOfFloat64 != nil { + serialized, err := json.Marshal(&src.ArrayOfArrayOfFloat64) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal one of ArrayOfArrayOfFloat64 of InsideBoundingBox: %w", err) + } + + return serialized, nil + } + + if src.String != nil { + serialized, err := json.Marshal(&src.String) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal one of String of InsideBoundingBox: %w", err) + } + + return serialized, nil + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance. +func (obj InsideBoundingBox) GetActualInstance() any { + if obj.ArrayOfArrayOfFloat64 != nil { + return *obj.ArrayOfArrayOfFloat64 + } + + if obj.String != nil { + return *obj.String + } + + // all schemas are nil + return nil +} diff --git a/clients/algoliasearch-client-go/algolia/recommend/model_optional_words.go b/clients/algoliasearch-client-go/algolia/recommend/model_optional_words.go new file mode 100644 index 0000000000..c2e6bd03bd --- /dev/null +++ b/clients/algoliasearch-client-go/algolia/recommend/model_optional_words.go @@ -0,0 +1,90 @@ +// 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. +package recommend + +import ( + "encoding/json" + "fmt" +) + +// OptionalWords - struct for OptionalWords. +type OptionalWords struct { + ArrayOfString *[]string + String *string +} + +// stringAsOptionalWords is a convenience function that returns string wrapped in OptionalWords. +func StringAsOptionalWords(v string) *OptionalWords { + return &OptionalWords{ + String: &v, + } +} + +// []stringAsOptionalWords is a convenience function that returns []string wrapped in OptionalWords. +func ArrayOfStringAsOptionalWords(v []string) *OptionalWords { + return &OptionalWords{ + ArrayOfString: &v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct. +func (dst *OptionalWords) UnmarshalJSON(data []byte) error { + var err error + // this object is nullable so check if the payload is null or empty string + if string(data) == "" || string(data) == "{}" { + return nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil && validateStruct(dst.String) == nil { + return nil // found the correct type + } else { + dst.String = nil + } + // try to unmarshal data into ArrayOfString + err = newStrictDecoder(data).Decode(&dst.ArrayOfString) + if err == nil && validateStruct(dst.ArrayOfString) == nil { + return nil // found the correct type + } else { + dst.ArrayOfString = nil + } + + return fmt.Errorf("Data failed to match schemas in oneOf(OptionalWords)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON. +func (src OptionalWords) MarshalJSON() ([]byte, error) { + if src.ArrayOfString != nil { + serialized, err := json.Marshal(&src.ArrayOfString) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal one of ArrayOfString of OptionalWords: %w", err) + } + + return serialized, nil + } + + if src.String != nil { + serialized, err := json.Marshal(&src.String) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal one of String of OptionalWords: %w", err) + } + + return serialized, nil + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance. +func (obj OptionalWords) GetActualInstance() any { + if obj.ArrayOfString != nil { + return *obj.ArrayOfString + } + + if obj.String != nil { + return *obj.String + } + + // all schemas are nil + return nil +} diff --git a/clients/algoliasearch-client-go/algolia/recommend/model_recommend_search_params.go b/clients/algoliasearch-client-go/algolia/recommend/model_recommend_search_params.go index 66039afdfc..7d5a125cf6 100644 --- a/clients/algoliasearch-client-go/algolia/recommend/model_recommend_search_params.go +++ b/clients/algoliasearch-client-go/algolia/recommend/model_recommend_search_params.go @@ -4,6 +4,8 @@ package recommend import ( "encoding/json" "fmt" + + "github.com/algolia/algoliasearch-client-go/v4/algolia/utils" ) // RecommendSearchParams Search parameters for filtering the recommendations. @@ -31,9 +33,8 @@ type RecommendSearchParams struct { AroundRadius *AroundRadius `json:"aroundRadius,omitempty"` AroundPrecision *AroundPrecision `json:"aroundPrecision,omitempty"` // Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - MinimumAroundRadius *int32 `json:"minimumAroundRadius,omitempty"` - // 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). - InsideBoundingBox [][]float64 `json:"insideBoundingBox,omitempty"` + MinimumAroundRadius *int32 `json:"minimumAroundRadius,omitempty"` + InsideBoundingBox utils.Nullable[InsideBoundingBox] `json:"insideBoundingBox,omitempty"` // 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`. InsidePolygon [][]float64 `json:"insidePolygon,omitempty"` // ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. @@ -94,6 +95,8 @@ type RecommendSearchParams struct { CustomNormalization *map[string]map[string]string `json:"customNormalization,omitempty"` // Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. AttributeForDistinct *string `json:"attributeForDistinct,omitempty"` + // 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). + MaxFacetHits *int32 `json:"maxFacetHits,omitempty"` // 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. AttributesToRetrieve []string `json:"attributesToRetrieve,omitempty"` // Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/). @@ -134,9 +137,8 @@ type RecommendSearchParams struct { QueryType *QueryType `json:"queryType,omitempty"` RemoveWordsIfNoResults *RemoveWordsIfNoResults `json:"removeWordsIfNoResults,omitempty"` // Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` - // 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). - OptionalWords []string `json:"optionalWords,omitempty"` + AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` + OptionalWords utils.Nullable[OptionalWords] `json:"optionalWords,omitempty"` // 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. DisableExactOnAttributes []string `json:"disableExactOnAttributes,omitempty"` ExactOnSingleWordQuery *ExactOnSingleWordQuery `json:"exactOnSingleWordQuery,omitempty"` @@ -151,8 +153,6 @@ type RecommendSearchParams struct { MinProximity *int32 `json:"minProximity,omitempty"` // Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. ResponseFields []string `json:"responseFields,omitempty"` - // 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). - MaxFacetHits *int32 `json:"maxFacetHits,omitempty"` // Maximum number of facet values to return for each facet. MaxValuesPerFacet *int32 `json:"maxValuesPerFacet,omitempty"` // Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). @@ -257,7 +257,7 @@ func WithRecommendSearchParamsMinimumAroundRadius(val int32) RecommendSearchPara } } -func WithRecommendSearchParamsInsideBoundingBox(val [][]float64) RecommendSearchParamsOption { +func WithRecommendSearchParamsInsideBoundingBox(val utils.Nullable[InsideBoundingBox]) RecommendSearchParamsOption { return func(f *RecommendSearchParams) { f.InsideBoundingBox = val } @@ -443,6 +443,12 @@ func WithRecommendSearchParamsAttributeForDistinct(val string) RecommendSearchPa } } +func WithRecommendSearchParamsMaxFacetHits(val int32) RecommendSearchParamsOption { + return func(f *RecommendSearchParams) { + f.MaxFacetHits = &val + } +} + func WithRecommendSearchParamsAttributesToRetrieve(val []string) RecommendSearchParamsOption { return func(f *RecommendSearchParams) { f.AttributesToRetrieve = val @@ -581,7 +587,7 @@ func WithRecommendSearchParamsAdvancedSyntax(val bool) RecommendSearchParamsOpti } } -func WithRecommendSearchParamsOptionalWords(val []string) RecommendSearchParamsOption { +func WithRecommendSearchParamsOptionalWords(val utils.Nullable[OptionalWords]) RecommendSearchParamsOption { return func(f *RecommendSearchParams) { f.OptionalWords = val } @@ -635,12 +641,6 @@ func WithRecommendSearchParamsResponseFields(val []string) RecommendSearchParams } } -func WithRecommendSearchParamsMaxFacetHits(val int32) RecommendSearchParamsOption { - return func(f *RecommendSearchParams) { - f.MaxFacetHits = &val - } -} - func WithRecommendSearchParamsMaxValuesPerFacet(val int32) RecommendSearchParamsOption { return func(f *RecommendSearchParams) { f.MaxValuesPerFacet = &val @@ -1189,39 +1189,50 @@ func (o *RecommendSearchParams) SetMinimumAroundRadius(v int32) *RecommendSearch return o } -// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise. -func (o *RecommendSearchParams) GetInsideBoundingBox() [][]float64 { - if o == nil || o.InsideBoundingBox == nil { - var ret [][]float64 +// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RecommendSearchParams) GetInsideBoundingBox() InsideBoundingBox { + if o == nil || o.InsideBoundingBox.Get() == nil { + var ret InsideBoundingBox return ret } - return o.InsideBoundingBox + return *o.InsideBoundingBox.Get() } // GetInsideBoundingBoxOk returns a tuple with the InsideBoundingBox field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RecommendSearchParams) GetInsideBoundingBoxOk() ([][]float64, bool) { - if o == nil || o.InsideBoundingBox == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *RecommendSearchParams) GetInsideBoundingBoxOk() (*InsideBoundingBox, bool) { + if o == nil { return nil, false } - return o.InsideBoundingBox, true + return o.InsideBoundingBox.Get(), o.InsideBoundingBox.IsSet() } // HasInsideBoundingBox returns a boolean if a field has been set. func (o *RecommendSearchParams) HasInsideBoundingBox() bool { - if o != nil && o.InsideBoundingBox != nil { + if o != nil && o.InsideBoundingBox.IsSet() { return true } return false } -// SetInsideBoundingBox gets a reference to the given [][]float64 and assigns it to the InsideBoundingBox field. -func (o *RecommendSearchParams) SetInsideBoundingBox(v [][]float64) *RecommendSearchParams { - o.InsideBoundingBox = v +// SetInsideBoundingBox gets a reference to the given utils.Nullable[InsideBoundingBox] and assigns it to the InsideBoundingBox field. +func (o *RecommendSearchParams) SetInsideBoundingBox(v *InsideBoundingBox) *RecommendSearchParams { + o.InsideBoundingBox.Set(v) return o } +// SetInsideBoundingBoxNil sets the value for InsideBoundingBox to be an explicit nil. +func (o *RecommendSearchParams) SetInsideBoundingBoxNil() { + o.InsideBoundingBox.Set(nil) +} + +// UnsetInsideBoundingBox ensures that no value is present for InsideBoundingBox, not even an explicit nil. +func (o *RecommendSearchParams) UnsetInsideBoundingBox() { + o.InsideBoundingBox.Unset() +} + // GetInsidePolygon returns the InsidePolygon field value if set, zero value otherwise. func (o *RecommendSearchParams) GetInsidePolygon() [][]float64 { if o == nil || o.InsidePolygon == nil { @@ -2212,6 +2223,39 @@ func (o *RecommendSearchParams) SetAttributeForDistinct(v string) *RecommendSear return o } +// GetMaxFacetHits returns the MaxFacetHits field value if set, zero value otherwise. +func (o *RecommendSearchParams) GetMaxFacetHits() int32 { + if o == nil || o.MaxFacetHits == nil { + var ret int32 + return ret + } + return *o.MaxFacetHits +} + +// GetMaxFacetHitsOk returns a tuple with the MaxFacetHits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecommendSearchParams) GetMaxFacetHitsOk() (*int32, bool) { + if o == nil || o.MaxFacetHits == nil { + return nil, false + } + return o.MaxFacetHits, true +} + +// HasMaxFacetHits returns a boolean if a field has been set. +func (o *RecommendSearchParams) HasMaxFacetHits() bool { + if o != nil && o.MaxFacetHits != nil { + return true + } + + return false +} + +// SetMaxFacetHits gets a reference to the given int32 and assigns it to the MaxFacetHits field. +func (o *RecommendSearchParams) SetMaxFacetHits(v int32) *RecommendSearchParams { + o.MaxFacetHits = &v + return o +} + // GetAttributesToRetrieve returns the AttributesToRetrieve field value if set, zero value otherwise. func (o *RecommendSearchParams) GetAttributesToRetrieve() []string { if o == nil || o.AttributesToRetrieve == nil { @@ -2971,39 +3015,50 @@ func (o *RecommendSearchParams) SetAdvancedSyntax(v bool) *RecommendSearchParams return o } -// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise. -func (o *RecommendSearchParams) GetOptionalWords() []string { - if o == nil || o.OptionalWords == nil { - var ret []string +// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RecommendSearchParams) GetOptionalWords() OptionalWords { + if o == nil || o.OptionalWords.Get() == nil { + var ret OptionalWords return ret } - return o.OptionalWords + return *o.OptionalWords.Get() } // GetOptionalWordsOk returns a tuple with the OptionalWords field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RecommendSearchParams) GetOptionalWordsOk() ([]string, bool) { - if o == nil || o.OptionalWords == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *RecommendSearchParams) GetOptionalWordsOk() (*OptionalWords, bool) { + if o == nil { return nil, false } - return o.OptionalWords, true + return o.OptionalWords.Get(), o.OptionalWords.IsSet() } // HasOptionalWords returns a boolean if a field has been set. func (o *RecommendSearchParams) HasOptionalWords() bool { - if o != nil && o.OptionalWords != nil { + if o != nil && o.OptionalWords.IsSet() { return true } return false } -// SetOptionalWords gets a reference to the given []string and assigns it to the OptionalWords field. -func (o *RecommendSearchParams) SetOptionalWords(v []string) *RecommendSearchParams { - o.OptionalWords = v +// SetOptionalWords gets a reference to the given utils.Nullable[OptionalWords] and assigns it to the OptionalWords field. +func (o *RecommendSearchParams) SetOptionalWords(v *OptionalWords) *RecommendSearchParams { + o.OptionalWords.Set(v) return o } +// SetOptionalWordsNil sets the value for OptionalWords to be an explicit nil. +func (o *RecommendSearchParams) SetOptionalWordsNil() { + o.OptionalWords.Set(nil) +} + +// UnsetOptionalWords ensures that no value is present for OptionalWords, not even an explicit nil. +func (o *RecommendSearchParams) UnsetOptionalWords() { + o.OptionalWords.Unset() +} + // GetDisableExactOnAttributes returns the DisableExactOnAttributes field value if set, zero value otherwise. func (o *RecommendSearchParams) GetDisableExactOnAttributes() []string { if o == nil || o.DisableExactOnAttributes == nil { @@ -3268,39 +3323,6 @@ func (o *RecommendSearchParams) SetResponseFields(v []string) *RecommendSearchPa return o } -// GetMaxFacetHits returns the MaxFacetHits field value if set, zero value otherwise. -func (o *RecommendSearchParams) GetMaxFacetHits() int32 { - if o == nil || o.MaxFacetHits == nil { - var ret int32 - return ret - } - return *o.MaxFacetHits -} - -// GetMaxFacetHitsOk returns a tuple with the MaxFacetHits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RecommendSearchParams) GetMaxFacetHitsOk() (*int32, bool) { - if o == nil || o.MaxFacetHits == nil { - return nil, false - } - return o.MaxFacetHits, true -} - -// HasMaxFacetHits returns a boolean if a field has been set. -func (o *RecommendSearchParams) HasMaxFacetHits() bool { - if o != nil && o.MaxFacetHits != nil { - return true - } - - return false -} - -// SetMaxFacetHits gets a reference to the given int32 and assigns it to the MaxFacetHits field. -func (o *RecommendSearchParams) SetMaxFacetHits(v int32) *RecommendSearchParams { - o.MaxFacetHits = &v - return o -} - // GetMaxValuesPerFacet returns the MaxValuesPerFacet field value if set, zero value otherwise. func (o *RecommendSearchParams) GetMaxValuesPerFacet() int32 { if o == nil || o.MaxValuesPerFacet == nil { @@ -3546,8 +3568,8 @@ func (o RecommendSearchParams) MarshalJSON() ([]byte, error) { if o.MinimumAroundRadius != nil { toSerialize["minimumAroundRadius"] = o.MinimumAroundRadius } - if o.InsideBoundingBox != nil { - toSerialize["insideBoundingBox"] = o.InsideBoundingBox + if o.InsideBoundingBox.IsSet() { + toSerialize["insideBoundingBox"] = o.InsideBoundingBox.Get() } if o.InsidePolygon != nil { toSerialize["insidePolygon"] = o.InsidePolygon @@ -3639,6 +3661,9 @@ func (o RecommendSearchParams) MarshalJSON() ([]byte, error) { if o.AttributeForDistinct != nil { toSerialize["attributeForDistinct"] = o.AttributeForDistinct } + if o.MaxFacetHits != nil { + toSerialize["maxFacetHits"] = o.MaxFacetHits + } if o.AttributesToRetrieve != nil { toSerialize["attributesToRetrieve"] = o.AttributesToRetrieve } @@ -3708,8 +3733,8 @@ func (o RecommendSearchParams) MarshalJSON() ([]byte, error) { if o.AdvancedSyntax != nil { toSerialize["advancedSyntax"] = o.AdvancedSyntax } - if o.OptionalWords != nil { - toSerialize["optionalWords"] = o.OptionalWords + if o.OptionalWords.IsSet() { + toSerialize["optionalWords"] = o.OptionalWords.Get() } if o.DisableExactOnAttributes != nil { toSerialize["disableExactOnAttributes"] = o.DisableExactOnAttributes @@ -3735,9 +3760,6 @@ func (o RecommendSearchParams) MarshalJSON() ([]byte, error) { if o.ResponseFields != nil { toSerialize["responseFields"] = o.ResponseFields } - if o.MaxFacetHits != nil { - toSerialize["maxFacetHits"] = o.MaxFacetHits - } if o.MaxValuesPerFacet != nil { toSerialize["maxValuesPerFacet"] = o.MaxValuesPerFacet } @@ -3812,6 +3834,7 @@ func (o RecommendSearchParams) String() string { out += fmt.Sprintf(" userData=%v\n", o.UserData) out += fmt.Sprintf(" customNormalization=%v\n", o.CustomNormalization) out += fmt.Sprintf(" attributeForDistinct=%v\n", o.AttributeForDistinct) + out += fmt.Sprintf(" maxFacetHits=%v\n", o.MaxFacetHits) out += fmt.Sprintf(" attributesToRetrieve=%v\n", o.AttributesToRetrieve) out += fmt.Sprintf(" ranking=%v\n", o.Ranking) out += fmt.Sprintf(" relevancyStrictness=%v\n", o.RelevancyStrictness) @@ -3844,7 +3867,6 @@ func (o RecommendSearchParams) String() string { out += fmt.Sprintf(" replaceSynonymsInHighlight=%v\n", o.ReplaceSynonymsInHighlight) out += fmt.Sprintf(" minProximity=%v\n", o.MinProximity) out += fmt.Sprintf(" responseFields=%v\n", o.ResponseFields) - out += fmt.Sprintf(" maxFacetHits=%v\n", o.MaxFacetHits) out += fmt.Sprintf(" maxValuesPerFacet=%v\n", o.MaxValuesPerFacet) out += fmt.Sprintf(" sortFacetValuesBy=%v\n", o.SortFacetValuesBy) out += fmt.Sprintf(" attributeCriteriaComputedByMinProximity=%v\n", o.AttributeCriteriaComputedByMinProximity) diff --git a/clients/algoliasearch-client-go/algolia/search/model_browse_params_object.go b/clients/algoliasearch-client-go/algolia/search/model_browse_params_object.go index 659685bc28..de963f3b69 100644 --- a/clients/algoliasearch-client-go/algolia/search/model_browse_params_object.go +++ b/clients/algoliasearch-client-go/algolia/search/model_browse_params_object.go @@ -4,6 +4,8 @@ package search import ( "encoding/json" "fmt" + + "github.com/algolia/algoliasearch-client-go/v4/algolia/utils" ) // BrowseParamsObject struct for BrowseParamsObject. @@ -39,9 +41,8 @@ type BrowseParamsObject struct { AroundRadius *AroundRadius `json:"aroundRadius,omitempty"` AroundPrecision *AroundPrecision `json:"aroundPrecision,omitempty"` // Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - MinimumAroundRadius *int32 `json:"minimumAroundRadius,omitempty"` - // 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). - InsideBoundingBox [][]float64 `json:"insideBoundingBox,omitempty"` + MinimumAroundRadius *int32 `json:"minimumAroundRadius,omitempty"` + InsideBoundingBox utils.Nullable[InsideBoundingBox] `json:"insideBoundingBox,omitempty"` // 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`. InsidePolygon [][]float64 `json:"insidePolygon,omitempty"` // ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. @@ -114,9 +115,8 @@ type BrowseParamsObject struct { Mode *Mode `json:"mode,omitempty"` SemanticSearch *SemanticSearch `json:"semanticSearch,omitempty"` // Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` - // 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). - OptionalWords []string `json:"optionalWords,omitempty"` + AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` + OptionalWords utils.Nullable[OptionalWords] `json:"optionalWords,omitempty"` // 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. DisableExactOnAttributes []string `json:"disableExactOnAttributes,omitempty"` ExactOnSingleWordQuery *ExactOnSingleWordQuery `json:"exactOnSingleWordQuery,omitempty"` @@ -131,8 +131,6 @@ type BrowseParamsObject struct { MinProximity *int32 `json:"minProximity,omitempty"` // Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. ResponseFields []string `json:"responseFields,omitempty"` - // 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). - MaxFacetHits *int32 `json:"maxFacetHits,omitempty"` // Maximum number of facet values to return for each facet. MaxValuesPerFacet *int32 `json:"maxValuesPerFacet,omitempty"` // Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). @@ -263,7 +261,7 @@ func WithBrowseParamsObjectMinimumAroundRadius(val int32) BrowseParamsObjectOpti } } -func WithBrowseParamsObjectInsideBoundingBox(val [][]float64) BrowseParamsObjectOption { +func WithBrowseParamsObjectInsideBoundingBox(val utils.Nullable[InsideBoundingBox]) BrowseParamsObjectOption { return func(f *BrowseParamsObject) { f.InsideBoundingBox = val } @@ -509,7 +507,7 @@ func WithBrowseParamsObjectAdvancedSyntax(val bool) BrowseParamsObjectOption { } } -func WithBrowseParamsObjectOptionalWords(val []string) BrowseParamsObjectOption { +func WithBrowseParamsObjectOptionalWords(val utils.Nullable[OptionalWords]) BrowseParamsObjectOption { return func(f *BrowseParamsObject) { f.OptionalWords = val } @@ -563,12 +561,6 @@ func WithBrowseParamsObjectResponseFields(val []string) BrowseParamsObjectOption } } -func WithBrowseParamsObjectMaxFacetHits(val int32) BrowseParamsObjectOption { - return func(f *BrowseParamsObject) { - f.MaxFacetHits = &val - } -} - func WithBrowseParamsObjectMaxValuesPerFacet(val int32) BrowseParamsObjectOption { return func(f *BrowseParamsObject) { f.MaxValuesPerFacet = &val @@ -1255,39 +1247,50 @@ func (o *BrowseParamsObject) SetMinimumAroundRadius(v int32) *BrowseParamsObject return o } -// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise. -func (o *BrowseParamsObject) GetInsideBoundingBox() [][]float64 { - if o == nil || o.InsideBoundingBox == nil { - var ret [][]float64 +// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BrowseParamsObject) GetInsideBoundingBox() InsideBoundingBox { + if o == nil || o.InsideBoundingBox.Get() == nil { + var ret InsideBoundingBox return ret } - return o.InsideBoundingBox + return *o.InsideBoundingBox.Get() } // GetInsideBoundingBoxOk returns a tuple with the InsideBoundingBox field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BrowseParamsObject) GetInsideBoundingBoxOk() ([][]float64, bool) { - if o == nil || o.InsideBoundingBox == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *BrowseParamsObject) GetInsideBoundingBoxOk() (*InsideBoundingBox, bool) { + if o == nil { return nil, false } - return o.InsideBoundingBox, true + return o.InsideBoundingBox.Get(), o.InsideBoundingBox.IsSet() } // HasInsideBoundingBox returns a boolean if a field has been set. func (o *BrowseParamsObject) HasInsideBoundingBox() bool { - if o != nil && o.InsideBoundingBox != nil { + if o != nil && o.InsideBoundingBox.IsSet() { return true } return false } -// SetInsideBoundingBox gets a reference to the given [][]float64 and assigns it to the InsideBoundingBox field. -func (o *BrowseParamsObject) SetInsideBoundingBox(v [][]float64) *BrowseParamsObject { - o.InsideBoundingBox = v +// SetInsideBoundingBox gets a reference to the given utils.Nullable[InsideBoundingBox] and assigns it to the InsideBoundingBox field. +func (o *BrowseParamsObject) SetInsideBoundingBox(v *InsideBoundingBox) *BrowseParamsObject { + o.InsideBoundingBox.Set(v) return o } +// SetInsideBoundingBoxNil sets the value for InsideBoundingBox to be an explicit nil. +func (o *BrowseParamsObject) SetInsideBoundingBoxNil() { + o.InsideBoundingBox.Set(nil) +} + +// UnsetInsideBoundingBox ensures that no value is present for InsideBoundingBox, not even an explicit nil. +func (o *BrowseParamsObject) UnsetInsideBoundingBox() { + o.InsideBoundingBox.Unset() +} + // GetInsidePolygon returns the InsidePolygon field value if set, zero value otherwise. func (o *BrowseParamsObject) GetInsidePolygon() [][]float64 { if o == nil || o.InsidePolygon == nil { @@ -2608,39 +2611,50 @@ func (o *BrowseParamsObject) SetAdvancedSyntax(v bool) *BrowseParamsObject { return o } -// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise. -func (o *BrowseParamsObject) GetOptionalWords() []string { - if o == nil || o.OptionalWords == nil { - var ret []string +// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BrowseParamsObject) GetOptionalWords() OptionalWords { + if o == nil || o.OptionalWords.Get() == nil { + var ret OptionalWords return ret } - return o.OptionalWords + return *o.OptionalWords.Get() } // GetOptionalWordsOk returns a tuple with the OptionalWords field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BrowseParamsObject) GetOptionalWordsOk() ([]string, bool) { - if o == nil || o.OptionalWords == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *BrowseParamsObject) GetOptionalWordsOk() (*OptionalWords, bool) { + if o == nil { return nil, false } - return o.OptionalWords, true + return o.OptionalWords.Get(), o.OptionalWords.IsSet() } // HasOptionalWords returns a boolean if a field has been set. func (o *BrowseParamsObject) HasOptionalWords() bool { - if o != nil && o.OptionalWords != nil { + if o != nil && o.OptionalWords.IsSet() { return true } return false } -// SetOptionalWords gets a reference to the given []string and assigns it to the OptionalWords field. -func (o *BrowseParamsObject) SetOptionalWords(v []string) *BrowseParamsObject { - o.OptionalWords = v +// SetOptionalWords gets a reference to the given utils.Nullable[OptionalWords] and assigns it to the OptionalWords field. +func (o *BrowseParamsObject) SetOptionalWords(v *OptionalWords) *BrowseParamsObject { + o.OptionalWords.Set(v) return o } +// SetOptionalWordsNil sets the value for OptionalWords to be an explicit nil. +func (o *BrowseParamsObject) SetOptionalWordsNil() { + o.OptionalWords.Set(nil) +} + +// UnsetOptionalWords ensures that no value is present for OptionalWords, not even an explicit nil. +func (o *BrowseParamsObject) UnsetOptionalWords() { + o.OptionalWords.Unset() +} + // GetDisableExactOnAttributes returns the DisableExactOnAttributes field value if set, zero value otherwise. func (o *BrowseParamsObject) GetDisableExactOnAttributes() []string { if o == nil || o.DisableExactOnAttributes == nil { @@ -2905,39 +2919,6 @@ func (o *BrowseParamsObject) SetResponseFields(v []string) *BrowseParamsObject { return o } -// GetMaxFacetHits returns the MaxFacetHits field value if set, zero value otherwise. -func (o *BrowseParamsObject) GetMaxFacetHits() int32 { - if o == nil || o.MaxFacetHits == nil { - var ret int32 - return ret - } - return *o.MaxFacetHits -} - -// GetMaxFacetHitsOk returns a tuple with the MaxFacetHits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BrowseParamsObject) GetMaxFacetHitsOk() (*int32, bool) { - if o == nil || o.MaxFacetHits == nil { - return nil, false - } - return o.MaxFacetHits, true -} - -// HasMaxFacetHits returns a boolean if a field has been set. -func (o *BrowseParamsObject) HasMaxFacetHits() bool { - if o != nil && o.MaxFacetHits != nil { - return true - } - - return false -} - -// SetMaxFacetHits gets a reference to the given int32 and assigns it to the MaxFacetHits field. -func (o *BrowseParamsObject) SetMaxFacetHits(v int32) *BrowseParamsObject { - o.MaxFacetHits = &v - return o -} - // GetMaxValuesPerFacet returns the MaxValuesPerFacet field value if set, zero value otherwise. func (o *BrowseParamsObject) GetMaxValuesPerFacet() int32 { if o == nil || o.MaxValuesPerFacet == nil { @@ -3228,8 +3209,8 @@ func (o BrowseParamsObject) MarshalJSON() ([]byte, error) { if o.MinimumAroundRadius != nil { toSerialize["minimumAroundRadius"] = o.MinimumAroundRadius } - if o.InsideBoundingBox != nil { - toSerialize["insideBoundingBox"] = o.InsideBoundingBox + if o.InsideBoundingBox.IsSet() { + toSerialize["insideBoundingBox"] = o.InsideBoundingBox.Get() } if o.InsidePolygon != nil { toSerialize["insidePolygon"] = o.InsidePolygon @@ -3351,8 +3332,8 @@ func (o BrowseParamsObject) MarshalJSON() ([]byte, error) { if o.AdvancedSyntax != nil { toSerialize["advancedSyntax"] = o.AdvancedSyntax } - if o.OptionalWords != nil { - toSerialize["optionalWords"] = o.OptionalWords + if o.OptionalWords.IsSet() { + toSerialize["optionalWords"] = o.OptionalWords.Get() } if o.DisableExactOnAttributes != nil { toSerialize["disableExactOnAttributes"] = o.DisableExactOnAttributes @@ -3378,9 +3359,6 @@ func (o BrowseParamsObject) MarshalJSON() ([]byte, error) { if o.ResponseFields != nil { toSerialize["responseFields"] = o.ResponseFields } - if o.MaxFacetHits != nil { - toSerialize["maxFacetHits"] = o.MaxFacetHits - } if o.MaxValuesPerFacet != nil { toSerialize["maxValuesPerFacet"] = o.MaxValuesPerFacet } @@ -3481,7 +3459,6 @@ func (o BrowseParamsObject) String() string { out += fmt.Sprintf(" replaceSynonymsInHighlight=%v\n", o.ReplaceSynonymsInHighlight) out += fmt.Sprintf(" minProximity=%v\n", o.MinProximity) out += fmt.Sprintf(" responseFields=%v\n", o.ResponseFields) - out += fmt.Sprintf(" maxFacetHits=%v\n", o.MaxFacetHits) out += fmt.Sprintf(" maxValuesPerFacet=%v\n", o.MaxValuesPerFacet) out += fmt.Sprintf(" sortFacetValuesBy=%v\n", o.SortFacetValuesBy) out += fmt.Sprintf(" attributeCriteriaComputedByMinProximity=%v\n", o.AttributeCriteriaComputedByMinProximity) diff --git a/clients/algoliasearch-client-go/algolia/search/model_consequence_params.go b/clients/algoliasearch-client-go/algolia/search/model_consequence_params.go index 46f8386372..8e58ff2cbf 100644 --- a/clients/algoliasearch-client-go/algolia/search/model_consequence_params.go +++ b/clients/algoliasearch-client-go/algolia/search/model_consequence_params.go @@ -4,6 +4,8 @@ package search import ( "encoding/json" "fmt" + + "github.com/algolia/algoliasearch-client-go/v4/algolia/utils" ) // ConsequenceParams struct for ConsequenceParams. @@ -37,9 +39,8 @@ type ConsequenceParams struct { AroundRadius *AroundRadius `json:"aroundRadius,omitempty"` AroundPrecision *AroundPrecision `json:"aroundPrecision,omitempty"` // Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - MinimumAroundRadius *int32 `json:"minimumAroundRadius,omitempty"` - // 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). - InsideBoundingBox [][]float64 `json:"insideBoundingBox,omitempty"` + MinimumAroundRadius *int32 `json:"minimumAroundRadius,omitempty"` + InsideBoundingBox utils.Nullable[InsideBoundingBox] `json:"insideBoundingBox,omitempty"` // 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`. InsidePolygon [][]float64 `json:"insidePolygon,omitempty"` // ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. @@ -112,9 +113,8 @@ type ConsequenceParams struct { Mode *Mode `json:"mode,omitempty"` SemanticSearch *SemanticSearch `json:"semanticSearch,omitempty"` // Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` - // 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). - OptionalWords []string `json:"optionalWords,omitempty"` + AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` + OptionalWords utils.Nullable[OptionalWords] `json:"optionalWords,omitempty"` // 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. DisableExactOnAttributes []string `json:"disableExactOnAttributes,omitempty"` ExactOnSingleWordQuery *ExactOnSingleWordQuery `json:"exactOnSingleWordQuery,omitempty"` @@ -129,8 +129,6 @@ type ConsequenceParams struct { MinProximity *int32 `json:"minProximity,omitempty"` // Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. ResponseFields []string `json:"responseFields,omitempty"` - // 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). - MaxFacetHits *int32 `json:"maxFacetHits,omitempty"` // Maximum number of facet values to return for each facet. MaxValuesPerFacet *int32 `json:"maxValuesPerFacet,omitempty"` // Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). @@ -256,7 +254,7 @@ func WithConsequenceParamsMinimumAroundRadius(val int32) ConsequenceParamsOption } } -func WithConsequenceParamsInsideBoundingBox(val [][]float64) ConsequenceParamsOption { +func WithConsequenceParamsInsideBoundingBox(val utils.Nullable[InsideBoundingBox]) ConsequenceParamsOption { return func(f *ConsequenceParams) { f.InsideBoundingBox = val } @@ -502,7 +500,7 @@ func WithConsequenceParamsAdvancedSyntax(val bool) ConsequenceParamsOption { } } -func WithConsequenceParamsOptionalWords(val []string) ConsequenceParamsOption { +func WithConsequenceParamsOptionalWords(val utils.Nullable[OptionalWords]) ConsequenceParamsOption { return func(f *ConsequenceParams) { f.OptionalWords = val } @@ -556,12 +554,6 @@ func WithConsequenceParamsResponseFields(val []string) ConsequenceParamsOption { } } -func WithConsequenceParamsMaxFacetHits(val int32) ConsequenceParamsOption { - return func(f *ConsequenceParams) { - f.MaxFacetHits = &val - } -} - func WithConsequenceParamsMaxValuesPerFacet(val int32) ConsequenceParamsOption { return func(f *ConsequenceParams) { f.MaxValuesPerFacet = &val @@ -1227,39 +1219,50 @@ func (o *ConsequenceParams) SetMinimumAroundRadius(v int32) *ConsequenceParams { return o } -// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise. -func (o *ConsequenceParams) GetInsideBoundingBox() [][]float64 { - if o == nil || o.InsideBoundingBox == nil { - var ret [][]float64 +// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsequenceParams) GetInsideBoundingBox() InsideBoundingBox { + if o == nil || o.InsideBoundingBox.Get() == nil { + var ret InsideBoundingBox return ret } - return o.InsideBoundingBox + return *o.InsideBoundingBox.Get() } // GetInsideBoundingBoxOk returns a tuple with the InsideBoundingBox field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConsequenceParams) GetInsideBoundingBoxOk() ([][]float64, bool) { - if o == nil || o.InsideBoundingBox == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ConsequenceParams) GetInsideBoundingBoxOk() (*InsideBoundingBox, bool) { + if o == nil { return nil, false } - return o.InsideBoundingBox, true + return o.InsideBoundingBox.Get(), o.InsideBoundingBox.IsSet() } // HasInsideBoundingBox returns a boolean if a field has been set. func (o *ConsequenceParams) HasInsideBoundingBox() bool { - if o != nil && o.InsideBoundingBox != nil { + if o != nil && o.InsideBoundingBox.IsSet() { return true } return false } -// SetInsideBoundingBox gets a reference to the given [][]float64 and assigns it to the InsideBoundingBox field. -func (o *ConsequenceParams) SetInsideBoundingBox(v [][]float64) *ConsequenceParams { - o.InsideBoundingBox = v +// SetInsideBoundingBox gets a reference to the given utils.Nullable[InsideBoundingBox] and assigns it to the InsideBoundingBox field. +func (o *ConsequenceParams) SetInsideBoundingBox(v *InsideBoundingBox) *ConsequenceParams { + o.InsideBoundingBox.Set(v) return o } +// SetInsideBoundingBoxNil sets the value for InsideBoundingBox to be an explicit nil. +func (o *ConsequenceParams) SetInsideBoundingBoxNil() { + o.InsideBoundingBox.Set(nil) +} + +// UnsetInsideBoundingBox ensures that no value is present for InsideBoundingBox, not even an explicit nil. +func (o *ConsequenceParams) UnsetInsideBoundingBox() { + o.InsideBoundingBox.Unset() +} + // GetInsidePolygon returns the InsidePolygon field value if set, zero value otherwise. func (o *ConsequenceParams) GetInsidePolygon() [][]float64 { if o == nil || o.InsidePolygon == nil { @@ -2580,39 +2583,50 @@ func (o *ConsequenceParams) SetAdvancedSyntax(v bool) *ConsequenceParams { return o } -// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise. -func (o *ConsequenceParams) GetOptionalWords() []string { - if o == nil || o.OptionalWords == nil { - var ret []string +// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsequenceParams) GetOptionalWords() OptionalWords { + if o == nil || o.OptionalWords.Get() == nil { + var ret OptionalWords return ret } - return o.OptionalWords + return *o.OptionalWords.Get() } // GetOptionalWordsOk returns a tuple with the OptionalWords field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConsequenceParams) GetOptionalWordsOk() ([]string, bool) { - if o == nil || o.OptionalWords == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ConsequenceParams) GetOptionalWordsOk() (*OptionalWords, bool) { + if o == nil { return nil, false } - return o.OptionalWords, true + return o.OptionalWords.Get(), o.OptionalWords.IsSet() } // HasOptionalWords returns a boolean if a field has been set. func (o *ConsequenceParams) HasOptionalWords() bool { - if o != nil && o.OptionalWords != nil { + if o != nil && o.OptionalWords.IsSet() { return true } return false } -// SetOptionalWords gets a reference to the given []string and assigns it to the OptionalWords field. -func (o *ConsequenceParams) SetOptionalWords(v []string) *ConsequenceParams { - o.OptionalWords = v +// SetOptionalWords gets a reference to the given utils.Nullable[OptionalWords] and assigns it to the OptionalWords field. +func (o *ConsequenceParams) SetOptionalWords(v *OptionalWords) *ConsequenceParams { + o.OptionalWords.Set(v) return o } +// SetOptionalWordsNil sets the value for OptionalWords to be an explicit nil. +func (o *ConsequenceParams) SetOptionalWordsNil() { + o.OptionalWords.Set(nil) +} + +// UnsetOptionalWords ensures that no value is present for OptionalWords, not even an explicit nil. +func (o *ConsequenceParams) UnsetOptionalWords() { + o.OptionalWords.Unset() +} + // GetDisableExactOnAttributes returns the DisableExactOnAttributes field value if set, zero value otherwise. func (o *ConsequenceParams) GetDisableExactOnAttributes() []string { if o == nil || o.DisableExactOnAttributes == nil { @@ -2877,39 +2891,6 @@ func (o *ConsequenceParams) SetResponseFields(v []string) *ConsequenceParams { return o } -// GetMaxFacetHits returns the MaxFacetHits field value if set, zero value otherwise. -func (o *ConsequenceParams) GetMaxFacetHits() int32 { - if o == nil || o.MaxFacetHits == nil { - var ret int32 - return ret - } - return *o.MaxFacetHits -} - -// GetMaxFacetHitsOk returns a tuple with the MaxFacetHits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsequenceParams) GetMaxFacetHitsOk() (*int32, bool) { - if o == nil || o.MaxFacetHits == nil { - return nil, false - } - return o.MaxFacetHits, true -} - -// HasMaxFacetHits returns a boolean if a field has been set. -func (o *ConsequenceParams) HasMaxFacetHits() bool { - if o != nil && o.MaxFacetHits != nil { - return true - } - - return false -} - -// SetMaxFacetHits gets a reference to the given int32 and assigns it to the MaxFacetHits field. -func (o *ConsequenceParams) SetMaxFacetHits(v int32) *ConsequenceParams { - o.MaxFacetHits = &v - return o -} - // GetMaxValuesPerFacet returns the MaxValuesPerFacet field value if set, zero value otherwise. func (o *ConsequenceParams) GetMaxValuesPerFacet() int32 { if o == nil || o.MaxValuesPerFacet == nil { @@ -3263,8 +3244,8 @@ func (o ConsequenceParams) MarshalJSON() ([]byte, error) { if o.MinimumAroundRadius != nil { toSerialize["minimumAroundRadius"] = o.MinimumAroundRadius } - if o.InsideBoundingBox != nil { - toSerialize["insideBoundingBox"] = o.InsideBoundingBox + if o.InsideBoundingBox.IsSet() { + toSerialize["insideBoundingBox"] = o.InsideBoundingBox.Get() } if o.InsidePolygon != nil { toSerialize["insidePolygon"] = o.InsidePolygon @@ -3386,8 +3367,8 @@ func (o ConsequenceParams) MarshalJSON() ([]byte, error) { if o.AdvancedSyntax != nil { toSerialize["advancedSyntax"] = o.AdvancedSyntax } - if o.OptionalWords != nil { - toSerialize["optionalWords"] = o.OptionalWords + if o.OptionalWords.IsSet() { + toSerialize["optionalWords"] = o.OptionalWords.Get() } if o.DisableExactOnAttributes != nil { toSerialize["disableExactOnAttributes"] = o.DisableExactOnAttributes @@ -3413,9 +3394,6 @@ func (o ConsequenceParams) MarshalJSON() ([]byte, error) { if o.ResponseFields != nil { toSerialize["responseFields"] = o.ResponseFields } - if o.MaxFacetHits != nil { - toSerialize["maxFacetHits"] = o.MaxFacetHits - } if o.MaxValuesPerFacet != nil { toSerialize["maxValuesPerFacet"] = o.MaxValuesPerFacet } @@ -3521,7 +3499,6 @@ func (o ConsequenceParams) String() string { out += fmt.Sprintf(" replaceSynonymsInHighlight=%v\n", o.ReplaceSynonymsInHighlight) out += fmt.Sprintf(" minProximity=%v\n", o.MinProximity) out += fmt.Sprintf(" responseFields=%v\n", o.ResponseFields) - out += fmt.Sprintf(" maxFacetHits=%v\n", o.MaxFacetHits) out += fmt.Sprintf(" maxValuesPerFacet=%v\n", o.MaxValuesPerFacet) out += fmt.Sprintf(" sortFacetValuesBy=%v\n", o.SortFacetValuesBy) out += fmt.Sprintf(" attributeCriteriaComputedByMinProximity=%v\n", o.AttributeCriteriaComputedByMinProximity) diff --git a/clients/algoliasearch-client-go/algolia/search/model_delete_by_params.go b/clients/algoliasearch-client-go/algolia/search/model_delete_by_params.go index f0b405c5fb..7e48a17921 100644 --- a/clients/algoliasearch-client-go/algolia/search/model_delete_by_params.go +++ b/clients/algoliasearch-client-go/algolia/search/model_delete_by_params.go @@ -4,6 +4,8 @@ package search import ( "encoding/json" "fmt" + + "github.com/algolia/algoliasearch-client-go/v4/algolia/utils" ) // DeleteByParams struct for DeleteByParams. @@ -14,10 +16,9 @@ type DeleteByParams struct { NumericFilters *NumericFilters `json:"numericFilters,omitempty"` TagFilters *TagFilters `json:"tagFilters,omitempty"` // Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within a circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`. - AroundLatLng *string `json:"aroundLatLng,omitempty"` - AroundRadius *AroundRadius `json:"aroundRadius,omitempty"` - // 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). - InsideBoundingBox [][]float64 `json:"insideBoundingBox,omitempty"` + AroundLatLng *string `json:"aroundLatLng,omitempty"` + AroundRadius *AroundRadius `json:"aroundRadius,omitempty"` + InsideBoundingBox utils.Nullable[InsideBoundingBox] `json:"insideBoundingBox,omitempty"` // 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`. InsidePolygon [][]float64 `json:"insidePolygon,omitempty"` } @@ -60,7 +61,7 @@ func WithDeleteByParamsAroundRadius(val AroundRadius) DeleteByParamsOption { } } -func WithDeleteByParamsInsideBoundingBox(val [][]float64) DeleteByParamsOption { +func WithDeleteByParamsInsideBoundingBox(val utils.Nullable[InsideBoundingBox]) DeleteByParamsOption { return func(f *DeleteByParams) { f.InsideBoundingBox = val } @@ -287,39 +288,50 @@ func (o *DeleteByParams) SetAroundRadius(v *AroundRadius) *DeleteByParams { return o } -// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise. -func (o *DeleteByParams) GetInsideBoundingBox() [][]float64 { - if o == nil || o.InsideBoundingBox == nil { - var ret [][]float64 +// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeleteByParams) GetInsideBoundingBox() InsideBoundingBox { + if o == nil || o.InsideBoundingBox.Get() == nil { + var ret InsideBoundingBox return ret } - return o.InsideBoundingBox + return *o.InsideBoundingBox.Get() } // GetInsideBoundingBoxOk returns a tuple with the InsideBoundingBox field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeleteByParams) GetInsideBoundingBoxOk() ([][]float64, bool) { - if o == nil || o.InsideBoundingBox == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *DeleteByParams) GetInsideBoundingBoxOk() (*InsideBoundingBox, bool) { + if o == nil { return nil, false } - return o.InsideBoundingBox, true + return o.InsideBoundingBox.Get(), o.InsideBoundingBox.IsSet() } // HasInsideBoundingBox returns a boolean if a field has been set. func (o *DeleteByParams) HasInsideBoundingBox() bool { - if o != nil && o.InsideBoundingBox != nil { + if o != nil && o.InsideBoundingBox.IsSet() { return true } return false } -// SetInsideBoundingBox gets a reference to the given [][]float64 and assigns it to the InsideBoundingBox field. -func (o *DeleteByParams) SetInsideBoundingBox(v [][]float64) *DeleteByParams { - o.InsideBoundingBox = v +// SetInsideBoundingBox gets a reference to the given utils.Nullable[InsideBoundingBox] and assigns it to the InsideBoundingBox field. +func (o *DeleteByParams) SetInsideBoundingBox(v *InsideBoundingBox) *DeleteByParams { + o.InsideBoundingBox.Set(v) return o } +// SetInsideBoundingBoxNil sets the value for InsideBoundingBox to be an explicit nil. +func (o *DeleteByParams) SetInsideBoundingBoxNil() { + o.InsideBoundingBox.Set(nil) +} + +// UnsetInsideBoundingBox ensures that no value is present for InsideBoundingBox, not even an explicit nil. +func (o *DeleteByParams) UnsetInsideBoundingBox() { + o.InsideBoundingBox.Unset() +} + // GetInsidePolygon returns the InsidePolygon field value if set, zero value otherwise. func (o *DeleteByParams) GetInsidePolygon() [][]float64 { if o == nil || o.InsidePolygon == nil { @@ -373,8 +385,8 @@ func (o DeleteByParams) MarshalJSON() ([]byte, error) { if o.AroundRadius != nil { toSerialize["aroundRadius"] = o.AroundRadius } - if o.InsideBoundingBox != nil { - toSerialize["insideBoundingBox"] = o.InsideBoundingBox + if o.InsideBoundingBox.IsSet() { + toSerialize["insideBoundingBox"] = o.InsideBoundingBox.Get() } if o.InsidePolygon != nil { toSerialize["insidePolygon"] = o.InsidePolygon diff --git a/clients/algoliasearch-client-go/algolia/search/model_index_settings.go b/clients/algoliasearch-client-go/algolia/search/model_index_settings.go index 9d59ec31e6..d1ce606842 100644 --- a/clients/algoliasearch-client-go/algolia/search/model_index_settings.go +++ b/clients/algoliasearch-client-go/algolia/search/model_index_settings.go @@ -4,6 +4,8 @@ package search import ( "encoding/json" "fmt" + + "github.com/algolia/algoliasearch-client-go/v4/algolia/utils" ) // IndexSettings Index settings. @@ -42,6 +44,8 @@ type IndexSettings struct { CustomNormalization *map[string]map[string]string `json:"customNormalization,omitempty"` // Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. AttributeForDistinct *string `json:"attributeForDistinct,omitempty"` + // 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). + MaxFacetHits *int32 `json:"maxFacetHits,omitempty"` // 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. AttributesToRetrieve []string `json:"attributesToRetrieve,omitempty"` // Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/). @@ -90,9 +94,8 @@ type IndexSettings struct { Mode *Mode `json:"mode,omitempty"` SemanticSearch *SemanticSearch `json:"semanticSearch,omitempty"` // Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` - // 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). - OptionalWords []string `json:"optionalWords,omitempty"` + AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` + OptionalWords utils.Nullable[OptionalWords] `json:"optionalWords,omitempty"` // 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. DisableExactOnAttributes []string `json:"disableExactOnAttributes,omitempty"` ExactOnSingleWordQuery *ExactOnSingleWordQuery `json:"exactOnSingleWordQuery,omitempty"` @@ -107,8 +110,6 @@ type IndexSettings struct { MinProximity *int32 `json:"minProximity,omitempty"` // Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. ResponseFields []string `json:"responseFields,omitempty"` - // 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). - MaxFacetHits *int32 `json:"maxFacetHits,omitempty"` // Maximum number of facet values to return for each facet. MaxValuesPerFacet *int32 `json:"maxValuesPerFacet,omitempty"` // Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). @@ -225,6 +226,12 @@ func WithIndexSettingsAttributeForDistinct(val string) IndexSettingsOption { } } +func WithIndexSettingsMaxFacetHits(val int32) IndexSettingsOption { + return func(f *IndexSettings) { + f.MaxFacetHits = &val + } +} + func WithIndexSettingsAttributesToRetrieve(val []string) IndexSettingsOption { return func(f *IndexSettings) { f.AttributesToRetrieve = val @@ -393,7 +400,7 @@ func WithIndexSettingsAdvancedSyntax(val bool) IndexSettingsOption { } } -func WithIndexSettingsOptionalWords(val []string) IndexSettingsOption { +func WithIndexSettingsOptionalWords(val utils.Nullable[OptionalWords]) IndexSettingsOption { return func(f *IndexSettings) { f.OptionalWords = val } @@ -447,12 +454,6 @@ func WithIndexSettingsResponseFields(val []string) IndexSettingsOption { } } -func WithIndexSettingsMaxFacetHits(val int32) IndexSettingsOption { - return func(f *IndexSettings) { - f.MaxFacetHits = &val - } -} - func WithIndexSettingsMaxValuesPerFacet(val int32) IndexSettingsOption { return func(f *IndexSettings) { f.MaxValuesPerFacet = &val @@ -1067,6 +1068,39 @@ func (o *IndexSettings) SetAttributeForDistinct(v string) *IndexSettings { return o } +// GetMaxFacetHits returns the MaxFacetHits field value if set, zero value otherwise. +func (o *IndexSettings) GetMaxFacetHits() int32 { + if o == nil || o.MaxFacetHits == nil { + var ret int32 + return ret + } + return *o.MaxFacetHits +} + +// GetMaxFacetHitsOk returns a tuple with the MaxFacetHits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IndexSettings) GetMaxFacetHitsOk() (*int32, bool) { + if o == nil || o.MaxFacetHits == nil { + return nil, false + } + return o.MaxFacetHits, true +} + +// HasMaxFacetHits returns a boolean if a field has been set. +func (o *IndexSettings) HasMaxFacetHits() bool { + if o != nil && o.MaxFacetHits != nil { + return true + } + + return false +} + +// SetMaxFacetHits gets a reference to the given int32 and assigns it to the MaxFacetHits field. +func (o *IndexSettings) SetMaxFacetHits(v int32) *IndexSettings { + o.MaxFacetHits = &v + return o +} + // GetAttributesToRetrieve returns the AttributesToRetrieve field value if set, zero value otherwise. func (o *IndexSettings) GetAttributesToRetrieve() []string { if o == nil || o.AttributesToRetrieve == nil { @@ -1991,39 +2025,50 @@ func (o *IndexSettings) SetAdvancedSyntax(v bool) *IndexSettings { return o } -// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise. -func (o *IndexSettings) GetOptionalWords() []string { - if o == nil || o.OptionalWords == nil { - var ret []string +// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IndexSettings) GetOptionalWords() OptionalWords { + if o == nil || o.OptionalWords.Get() == nil { + var ret OptionalWords return ret } - return o.OptionalWords + return *o.OptionalWords.Get() } // GetOptionalWordsOk returns a tuple with the OptionalWords field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *IndexSettings) GetOptionalWordsOk() ([]string, bool) { - if o == nil || o.OptionalWords == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *IndexSettings) GetOptionalWordsOk() (*OptionalWords, bool) { + if o == nil { return nil, false } - return o.OptionalWords, true + return o.OptionalWords.Get(), o.OptionalWords.IsSet() } // HasOptionalWords returns a boolean if a field has been set. func (o *IndexSettings) HasOptionalWords() bool { - if o != nil && o.OptionalWords != nil { + if o != nil && o.OptionalWords.IsSet() { return true } return false } -// SetOptionalWords gets a reference to the given []string and assigns it to the OptionalWords field. -func (o *IndexSettings) SetOptionalWords(v []string) *IndexSettings { - o.OptionalWords = v +// SetOptionalWords gets a reference to the given utils.Nullable[OptionalWords] and assigns it to the OptionalWords field. +func (o *IndexSettings) SetOptionalWords(v *OptionalWords) *IndexSettings { + o.OptionalWords.Set(v) return o } +// SetOptionalWordsNil sets the value for OptionalWords to be an explicit nil. +func (o *IndexSettings) SetOptionalWordsNil() { + o.OptionalWords.Set(nil) +} + +// UnsetOptionalWords ensures that no value is present for OptionalWords, not even an explicit nil. +func (o *IndexSettings) UnsetOptionalWords() { + o.OptionalWords.Unset() +} + // GetDisableExactOnAttributes returns the DisableExactOnAttributes field value if set, zero value otherwise. func (o *IndexSettings) GetDisableExactOnAttributes() []string { if o == nil || o.DisableExactOnAttributes == nil { @@ -2288,39 +2333,6 @@ func (o *IndexSettings) SetResponseFields(v []string) *IndexSettings { return o } -// GetMaxFacetHits returns the MaxFacetHits field value if set, zero value otherwise. -func (o *IndexSettings) GetMaxFacetHits() int32 { - if o == nil || o.MaxFacetHits == nil { - var ret int32 - return ret - } - return *o.MaxFacetHits -} - -// GetMaxFacetHitsOk returns a tuple with the MaxFacetHits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *IndexSettings) GetMaxFacetHitsOk() (*int32, bool) { - if o == nil || o.MaxFacetHits == nil { - return nil, false - } - return o.MaxFacetHits, true -} - -// HasMaxFacetHits returns a boolean if a field has been set. -func (o *IndexSettings) HasMaxFacetHits() bool { - if o != nil && o.MaxFacetHits != nil { - return true - } - - return false -} - -// SetMaxFacetHits gets a reference to the given int32 and assigns it to the MaxFacetHits field. -func (o *IndexSettings) SetMaxFacetHits(v int32) *IndexSettings { - o.MaxFacetHits = &v - return o -} - // GetMaxValuesPerFacet returns the MaxValuesPerFacet field value if set, zero value otherwise. func (o *IndexSettings) GetMaxValuesPerFacet() int32 { if o == nil || o.MaxValuesPerFacet == nil { @@ -2572,6 +2584,9 @@ func (o IndexSettings) MarshalJSON() ([]byte, error) { if o.AttributeForDistinct != nil { toSerialize["attributeForDistinct"] = o.AttributeForDistinct } + if o.MaxFacetHits != nil { + toSerialize["maxFacetHits"] = o.MaxFacetHits + } if o.AttributesToRetrieve != nil { toSerialize["attributesToRetrieve"] = o.AttributesToRetrieve } @@ -2656,8 +2671,8 @@ func (o IndexSettings) MarshalJSON() ([]byte, error) { if o.AdvancedSyntax != nil { toSerialize["advancedSyntax"] = o.AdvancedSyntax } - if o.OptionalWords != nil { - toSerialize["optionalWords"] = o.OptionalWords + if o.OptionalWords.IsSet() { + toSerialize["optionalWords"] = o.OptionalWords.Get() } if o.DisableExactOnAttributes != nil { toSerialize["disableExactOnAttributes"] = o.DisableExactOnAttributes @@ -2683,9 +2698,6 @@ func (o IndexSettings) MarshalJSON() ([]byte, error) { if o.ResponseFields != nil { toSerialize["responseFields"] = o.ResponseFields } - if o.MaxFacetHits != nil { - toSerialize["maxFacetHits"] = o.MaxFacetHits - } if o.MaxValuesPerFacet != nil { toSerialize["maxValuesPerFacet"] = o.MaxValuesPerFacet } @@ -2731,6 +2743,7 @@ func (o IndexSettings) String() string { out += fmt.Sprintf(" userData=%v\n", o.UserData) out += fmt.Sprintf(" customNormalization=%v\n", o.CustomNormalization) out += fmt.Sprintf(" attributeForDistinct=%v\n", o.AttributeForDistinct) + out += fmt.Sprintf(" maxFacetHits=%v\n", o.MaxFacetHits) out += fmt.Sprintf(" attributesToRetrieve=%v\n", o.AttributesToRetrieve) out += fmt.Sprintf(" ranking=%v\n", o.Ranking) out += fmt.Sprintf(" customRanking=%v\n", o.CustomRanking) @@ -2768,7 +2781,6 @@ func (o IndexSettings) String() string { out += fmt.Sprintf(" replaceSynonymsInHighlight=%v\n", o.ReplaceSynonymsInHighlight) out += fmt.Sprintf(" minProximity=%v\n", o.MinProximity) out += fmt.Sprintf(" responseFields=%v\n", o.ResponseFields) - out += fmt.Sprintf(" maxFacetHits=%v\n", o.MaxFacetHits) out += fmt.Sprintf(" maxValuesPerFacet=%v\n", o.MaxValuesPerFacet) out += fmt.Sprintf(" sortFacetValuesBy=%v\n", o.SortFacetValuesBy) out += fmt.Sprintf(" attributeCriteriaComputedByMinProximity=%v\n", o.AttributeCriteriaComputedByMinProximity) diff --git a/clients/algoliasearch-client-go/algolia/search/model_inside_bounding_box.go b/clients/algoliasearch-client-go/algolia/search/model_inside_bounding_box.go new file mode 100644 index 0000000000..8927ab29b7 --- /dev/null +++ b/clients/algoliasearch-client-go/algolia/search/model_inside_bounding_box.go @@ -0,0 +1,90 @@ +// 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. +package search + +import ( + "encoding/json" + "fmt" +) + +// InsideBoundingBox - struct for InsideBoundingBox. +type InsideBoundingBox struct { + ArrayOfArrayOfFloat64 *[][]float64 + String *string +} + +// stringAsInsideBoundingBox is a convenience function that returns string wrapped in InsideBoundingBox. +func StringAsInsideBoundingBox(v string) *InsideBoundingBox { + return &InsideBoundingBox{ + String: &v, + } +} + +// [][]float64AsInsideBoundingBox is a convenience function that returns [][]float64 wrapped in InsideBoundingBox. +func ArrayOfArrayOfFloat64AsInsideBoundingBox(v [][]float64) *InsideBoundingBox { + return &InsideBoundingBox{ + ArrayOfArrayOfFloat64: &v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct. +func (dst *InsideBoundingBox) UnmarshalJSON(data []byte) error { + var err error + // this object is nullable so check if the payload is null or empty string + if string(data) == "" || string(data) == "{}" { + return nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil && validateStruct(dst.String) == nil { + return nil // found the correct type + } else { + dst.String = nil + } + // try to unmarshal data into ArrayOfArrayOfFloat64 + err = newStrictDecoder(data).Decode(&dst.ArrayOfArrayOfFloat64) + if err == nil && validateStruct(dst.ArrayOfArrayOfFloat64) == nil { + return nil // found the correct type + } else { + dst.ArrayOfArrayOfFloat64 = nil + } + + return fmt.Errorf("Data failed to match schemas in oneOf(InsideBoundingBox)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON. +func (src InsideBoundingBox) MarshalJSON() ([]byte, error) { + if src.ArrayOfArrayOfFloat64 != nil { + serialized, err := json.Marshal(&src.ArrayOfArrayOfFloat64) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal one of ArrayOfArrayOfFloat64 of InsideBoundingBox: %w", err) + } + + return serialized, nil + } + + if src.String != nil { + serialized, err := json.Marshal(&src.String) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal one of String of InsideBoundingBox: %w", err) + } + + return serialized, nil + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance. +func (obj InsideBoundingBox) GetActualInstance() any { + if obj.ArrayOfArrayOfFloat64 != nil { + return *obj.ArrayOfArrayOfFloat64 + } + + if obj.String != nil { + return *obj.String + } + + // all schemas are nil + return nil +} diff --git a/clients/algoliasearch-client-go/algolia/search/model_optional_words.go b/clients/algoliasearch-client-go/algolia/search/model_optional_words.go new file mode 100644 index 0000000000..2995fa40ac --- /dev/null +++ b/clients/algoliasearch-client-go/algolia/search/model_optional_words.go @@ -0,0 +1,90 @@ +// 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. +package search + +import ( + "encoding/json" + "fmt" +) + +// OptionalWords - struct for OptionalWords. +type OptionalWords struct { + ArrayOfString *[]string + String *string +} + +// stringAsOptionalWords is a convenience function that returns string wrapped in OptionalWords. +func StringAsOptionalWords(v string) *OptionalWords { + return &OptionalWords{ + String: &v, + } +} + +// []stringAsOptionalWords is a convenience function that returns []string wrapped in OptionalWords. +func ArrayOfStringAsOptionalWords(v []string) *OptionalWords { + return &OptionalWords{ + ArrayOfString: &v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct. +func (dst *OptionalWords) UnmarshalJSON(data []byte) error { + var err error + // this object is nullable so check if the payload is null or empty string + if string(data) == "" || string(data) == "{}" { + return nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil && validateStruct(dst.String) == nil { + return nil // found the correct type + } else { + dst.String = nil + } + // try to unmarshal data into ArrayOfString + err = newStrictDecoder(data).Decode(&dst.ArrayOfString) + if err == nil && validateStruct(dst.ArrayOfString) == nil { + return nil // found the correct type + } else { + dst.ArrayOfString = nil + } + + return fmt.Errorf("Data failed to match schemas in oneOf(OptionalWords)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON. +func (src OptionalWords) MarshalJSON() ([]byte, error) { + if src.ArrayOfString != nil { + serialized, err := json.Marshal(&src.ArrayOfString) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal one of ArrayOfString of OptionalWords: %w", err) + } + + return serialized, nil + } + + if src.String != nil { + serialized, err := json.Marshal(&src.String) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal one of String of OptionalWords: %w", err) + } + + return serialized, nil + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance. +func (obj OptionalWords) GetActualInstance() any { + if obj.ArrayOfString != nil { + return *obj.ArrayOfString + } + + if obj.String != nil { + return *obj.String + } + + // all schemas are nil + return nil +} diff --git a/clients/algoliasearch-client-go/algolia/search/model_search_for_facets.go b/clients/algoliasearch-client-go/algolia/search/model_search_for_facets.go index d71490a3ac..83a95637b4 100644 --- a/clients/algoliasearch-client-go/algolia/search/model_search_for_facets.go +++ b/clients/algoliasearch-client-go/algolia/search/model_search_for_facets.go @@ -4,6 +4,8 @@ package search import ( "encoding/json" "fmt" + + "github.com/algolia/algoliasearch-client-go/v4/algolia/utils" ) // SearchForFacets struct for SearchForFacets. @@ -41,9 +43,8 @@ type SearchForFacets struct { AroundRadius *AroundRadius `json:"aroundRadius,omitempty"` AroundPrecision *AroundPrecision `json:"aroundPrecision,omitempty"` // Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - MinimumAroundRadius *int32 `json:"minimumAroundRadius,omitempty"` - // 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). - InsideBoundingBox [][]float64 `json:"insideBoundingBox,omitempty"` + MinimumAroundRadius *int32 `json:"minimumAroundRadius,omitempty"` + InsideBoundingBox utils.Nullable[InsideBoundingBox] `json:"insideBoundingBox,omitempty"` // 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`. InsidePolygon [][]float64 `json:"insidePolygon,omitempty"` // ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. @@ -116,9 +117,8 @@ type SearchForFacets struct { Mode *Mode `json:"mode,omitempty"` SemanticSearch *SemanticSearch `json:"semanticSearch,omitempty"` // Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` - // 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). - OptionalWords []string `json:"optionalWords,omitempty"` + AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` + OptionalWords utils.Nullable[OptionalWords] `json:"optionalWords,omitempty"` // 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. DisableExactOnAttributes []string `json:"disableExactOnAttributes,omitempty"` ExactOnSingleWordQuery *ExactOnSingleWordQuery `json:"exactOnSingleWordQuery,omitempty"` @@ -133,8 +133,6 @@ type SearchForFacets struct { MinProximity *int32 `json:"minProximity,omitempty"` // Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. ResponseFields []string `json:"responseFields,omitempty"` - // 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). - MaxFacetHits *int32 `json:"maxFacetHits,omitempty"` // Maximum number of facet values to return for each facet. MaxValuesPerFacet *int32 `json:"maxValuesPerFacet,omitempty"` // Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). @@ -150,8 +148,10 @@ type SearchForFacets struct { // Index name (case-sensitive). IndexName string `json:"indexName"` // Text to search inside the facet's values. - FacetQuery *string `json:"facetQuery,omitempty"` - Type SearchTypeFacet `json:"type"` + FacetQuery *string `json:"facetQuery,omitempty"` + // 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). + MaxFacetHits *int32 `json:"maxFacetHits,omitempty"` + Type SearchTypeFacet `json:"type"` } type SearchForFacetsOption func(f *SearchForFacets) @@ -276,7 +276,7 @@ func WithSearchForFacetsMinimumAroundRadius(val int32) SearchForFacetsOption { } } -func WithSearchForFacetsInsideBoundingBox(val [][]float64) SearchForFacetsOption { +func WithSearchForFacetsInsideBoundingBox(val utils.Nullable[InsideBoundingBox]) SearchForFacetsOption { return func(f *SearchForFacets) { f.InsideBoundingBox = val } @@ -522,7 +522,7 @@ func WithSearchForFacetsAdvancedSyntax(val bool) SearchForFacetsOption { } } -func WithSearchForFacetsOptionalWords(val []string) SearchForFacetsOption { +func WithSearchForFacetsOptionalWords(val utils.Nullable[OptionalWords]) SearchForFacetsOption { return func(f *SearchForFacets) { f.OptionalWords = val } @@ -576,12 +576,6 @@ func WithSearchForFacetsResponseFields(val []string) SearchForFacetsOption { } } -func WithSearchForFacetsMaxFacetHits(val int32) SearchForFacetsOption { - return func(f *SearchForFacets) { - f.MaxFacetHits = &val - } -} - func WithSearchForFacetsMaxValuesPerFacet(val int32) SearchForFacetsOption { return func(f *SearchForFacets) { f.MaxValuesPerFacet = &val @@ -624,6 +618,12 @@ func WithSearchForFacetsFacetQuery(val string) SearchForFacetsOption { } } +func WithSearchForFacetsMaxFacetHits(val int32) SearchForFacetsOption { + return func(f *SearchForFacets) { + f.MaxFacetHits = &val + } +} + // NewSearchForFacets instantiates a new SearchForFacets object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -1304,39 +1304,50 @@ func (o *SearchForFacets) SetMinimumAroundRadius(v int32) *SearchForFacets { return o } -// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise. -func (o *SearchForFacets) GetInsideBoundingBox() [][]float64 { - if o == nil || o.InsideBoundingBox == nil { - var ret [][]float64 +// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SearchForFacets) GetInsideBoundingBox() InsideBoundingBox { + if o == nil || o.InsideBoundingBox.Get() == nil { + var ret InsideBoundingBox return ret } - return o.InsideBoundingBox + return *o.InsideBoundingBox.Get() } // GetInsideBoundingBoxOk returns a tuple with the InsideBoundingBox field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SearchForFacets) GetInsideBoundingBoxOk() ([][]float64, bool) { - if o == nil || o.InsideBoundingBox == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *SearchForFacets) GetInsideBoundingBoxOk() (*InsideBoundingBox, bool) { + if o == nil { return nil, false } - return o.InsideBoundingBox, true + return o.InsideBoundingBox.Get(), o.InsideBoundingBox.IsSet() } // HasInsideBoundingBox returns a boolean if a field has been set. func (o *SearchForFacets) HasInsideBoundingBox() bool { - if o != nil && o.InsideBoundingBox != nil { + if o != nil && o.InsideBoundingBox.IsSet() { return true } return false } -// SetInsideBoundingBox gets a reference to the given [][]float64 and assigns it to the InsideBoundingBox field. -func (o *SearchForFacets) SetInsideBoundingBox(v [][]float64) *SearchForFacets { - o.InsideBoundingBox = v +// SetInsideBoundingBox gets a reference to the given utils.Nullable[InsideBoundingBox] and assigns it to the InsideBoundingBox field. +func (o *SearchForFacets) SetInsideBoundingBox(v *InsideBoundingBox) *SearchForFacets { + o.InsideBoundingBox.Set(v) return o } +// SetInsideBoundingBoxNil sets the value for InsideBoundingBox to be an explicit nil. +func (o *SearchForFacets) SetInsideBoundingBoxNil() { + o.InsideBoundingBox.Set(nil) +} + +// UnsetInsideBoundingBox ensures that no value is present for InsideBoundingBox, not even an explicit nil. +func (o *SearchForFacets) UnsetInsideBoundingBox() { + o.InsideBoundingBox.Unset() +} + // GetInsidePolygon returns the InsidePolygon field value if set, zero value otherwise. func (o *SearchForFacets) GetInsidePolygon() [][]float64 { if o == nil || o.InsidePolygon == nil { @@ -2657,39 +2668,50 @@ func (o *SearchForFacets) SetAdvancedSyntax(v bool) *SearchForFacets { return o } -// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise. -func (o *SearchForFacets) GetOptionalWords() []string { - if o == nil || o.OptionalWords == nil { - var ret []string +// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SearchForFacets) GetOptionalWords() OptionalWords { + if o == nil || o.OptionalWords.Get() == nil { + var ret OptionalWords return ret } - return o.OptionalWords + return *o.OptionalWords.Get() } // GetOptionalWordsOk returns a tuple with the OptionalWords field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SearchForFacets) GetOptionalWordsOk() ([]string, bool) { - if o == nil || o.OptionalWords == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *SearchForFacets) GetOptionalWordsOk() (*OptionalWords, bool) { + if o == nil { return nil, false } - return o.OptionalWords, true + return o.OptionalWords.Get(), o.OptionalWords.IsSet() } // HasOptionalWords returns a boolean if a field has been set. func (o *SearchForFacets) HasOptionalWords() bool { - if o != nil && o.OptionalWords != nil { + if o != nil && o.OptionalWords.IsSet() { return true } return false } -// SetOptionalWords gets a reference to the given []string and assigns it to the OptionalWords field. -func (o *SearchForFacets) SetOptionalWords(v []string) *SearchForFacets { - o.OptionalWords = v +// SetOptionalWords gets a reference to the given utils.Nullable[OptionalWords] and assigns it to the OptionalWords field. +func (o *SearchForFacets) SetOptionalWords(v *OptionalWords) *SearchForFacets { + o.OptionalWords.Set(v) return o } +// SetOptionalWordsNil sets the value for OptionalWords to be an explicit nil. +func (o *SearchForFacets) SetOptionalWordsNil() { + o.OptionalWords.Set(nil) +} + +// UnsetOptionalWords ensures that no value is present for OptionalWords, not even an explicit nil. +func (o *SearchForFacets) UnsetOptionalWords() { + o.OptionalWords.Unset() +} + // GetDisableExactOnAttributes returns the DisableExactOnAttributes field value if set, zero value otherwise. func (o *SearchForFacets) GetDisableExactOnAttributes() []string { if o == nil || o.DisableExactOnAttributes == nil { @@ -2954,39 +2976,6 @@ func (o *SearchForFacets) SetResponseFields(v []string) *SearchForFacets { return o } -// GetMaxFacetHits returns the MaxFacetHits field value if set, zero value otherwise. -func (o *SearchForFacets) GetMaxFacetHits() int32 { - if o == nil || o.MaxFacetHits == nil { - var ret int32 - return ret - } - return *o.MaxFacetHits -} - -// GetMaxFacetHitsOk returns a tuple with the MaxFacetHits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SearchForFacets) GetMaxFacetHitsOk() (*int32, bool) { - if o == nil || o.MaxFacetHits == nil { - return nil, false - } - return o.MaxFacetHits, true -} - -// HasMaxFacetHits returns a boolean if a field has been set. -func (o *SearchForFacets) HasMaxFacetHits() bool { - if o != nil && o.MaxFacetHits != nil { - return true - } - - return false -} - -// SetMaxFacetHits gets a reference to the given int32 and assigns it to the MaxFacetHits field. -func (o *SearchForFacets) SetMaxFacetHits(v int32) *SearchForFacets { - o.MaxFacetHits = &v - return o -} - // GetMaxValuesPerFacet returns the MaxValuesPerFacet field value if set, zero value otherwise. func (o *SearchForFacets) GetMaxValuesPerFacet() int32 { if o == nil || o.MaxValuesPerFacet == nil { @@ -3268,6 +3257,39 @@ func (o *SearchForFacets) SetFacetQuery(v string) *SearchForFacets { return o } +// GetMaxFacetHits returns the MaxFacetHits field value if set, zero value otherwise. +func (o *SearchForFacets) GetMaxFacetHits() int32 { + if o == nil || o.MaxFacetHits == nil { + var ret int32 + return ret + } + return *o.MaxFacetHits +} + +// GetMaxFacetHitsOk returns a tuple with the MaxFacetHits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchForFacets) GetMaxFacetHitsOk() (*int32, bool) { + if o == nil || o.MaxFacetHits == nil { + return nil, false + } + return o.MaxFacetHits, true +} + +// HasMaxFacetHits returns a boolean if a field has been set. +func (o *SearchForFacets) HasMaxFacetHits() bool { + if o != nil && o.MaxFacetHits != nil { + return true + } + + return false +} + +// SetMaxFacetHits gets a reference to the given int32 and assigns it to the MaxFacetHits field. +func (o *SearchForFacets) SetMaxFacetHits(v int32) *SearchForFacets { + o.MaxFacetHits = &v + return o +} + // GetType returns the Type field value. func (o *SearchForFacets) GetType() SearchTypeFacet { if o == nil { @@ -3355,8 +3377,8 @@ func (o SearchForFacets) MarshalJSON() ([]byte, error) { if o.MinimumAroundRadius != nil { toSerialize["minimumAroundRadius"] = o.MinimumAroundRadius } - if o.InsideBoundingBox != nil { - toSerialize["insideBoundingBox"] = o.InsideBoundingBox + if o.InsideBoundingBox.IsSet() { + toSerialize["insideBoundingBox"] = o.InsideBoundingBox.Get() } if o.InsidePolygon != nil { toSerialize["insidePolygon"] = o.InsidePolygon @@ -3478,8 +3500,8 @@ func (o SearchForFacets) MarshalJSON() ([]byte, error) { if o.AdvancedSyntax != nil { toSerialize["advancedSyntax"] = o.AdvancedSyntax } - if o.OptionalWords != nil { - toSerialize["optionalWords"] = o.OptionalWords + if o.OptionalWords.IsSet() { + toSerialize["optionalWords"] = o.OptionalWords.Get() } if o.DisableExactOnAttributes != nil { toSerialize["disableExactOnAttributes"] = o.DisableExactOnAttributes @@ -3505,9 +3527,6 @@ func (o SearchForFacets) MarshalJSON() ([]byte, error) { if o.ResponseFields != nil { toSerialize["responseFields"] = o.ResponseFields } - if o.MaxFacetHits != nil { - toSerialize["maxFacetHits"] = o.MaxFacetHits - } if o.MaxValuesPerFacet != nil { toSerialize["maxValuesPerFacet"] = o.MaxValuesPerFacet } @@ -3535,6 +3554,9 @@ func (o SearchForFacets) MarshalJSON() ([]byte, error) { if o.FacetQuery != nil { toSerialize["facetQuery"] = o.FacetQuery } + if o.MaxFacetHits != nil { + toSerialize["maxFacetHits"] = o.MaxFacetHits + } if true { toSerialize["type"] = o.Type } @@ -3618,7 +3640,6 @@ func (o SearchForFacets) String() string { out += fmt.Sprintf(" replaceSynonymsInHighlight=%v\n", o.ReplaceSynonymsInHighlight) out += fmt.Sprintf(" minProximity=%v\n", o.MinProximity) out += fmt.Sprintf(" responseFields=%v\n", o.ResponseFields) - out += fmt.Sprintf(" maxFacetHits=%v\n", o.MaxFacetHits) out += fmt.Sprintf(" maxValuesPerFacet=%v\n", o.MaxValuesPerFacet) out += fmt.Sprintf(" sortFacetValuesBy=%v\n", o.SortFacetValuesBy) out += fmt.Sprintf(" attributeCriteriaComputedByMinProximity=%v\n", o.AttributeCriteriaComputedByMinProximity) @@ -3628,6 +3649,7 @@ func (o SearchForFacets) String() string { out += fmt.Sprintf(" facet=%v\n", o.Facet) out += fmt.Sprintf(" indexName=%v\n", o.IndexName) out += fmt.Sprintf(" facetQuery=%v\n", o.FacetQuery) + out += fmt.Sprintf(" maxFacetHits=%v\n", o.MaxFacetHits) out += fmt.Sprintf(" type=%v\n", o.Type) return fmt.Sprintf("SearchForFacets {\n%s}", out) } diff --git a/clients/algoliasearch-client-go/algolia/search/model_search_for_hits.go b/clients/algoliasearch-client-go/algolia/search/model_search_for_hits.go index 1d90ee798a..ae45495f46 100644 --- a/clients/algoliasearch-client-go/algolia/search/model_search_for_hits.go +++ b/clients/algoliasearch-client-go/algolia/search/model_search_for_hits.go @@ -4,6 +4,8 @@ package search import ( "encoding/json" "fmt" + + "github.com/algolia/algoliasearch-client-go/v4/algolia/utils" ) // SearchForHits struct for SearchForHits. @@ -41,9 +43,8 @@ type SearchForHits struct { AroundRadius *AroundRadius `json:"aroundRadius,omitempty"` AroundPrecision *AroundPrecision `json:"aroundPrecision,omitempty"` // Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - MinimumAroundRadius *int32 `json:"minimumAroundRadius,omitempty"` - // 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). - InsideBoundingBox [][]float64 `json:"insideBoundingBox,omitempty"` + MinimumAroundRadius *int32 `json:"minimumAroundRadius,omitempty"` + InsideBoundingBox utils.Nullable[InsideBoundingBox] `json:"insideBoundingBox,omitempty"` // 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`. InsidePolygon [][]float64 `json:"insidePolygon,omitempty"` // ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. @@ -116,9 +117,8 @@ type SearchForHits struct { Mode *Mode `json:"mode,omitempty"` SemanticSearch *SemanticSearch `json:"semanticSearch,omitempty"` // Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` - // 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). - OptionalWords []string `json:"optionalWords,omitempty"` + AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` + OptionalWords utils.Nullable[OptionalWords] `json:"optionalWords,omitempty"` // 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. DisableExactOnAttributes []string `json:"disableExactOnAttributes,omitempty"` ExactOnSingleWordQuery *ExactOnSingleWordQuery `json:"exactOnSingleWordQuery,omitempty"` @@ -133,8 +133,6 @@ type SearchForHits struct { MinProximity *int32 `json:"minProximity,omitempty"` // Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. ResponseFields []string `json:"responseFields,omitempty"` - // 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). - MaxFacetHits *int32 `json:"maxFacetHits,omitempty"` // Maximum number of facet values to return for each facet. MaxValuesPerFacet *int32 `json:"maxValuesPerFacet,omitempty"` // Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). @@ -272,7 +270,7 @@ func WithSearchForHitsMinimumAroundRadius(val int32) SearchForHitsOption { } } -func WithSearchForHitsInsideBoundingBox(val [][]float64) SearchForHitsOption { +func WithSearchForHitsInsideBoundingBox(val utils.Nullable[InsideBoundingBox]) SearchForHitsOption { return func(f *SearchForHits) { f.InsideBoundingBox = val } @@ -518,7 +516,7 @@ func WithSearchForHitsAdvancedSyntax(val bool) SearchForHitsOption { } } -func WithSearchForHitsOptionalWords(val []string) SearchForHitsOption { +func WithSearchForHitsOptionalWords(val utils.Nullable[OptionalWords]) SearchForHitsOption { return func(f *SearchForHits) { f.OptionalWords = val } @@ -572,12 +570,6 @@ func WithSearchForHitsResponseFields(val []string) SearchForHitsOption { } } -func WithSearchForHitsMaxFacetHits(val int32) SearchForHitsOption { - return func(f *SearchForHits) { - f.MaxFacetHits = &val - } -} - func WithSearchForHitsMaxValuesPerFacet(val int32) SearchForHitsOption { return func(f *SearchForHits) { f.MaxValuesPerFacet = &val @@ -1298,39 +1290,50 @@ func (o *SearchForHits) SetMinimumAroundRadius(v int32) *SearchForHits { return o } -// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise. -func (o *SearchForHits) GetInsideBoundingBox() [][]float64 { - if o == nil || o.InsideBoundingBox == nil { - var ret [][]float64 +// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SearchForHits) GetInsideBoundingBox() InsideBoundingBox { + if o == nil || o.InsideBoundingBox.Get() == nil { + var ret InsideBoundingBox return ret } - return o.InsideBoundingBox + return *o.InsideBoundingBox.Get() } // GetInsideBoundingBoxOk returns a tuple with the InsideBoundingBox field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SearchForHits) GetInsideBoundingBoxOk() ([][]float64, bool) { - if o == nil || o.InsideBoundingBox == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *SearchForHits) GetInsideBoundingBoxOk() (*InsideBoundingBox, bool) { + if o == nil { return nil, false } - return o.InsideBoundingBox, true + return o.InsideBoundingBox.Get(), o.InsideBoundingBox.IsSet() } // HasInsideBoundingBox returns a boolean if a field has been set. func (o *SearchForHits) HasInsideBoundingBox() bool { - if o != nil && o.InsideBoundingBox != nil { + if o != nil && o.InsideBoundingBox.IsSet() { return true } return false } -// SetInsideBoundingBox gets a reference to the given [][]float64 and assigns it to the InsideBoundingBox field. -func (o *SearchForHits) SetInsideBoundingBox(v [][]float64) *SearchForHits { - o.InsideBoundingBox = v +// SetInsideBoundingBox gets a reference to the given utils.Nullable[InsideBoundingBox] and assigns it to the InsideBoundingBox field. +func (o *SearchForHits) SetInsideBoundingBox(v *InsideBoundingBox) *SearchForHits { + o.InsideBoundingBox.Set(v) return o } +// SetInsideBoundingBoxNil sets the value for InsideBoundingBox to be an explicit nil. +func (o *SearchForHits) SetInsideBoundingBoxNil() { + o.InsideBoundingBox.Set(nil) +} + +// UnsetInsideBoundingBox ensures that no value is present for InsideBoundingBox, not even an explicit nil. +func (o *SearchForHits) UnsetInsideBoundingBox() { + o.InsideBoundingBox.Unset() +} + // GetInsidePolygon returns the InsidePolygon field value if set, zero value otherwise. func (o *SearchForHits) GetInsidePolygon() [][]float64 { if o == nil || o.InsidePolygon == nil { @@ -2651,39 +2654,50 @@ func (o *SearchForHits) SetAdvancedSyntax(v bool) *SearchForHits { return o } -// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise. -func (o *SearchForHits) GetOptionalWords() []string { - if o == nil || o.OptionalWords == nil { - var ret []string +// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SearchForHits) GetOptionalWords() OptionalWords { + if o == nil || o.OptionalWords.Get() == nil { + var ret OptionalWords return ret } - return o.OptionalWords + return *o.OptionalWords.Get() } // GetOptionalWordsOk returns a tuple with the OptionalWords field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SearchForHits) GetOptionalWordsOk() ([]string, bool) { - if o == nil || o.OptionalWords == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *SearchForHits) GetOptionalWordsOk() (*OptionalWords, bool) { + if o == nil { return nil, false } - return o.OptionalWords, true + return o.OptionalWords.Get(), o.OptionalWords.IsSet() } // HasOptionalWords returns a boolean if a field has been set. func (o *SearchForHits) HasOptionalWords() bool { - if o != nil && o.OptionalWords != nil { + if o != nil && o.OptionalWords.IsSet() { return true } return false } -// SetOptionalWords gets a reference to the given []string and assigns it to the OptionalWords field. -func (o *SearchForHits) SetOptionalWords(v []string) *SearchForHits { - o.OptionalWords = v +// SetOptionalWords gets a reference to the given utils.Nullable[OptionalWords] and assigns it to the OptionalWords field. +func (o *SearchForHits) SetOptionalWords(v *OptionalWords) *SearchForHits { + o.OptionalWords.Set(v) return o } +// SetOptionalWordsNil sets the value for OptionalWords to be an explicit nil. +func (o *SearchForHits) SetOptionalWordsNil() { + o.OptionalWords.Set(nil) +} + +// UnsetOptionalWords ensures that no value is present for OptionalWords, not even an explicit nil. +func (o *SearchForHits) UnsetOptionalWords() { + o.OptionalWords.Unset() +} + // GetDisableExactOnAttributes returns the DisableExactOnAttributes field value if set, zero value otherwise. func (o *SearchForHits) GetDisableExactOnAttributes() []string { if o == nil || o.DisableExactOnAttributes == nil { @@ -2948,39 +2962,6 @@ func (o *SearchForHits) SetResponseFields(v []string) *SearchForHits { return o } -// GetMaxFacetHits returns the MaxFacetHits field value if set, zero value otherwise. -func (o *SearchForHits) GetMaxFacetHits() int32 { - if o == nil || o.MaxFacetHits == nil { - var ret int32 - return ret - } - return *o.MaxFacetHits -} - -// GetMaxFacetHitsOk returns a tuple with the MaxFacetHits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SearchForHits) GetMaxFacetHitsOk() (*int32, bool) { - if o == nil || o.MaxFacetHits == nil { - return nil, false - } - return o.MaxFacetHits, true -} - -// HasMaxFacetHits returns a boolean if a field has been set. -func (o *SearchForHits) HasMaxFacetHits() bool { - if o != nil && o.MaxFacetHits != nil { - return true - } - - return false -} - -// SetMaxFacetHits gets a reference to the given int32 and assigns it to the MaxFacetHits field. -func (o *SearchForHits) SetMaxFacetHits(v int32) *SearchForHits { - o.MaxFacetHits = &v - return o -} - // GetMaxValuesPerFacet returns the MaxValuesPerFacet field value if set, zero value otherwise. func (o *SearchForHits) GetMaxValuesPerFacet() int32 { if o == nil || o.MaxValuesPerFacet == nil { @@ -3299,8 +3280,8 @@ func (o SearchForHits) MarshalJSON() ([]byte, error) { if o.MinimumAroundRadius != nil { toSerialize["minimumAroundRadius"] = o.MinimumAroundRadius } - if o.InsideBoundingBox != nil { - toSerialize["insideBoundingBox"] = o.InsideBoundingBox + if o.InsideBoundingBox.IsSet() { + toSerialize["insideBoundingBox"] = o.InsideBoundingBox.Get() } if o.InsidePolygon != nil { toSerialize["insidePolygon"] = o.InsidePolygon @@ -3422,8 +3403,8 @@ func (o SearchForHits) MarshalJSON() ([]byte, error) { if o.AdvancedSyntax != nil { toSerialize["advancedSyntax"] = o.AdvancedSyntax } - if o.OptionalWords != nil { - toSerialize["optionalWords"] = o.OptionalWords + if o.OptionalWords.IsSet() { + toSerialize["optionalWords"] = o.OptionalWords.Get() } if o.DisableExactOnAttributes != nil { toSerialize["disableExactOnAttributes"] = o.DisableExactOnAttributes @@ -3449,9 +3430,6 @@ func (o SearchForHits) MarshalJSON() ([]byte, error) { if o.ResponseFields != nil { toSerialize["responseFields"] = o.ResponseFields } - if o.MaxFacetHits != nil { - toSerialize["maxFacetHits"] = o.MaxFacetHits - } if o.MaxValuesPerFacet != nil { toSerialize["maxValuesPerFacet"] = o.MaxValuesPerFacet } @@ -3556,7 +3534,6 @@ func (o SearchForHits) String() string { out += fmt.Sprintf(" replaceSynonymsInHighlight=%v\n", o.ReplaceSynonymsInHighlight) out += fmt.Sprintf(" minProximity=%v\n", o.MinProximity) out += fmt.Sprintf(" responseFields=%v\n", o.ResponseFields) - out += fmt.Sprintf(" maxFacetHits=%v\n", o.MaxFacetHits) out += fmt.Sprintf(" maxValuesPerFacet=%v\n", o.MaxValuesPerFacet) out += fmt.Sprintf(" sortFacetValuesBy=%v\n", o.SortFacetValuesBy) out += fmt.Sprintf(" attributeCriteriaComputedByMinProximity=%v\n", o.AttributeCriteriaComputedByMinProximity) diff --git a/clients/algoliasearch-client-go/algolia/search/model_search_params_object.go b/clients/algoliasearch-client-go/algolia/search/model_search_params_object.go index 31fa582a7b..51a3e98aa4 100644 --- a/clients/algoliasearch-client-go/algolia/search/model_search_params_object.go +++ b/clients/algoliasearch-client-go/algolia/search/model_search_params_object.go @@ -4,6 +4,8 @@ package search import ( "encoding/json" "fmt" + + "github.com/algolia/algoliasearch-client-go/v4/algolia/utils" ) // SearchParamsObject Each parameter value, including the `query` must not be larger than 512 bytes. @@ -39,9 +41,8 @@ type SearchParamsObject struct { AroundRadius *AroundRadius `json:"aroundRadius,omitempty"` AroundPrecision *AroundPrecision `json:"aroundPrecision,omitempty"` // Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - MinimumAroundRadius *int32 `json:"minimumAroundRadius,omitempty"` - // 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). - InsideBoundingBox [][]float64 `json:"insideBoundingBox,omitempty"` + MinimumAroundRadius *int32 `json:"minimumAroundRadius,omitempty"` + InsideBoundingBox utils.Nullable[InsideBoundingBox] `json:"insideBoundingBox,omitempty"` // 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`. InsidePolygon [][]float64 `json:"insidePolygon,omitempty"` // ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. @@ -114,9 +115,8 @@ type SearchParamsObject struct { Mode *Mode `json:"mode,omitempty"` SemanticSearch *SemanticSearch `json:"semanticSearch,omitempty"` // Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` - // 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). - OptionalWords []string `json:"optionalWords,omitempty"` + AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` + OptionalWords utils.Nullable[OptionalWords] `json:"optionalWords,omitempty"` // 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. DisableExactOnAttributes []string `json:"disableExactOnAttributes,omitempty"` ExactOnSingleWordQuery *ExactOnSingleWordQuery `json:"exactOnSingleWordQuery,omitempty"` @@ -131,8 +131,6 @@ type SearchParamsObject struct { MinProximity *int32 `json:"minProximity,omitempty"` // Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. ResponseFields []string `json:"responseFields,omitempty"` - // 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). - MaxFacetHits *int32 `json:"maxFacetHits,omitempty"` // Maximum number of facet values to return for each facet. MaxValuesPerFacet *int32 `json:"maxValuesPerFacet,omitempty"` // Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). @@ -261,7 +259,7 @@ func WithSearchParamsObjectMinimumAroundRadius(val int32) SearchParamsObjectOpti } } -func WithSearchParamsObjectInsideBoundingBox(val [][]float64) SearchParamsObjectOption { +func WithSearchParamsObjectInsideBoundingBox(val utils.Nullable[InsideBoundingBox]) SearchParamsObjectOption { return func(f *SearchParamsObject) { f.InsideBoundingBox = val } @@ -507,7 +505,7 @@ func WithSearchParamsObjectAdvancedSyntax(val bool) SearchParamsObjectOption { } } -func WithSearchParamsObjectOptionalWords(val []string) SearchParamsObjectOption { +func WithSearchParamsObjectOptionalWords(val utils.Nullable[OptionalWords]) SearchParamsObjectOption { return func(f *SearchParamsObject) { f.OptionalWords = val } @@ -561,12 +559,6 @@ func WithSearchParamsObjectResponseFields(val []string) SearchParamsObjectOption } } -func WithSearchParamsObjectMaxFacetHits(val int32) SearchParamsObjectOption { - return func(f *SearchParamsObject) { - f.MaxFacetHits = &val - } -} - func WithSearchParamsObjectMaxValuesPerFacet(val int32) SearchParamsObjectOption { return func(f *SearchParamsObject) { f.MaxValuesPerFacet = &val @@ -1247,39 +1239,50 @@ func (o *SearchParamsObject) SetMinimumAroundRadius(v int32) *SearchParamsObject return o } -// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise. -func (o *SearchParamsObject) GetInsideBoundingBox() [][]float64 { - if o == nil || o.InsideBoundingBox == nil { - var ret [][]float64 +// GetInsideBoundingBox returns the InsideBoundingBox field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SearchParamsObject) GetInsideBoundingBox() InsideBoundingBox { + if o == nil || o.InsideBoundingBox.Get() == nil { + var ret InsideBoundingBox return ret } - return o.InsideBoundingBox + return *o.InsideBoundingBox.Get() } // GetInsideBoundingBoxOk returns a tuple with the InsideBoundingBox field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SearchParamsObject) GetInsideBoundingBoxOk() ([][]float64, bool) { - if o == nil || o.InsideBoundingBox == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *SearchParamsObject) GetInsideBoundingBoxOk() (*InsideBoundingBox, bool) { + if o == nil { return nil, false } - return o.InsideBoundingBox, true + return o.InsideBoundingBox.Get(), o.InsideBoundingBox.IsSet() } // HasInsideBoundingBox returns a boolean if a field has been set. func (o *SearchParamsObject) HasInsideBoundingBox() bool { - if o != nil && o.InsideBoundingBox != nil { + if o != nil && o.InsideBoundingBox.IsSet() { return true } return false } -// SetInsideBoundingBox gets a reference to the given [][]float64 and assigns it to the InsideBoundingBox field. -func (o *SearchParamsObject) SetInsideBoundingBox(v [][]float64) *SearchParamsObject { - o.InsideBoundingBox = v +// SetInsideBoundingBox gets a reference to the given utils.Nullable[InsideBoundingBox] and assigns it to the InsideBoundingBox field. +func (o *SearchParamsObject) SetInsideBoundingBox(v *InsideBoundingBox) *SearchParamsObject { + o.InsideBoundingBox.Set(v) return o } +// SetInsideBoundingBoxNil sets the value for InsideBoundingBox to be an explicit nil. +func (o *SearchParamsObject) SetInsideBoundingBoxNil() { + o.InsideBoundingBox.Set(nil) +} + +// UnsetInsideBoundingBox ensures that no value is present for InsideBoundingBox, not even an explicit nil. +func (o *SearchParamsObject) UnsetInsideBoundingBox() { + o.InsideBoundingBox.Unset() +} + // GetInsidePolygon returns the InsidePolygon field value if set, zero value otherwise. func (o *SearchParamsObject) GetInsidePolygon() [][]float64 { if o == nil || o.InsidePolygon == nil { @@ -2600,39 +2603,50 @@ func (o *SearchParamsObject) SetAdvancedSyntax(v bool) *SearchParamsObject { return o } -// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise. -func (o *SearchParamsObject) GetOptionalWords() []string { - if o == nil || o.OptionalWords == nil { - var ret []string +// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SearchParamsObject) GetOptionalWords() OptionalWords { + if o == nil || o.OptionalWords.Get() == nil { + var ret OptionalWords return ret } - return o.OptionalWords + return *o.OptionalWords.Get() } // GetOptionalWordsOk returns a tuple with the OptionalWords field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SearchParamsObject) GetOptionalWordsOk() ([]string, bool) { - if o == nil || o.OptionalWords == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *SearchParamsObject) GetOptionalWordsOk() (*OptionalWords, bool) { + if o == nil { return nil, false } - return o.OptionalWords, true + return o.OptionalWords.Get(), o.OptionalWords.IsSet() } // HasOptionalWords returns a boolean if a field has been set. func (o *SearchParamsObject) HasOptionalWords() bool { - if o != nil && o.OptionalWords != nil { + if o != nil && o.OptionalWords.IsSet() { return true } return false } -// SetOptionalWords gets a reference to the given []string and assigns it to the OptionalWords field. -func (o *SearchParamsObject) SetOptionalWords(v []string) *SearchParamsObject { - o.OptionalWords = v +// SetOptionalWords gets a reference to the given utils.Nullable[OptionalWords] and assigns it to the OptionalWords field. +func (o *SearchParamsObject) SetOptionalWords(v *OptionalWords) *SearchParamsObject { + o.OptionalWords.Set(v) return o } +// SetOptionalWordsNil sets the value for OptionalWords to be an explicit nil. +func (o *SearchParamsObject) SetOptionalWordsNil() { + o.OptionalWords.Set(nil) +} + +// UnsetOptionalWords ensures that no value is present for OptionalWords, not even an explicit nil. +func (o *SearchParamsObject) UnsetOptionalWords() { + o.OptionalWords.Unset() +} + // GetDisableExactOnAttributes returns the DisableExactOnAttributes field value if set, zero value otherwise. func (o *SearchParamsObject) GetDisableExactOnAttributes() []string { if o == nil || o.DisableExactOnAttributes == nil { @@ -2897,39 +2911,6 @@ func (o *SearchParamsObject) SetResponseFields(v []string) *SearchParamsObject { return o } -// GetMaxFacetHits returns the MaxFacetHits field value if set, zero value otherwise. -func (o *SearchParamsObject) GetMaxFacetHits() int32 { - if o == nil || o.MaxFacetHits == nil { - var ret int32 - return ret - } - return *o.MaxFacetHits -} - -// GetMaxFacetHitsOk returns a tuple with the MaxFacetHits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SearchParamsObject) GetMaxFacetHitsOk() (*int32, bool) { - if o == nil || o.MaxFacetHits == nil { - return nil, false - } - return o.MaxFacetHits, true -} - -// HasMaxFacetHits returns a boolean if a field has been set. -func (o *SearchParamsObject) HasMaxFacetHits() bool { - if o != nil && o.MaxFacetHits != nil { - return true - } - - return false -} - -// SetMaxFacetHits gets a reference to the given int32 and assigns it to the MaxFacetHits field. -func (o *SearchParamsObject) SetMaxFacetHits(v int32) *SearchParamsObject { - o.MaxFacetHits = &v - return o -} - // GetMaxValuesPerFacet returns the MaxValuesPerFacet field value if set, zero value otherwise. func (o *SearchParamsObject) GetMaxValuesPerFacet() int32 { if o == nil || o.MaxValuesPerFacet == nil { @@ -3187,8 +3168,8 @@ func (o SearchParamsObject) MarshalJSON() ([]byte, error) { if o.MinimumAroundRadius != nil { toSerialize["minimumAroundRadius"] = o.MinimumAroundRadius } - if o.InsideBoundingBox != nil { - toSerialize["insideBoundingBox"] = o.InsideBoundingBox + if o.InsideBoundingBox.IsSet() { + toSerialize["insideBoundingBox"] = o.InsideBoundingBox.Get() } if o.InsidePolygon != nil { toSerialize["insidePolygon"] = o.InsidePolygon @@ -3310,8 +3291,8 @@ func (o SearchParamsObject) MarshalJSON() ([]byte, error) { if o.AdvancedSyntax != nil { toSerialize["advancedSyntax"] = o.AdvancedSyntax } - if o.OptionalWords != nil { - toSerialize["optionalWords"] = o.OptionalWords + if o.OptionalWords.IsSet() { + toSerialize["optionalWords"] = o.OptionalWords.Get() } if o.DisableExactOnAttributes != nil { toSerialize["disableExactOnAttributes"] = o.DisableExactOnAttributes @@ -3337,9 +3318,6 @@ func (o SearchParamsObject) MarshalJSON() ([]byte, error) { if o.ResponseFields != nil { toSerialize["responseFields"] = o.ResponseFields } - if o.MaxFacetHits != nil { - toSerialize["maxFacetHits"] = o.MaxFacetHits - } if o.MaxValuesPerFacet != nil { toSerialize["maxValuesPerFacet"] = o.MaxValuesPerFacet } @@ -3437,7 +3415,6 @@ func (o SearchParamsObject) String() string { out += fmt.Sprintf(" replaceSynonymsInHighlight=%v\n", o.ReplaceSynonymsInHighlight) out += fmt.Sprintf(" minProximity=%v\n", o.MinProximity) out += fmt.Sprintf(" responseFields=%v\n", o.ResponseFields) - out += fmt.Sprintf(" maxFacetHits=%v\n", o.MaxFacetHits) out += fmt.Sprintf(" maxValuesPerFacet=%v\n", o.MaxValuesPerFacet) out += fmt.Sprintf(" sortFacetValuesBy=%v\n", o.SortFacetValuesBy) out += fmt.Sprintf(" attributeCriteriaComputedByMinProximity=%v\n", o.AttributeCriteriaComputedByMinProximity) diff --git a/clients/algoliasearch-client-go/algolia/search/model_settings_response.go b/clients/algoliasearch-client-go/algolia/search/model_settings_response.go index f3bad46cf5..483f1e8c3b 100644 --- a/clients/algoliasearch-client-go/algolia/search/model_settings_response.go +++ b/clients/algoliasearch-client-go/algolia/search/model_settings_response.go @@ -4,6 +4,8 @@ package search import ( "encoding/json" "fmt" + + "github.com/algolia/algoliasearch-client-go/v4/algolia/utils" ) // SettingsResponse struct for SettingsResponse. @@ -42,6 +44,8 @@ type SettingsResponse struct { CustomNormalization *map[string]map[string]string `json:"customNormalization,omitempty"` // Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. AttributeForDistinct *string `json:"attributeForDistinct,omitempty"` + // 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). + MaxFacetHits *int32 `json:"maxFacetHits,omitempty"` // 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. AttributesToRetrieve []string `json:"attributesToRetrieve,omitempty"` // Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/). @@ -90,9 +94,8 @@ type SettingsResponse struct { Mode *Mode `json:"mode,omitempty"` SemanticSearch *SemanticSearch `json:"semanticSearch,omitempty"` // Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` - // 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). - OptionalWords []string `json:"optionalWords,omitempty"` + AdvancedSyntax *bool `json:"advancedSyntax,omitempty"` + OptionalWords utils.Nullable[OptionalWords] `json:"optionalWords,omitempty"` // 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. DisableExactOnAttributes []string `json:"disableExactOnAttributes,omitempty"` ExactOnSingleWordQuery *ExactOnSingleWordQuery `json:"exactOnSingleWordQuery,omitempty"` @@ -107,8 +110,6 @@ type SettingsResponse struct { MinProximity *int32 `json:"minProximity,omitempty"` // Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. ResponseFields []string `json:"responseFields,omitempty"` - // 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). - MaxFacetHits *int32 `json:"maxFacetHits,omitempty"` // Maximum number of facet values to return for each facet. MaxValuesPerFacet *int32 `json:"maxValuesPerFacet,omitempty"` // Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). @@ -227,6 +228,12 @@ func WithSettingsResponseAttributeForDistinct(val string) SettingsResponseOption } } +func WithSettingsResponseMaxFacetHits(val int32) SettingsResponseOption { + return func(f *SettingsResponse) { + f.MaxFacetHits = &val + } +} + func WithSettingsResponseAttributesToRetrieve(val []string) SettingsResponseOption { return func(f *SettingsResponse) { f.AttributesToRetrieve = val @@ -395,7 +402,7 @@ func WithSettingsResponseAdvancedSyntax(val bool) SettingsResponseOption { } } -func WithSettingsResponseOptionalWords(val []string) SettingsResponseOption { +func WithSettingsResponseOptionalWords(val utils.Nullable[OptionalWords]) SettingsResponseOption { return func(f *SettingsResponse) { f.OptionalWords = val } @@ -449,12 +456,6 @@ func WithSettingsResponseResponseFields(val []string) SettingsResponseOption { } } -func WithSettingsResponseMaxFacetHits(val int32) SettingsResponseOption { - return func(f *SettingsResponse) { - f.MaxFacetHits = &val - } -} - func WithSettingsResponseMaxValuesPerFacet(val int32) SettingsResponseOption { return func(f *SettingsResponse) { f.MaxValuesPerFacet = &val @@ -1075,6 +1076,39 @@ func (o *SettingsResponse) SetAttributeForDistinct(v string) *SettingsResponse { return o } +// GetMaxFacetHits returns the MaxFacetHits field value if set, zero value otherwise. +func (o *SettingsResponse) GetMaxFacetHits() int32 { + if o == nil || o.MaxFacetHits == nil { + var ret int32 + return ret + } + return *o.MaxFacetHits +} + +// GetMaxFacetHitsOk returns a tuple with the MaxFacetHits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SettingsResponse) GetMaxFacetHitsOk() (*int32, bool) { + if o == nil || o.MaxFacetHits == nil { + return nil, false + } + return o.MaxFacetHits, true +} + +// HasMaxFacetHits returns a boolean if a field has been set. +func (o *SettingsResponse) HasMaxFacetHits() bool { + if o != nil && o.MaxFacetHits != nil { + return true + } + + return false +} + +// SetMaxFacetHits gets a reference to the given int32 and assigns it to the MaxFacetHits field. +func (o *SettingsResponse) SetMaxFacetHits(v int32) *SettingsResponse { + o.MaxFacetHits = &v + return o +} + // GetAttributesToRetrieve returns the AttributesToRetrieve field value if set, zero value otherwise. func (o *SettingsResponse) GetAttributesToRetrieve() []string { if o == nil || o.AttributesToRetrieve == nil { @@ -1999,39 +2033,50 @@ func (o *SettingsResponse) SetAdvancedSyntax(v bool) *SettingsResponse { return o } -// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise. -func (o *SettingsResponse) GetOptionalWords() []string { - if o == nil || o.OptionalWords == nil { - var ret []string +// GetOptionalWords returns the OptionalWords field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SettingsResponse) GetOptionalWords() OptionalWords { + if o == nil || o.OptionalWords.Get() == nil { + var ret OptionalWords return ret } - return o.OptionalWords + return *o.OptionalWords.Get() } // GetOptionalWordsOk returns a tuple with the OptionalWords field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SettingsResponse) GetOptionalWordsOk() ([]string, bool) { - if o == nil || o.OptionalWords == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *SettingsResponse) GetOptionalWordsOk() (*OptionalWords, bool) { + if o == nil { return nil, false } - return o.OptionalWords, true + return o.OptionalWords.Get(), o.OptionalWords.IsSet() } // HasOptionalWords returns a boolean if a field has been set. func (o *SettingsResponse) HasOptionalWords() bool { - if o != nil && o.OptionalWords != nil { + if o != nil && o.OptionalWords.IsSet() { return true } return false } -// SetOptionalWords gets a reference to the given []string and assigns it to the OptionalWords field. -func (o *SettingsResponse) SetOptionalWords(v []string) *SettingsResponse { - o.OptionalWords = v +// SetOptionalWords gets a reference to the given utils.Nullable[OptionalWords] and assigns it to the OptionalWords field. +func (o *SettingsResponse) SetOptionalWords(v *OptionalWords) *SettingsResponse { + o.OptionalWords.Set(v) return o } +// SetOptionalWordsNil sets the value for OptionalWords to be an explicit nil. +func (o *SettingsResponse) SetOptionalWordsNil() { + o.OptionalWords.Set(nil) +} + +// UnsetOptionalWords ensures that no value is present for OptionalWords, not even an explicit nil. +func (o *SettingsResponse) UnsetOptionalWords() { + o.OptionalWords.Unset() +} + // GetDisableExactOnAttributes returns the DisableExactOnAttributes field value if set, zero value otherwise. func (o *SettingsResponse) GetDisableExactOnAttributes() []string { if o == nil || o.DisableExactOnAttributes == nil { @@ -2296,39 +2341,6 @@ func (o *SettingsResponse) SetResponseFields(v []string) *SettingsResponse { return o } -// GetMaxFacetHits returns the MaxFacetHits field value if set, zero value otherwise. -func (o *SettingsResponse) GetMaxFacetHits() int32 { - if o == nil || o.MaxFacetHits == nil { - var ret int32 - return ret - } - return *o.MaxFacetHits -} - -// GetMaxFacetHitsOk returns a tuple with the MaxFacetHits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SettingsResponse) GetMaxFacetHitsOk() (*int32, bool) { - if o == nil || o.MaxFacetHits == nil { - return nil, false - } - return o.MaxFacetHits, true -} - -// HasMaxFacetHits returns a boolean if a field has been set. -func (o *SettingsResponse) HasMaxFacetHits() bool { - if o != nil && o.MaxFacetHits != nil { - return true - } - - return false -} - -// SetMaxFacetHits gets a reference to the given int32 and assigns it to the MaxFacetHits field. -func (o *SettingsResponse) SetMaxFacetHits(v int32) *SettingsResponse { - o.MaxFacetHits = &v - return o -} - // GetMaxValuesPerFacet returns the MaxValuesPerFacet field value if set, zero value otherwise. func (o *SettingsResponse) GetMaxValuesPerFacet() int32 { if o == nil || o.MaxValuesPerFacet == nil { @@ -2613,6 +2625,9 @@ func (o SettingsResponse) MarshalJSON() ([]byte, error) { if o.AttributeForDistinct != nil { toSerialize["attributeForDistinct"] = o.AttributeForDistinct } + if o.MaxFacetHits != nil { + toSerialize["maxFacetHits"] = o.MaxFacetHits + } if o.AttributesToRetrieve != nil { toSerialize["attributesToRetrieve"] = o.AttributesToRetrieve } @@ -2697,8 +2712,8 @@ func (o SettingsResponse) MarshalJSON() ([]byte, error) { if o.AdvancedSyntax != nil { toSerialize["advancedSyntax"] = o.AdvancedSyntax } - if o.OptionalWords != nil { - toSerialize["optionalWords"] = o.OptionalWords + if o.OptionalWords.IsSet() { + toSerialize["optionalWords"] = o.OptionalWords.Get() } if o.DisableExactOnAttributes != nil { toSerialize["disableExactOnAttributes"] = o.DisableExactOnAttributes @@ -2724,9 +2739,6 @@ func (o SettingsResponse) MarshalJSON() ([]byte, error) { if o.ResponseFields != nil { toSerialize["responseFields"] = o.ResponseFields } - if o.MaxFacetHits != nil { - toSerialize["maxFacetHits"] = o.MaxFacetHits - } if o.MaxValuesPerFacet != nil { toSerialize["maxValuesPerFacet"] = o.MaxValuesPerFacet } @@ -2775,6 +2787,7 @@ func (o SettingsResponse) String() string { out += fmt.Sprintf(" userData=%v\n", o.UserData) out += fmt.Sprintf(" customNormalization=%v\n", o.CustomNormalization) out += fmt.Sprintf(" attributeForDistinct=%v\n", o.AttributeForDistinct) + out += fmt.Sprintf(" maxFacetHits=%v\n", o.MaxFacetHits) out += fmt.Sprintf(" attributesToRetrieve=%v\n", o.AttributesToRetrieve) out += fmt.Sprintf(" ranking=%v\n", o.Ranking) out += fmt.Sprintf(" customRanking=%v\n", o.CustomRanking) @@ -2812,7 +2825,6 @@ func (o SettingsResponse) String() string { out += fmt.Sprintf(" replaceSynonymsInHighlight=%v\n", o.ReplaceSynonymsInHighlight) out += fmt.Sprintf(" minProximity=%v\n", o.MinProximity) out += fmt.Sprintf(" responseFields=%v\n", o.ResponseFields) - out += fmt.Sprintf(" maxFacetHits=%v\n", o.MaxFacetHits) out += fmt.Sprintf(" maxValuesPerFacet=%v\n", o.MaxValuesPerFacet) out += fmt.Sprintf(" sortFacetValuesBy=%v\n", o.SortFacetValuesBy) out += fmt.Sprintf(" attributeCriteriaComputedByMinProximity=%v\n", o.AttributeCriteriaComputedByMinProximity) diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/FallbackParams.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/FallbackParams.java index 6bd33fe752..aeb54c6286 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/FallbackParams.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/FallbackParams.java @@ -60,7 +60,7 @@ public class FallbackParams { private Integer minimumAroundRadius; @JsonProperty("insideBoundingBox") - private List> insideBoundingBox; + private InsideBoundingBox insideBoundingBox; @JsonProperty("insidePolygon") private List> insidePolygon; @@ -152,6 +152,9 @@ public class FallbackParams { @JsonProperty("attributeForDistinct") private String attributeForDistinct; + @JsonProperty("maxFacetHits") + private Integer maxFacetHits; + @JsonProperty("attributesToRetrieve") private List attributesToRetrieve; @@ -222,7 +225,7 @@ public class FallbackParams { private Boolean advancedSyntax; @JsonProperty("optionalWords") - private List optionalWords; + private OptionalWords optionalWords; @JsonProperty("disableExactOnAttributes") private List disableExactOnAttributes; @@ -248,9 +251,6 @@ public class FallbackParams { @JsonProperty("responseFields") private List responseFields; - @JsonProperty("maxFacetHits") - private Integer maxFacetHits; - @JsonProperty("maxValuesPerFacet") private Integer maxValuesPerFacet; @@ -500,28 +500,14 @@ public Integer getMinimumAroundRadius() { return minimumAroundRadius; } - public FallbackParams setInsideBoundingBox(List> insideBoundingBox) { + public FallbackParams setInsideBoundingBox(InsideBoundingBox insideBoundingBox) { this.insideBoundingBox = insideBoundingBox; return this; } - public FallbackParams addInsideBoundingBox(List insideBoundingBoxItem) { - if (this.insideBoundingBox == null) { - this.insideBoundingBox = new ArrayList<>(); - } - this.insideBoundingBox.add(insideBoundingBoxItem); - return this; - } - - /** - * 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). - */ + /** Get insideBoundingBox */ @javax.annotation.Nullable - public List> getInsideBoundingBox() { + public InsideBoundingBox getInsideBoundingBox() { return insideBoundingBox; } @@ -1120,6 +1106,21 @@ public String getAttributeForDistinct() { return attributeForDistinct; } + public FallbackParams setMaxFacetHits(Integer maxFacetHits) { + this.maxFacetHits = maxFacetHits; + return this; + } + + /** + * 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 + */ + @javax.annotation.Nullable + public Integer getMaxFacetHits() { + return maxFacetHits; + } + public FallbackParams setAttributesToRetrieve(List attributesToRetrieve) { this.attributesToRetrieve = attributesToRetrieve; return this; @@ -1507,38 +1508,14 @@ public Boolean getAdvancedSyntax() { return advancedSyntax; } - public FallbackParams setOptionalWords(List optionalWords) { + public FallbackParams setOptionalWords(OptionalWords optionalWords) { this.optionalWords = optionalWords; return this; } - public FallbackParams addOptionalWords(String optionalWordsItem) { - if (this.optionalWords == null) { - this.optionalWords = new ArrayList<>(); - } - this.optionalWords.add(optionalWordsItem); - return this; - } - - /** - * 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). - */ + /** Get optionalWords */ @javax.annotation.Nullable - public List getOptionalWords() { + public OptionalWords getOptionalWords() { return optionalWords; } @@ -1705,21 +1682,6 @@ public List getResponseFields() { return responseFields; } - public FallbackParams setMaxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - return this; - } - - /** - * 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 - */ - @javax.annotation.Nullable - public Integer getMaxFacetHits() { - return maxFacetHits; - } - public FallbackParams setMaxValuesPerFacet(Integer maxValuesPerFacet) { this.maxValuesPerFacet = maxValuesPerFacet; return this; @@ -1858,6 +1820,7 @@ public boolean equals(Object o) { Objects.equals(this.userData, fallbackParams.userData) && Objects.equals(this.customNormalization, fallbackParams.customNormalization) && Objects.equals(this.attributeForDistinct, fallbackParams.attributeForDistinct) && + Objects.equals(this.maxFacetHits, fallbackParams.maxFacetHits) && Objects.equals(this.attributesToRetrieve, fallbackParams.attributesToRetrieve) && Objects.equals(this.ranking, fallbackParams.ranking) && Objects.equals(this.relevancyStrictness, fallbackParams.relevancyStrictness) && @@ -1890,7 +1853,6 @@ public boolean equals(Object o) { Objects.equals(this.replaceSynonymsInHighlight, fallbackParams.replaceSynonymsInHighlight) && Objects.equals(this.minProximity, fallbackParams.minProximity) && Objects.equals(this.responseFields, fallbackParams.responseFields) && - Objects.equals(this.maxFacetHits, fallbackParams.maxFacetHits) && Objects.equals(this.maxValuesPerFacet, fallbackParams.maxValuesPerFacet) && Objects.equals(this.sortFacetValuesBy, fallbackParams.sortFacetValuesBy) && Objects.equals(this.attributeCriteriaComputedByMinProximity, fallbackParams.attributeCriteriaComputedByMinProximity) && @@ -1949,6 +1911,7 @@ public int hashCode() { userData, customNormalization, attributeForDistinct, + maxFacetHits, attributesToRetrieve, ranking, relevancyStrictness, @@ -1981,7 +1944,6 @@ public int hashCode() { replaceSynonymsInHighlight, minProximity, responseFields, - maxFacetHits, maxValuesPerFacet, sortFacetValuesBy, attributeCriteriaComputedByMinProximity, @@ -2041,6 +2003,7 @@ public String toString() { sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); sb.append(" customNormalization: ").append(toIndentedString(customNormalization)).append("\n"); sb.append(" attributeForDistinct: ").append(toIndentedString(attributeForDistinct)).append("\n"); + sb.append(" maxFacetHits: ").append(toIndentedString(maxFacetHits)).append("\n"); sb.append(" attributesToRetrieve: ").append(toIndentedString(attributesToRetrieve)).append("\n"); sb.append(" ranking: ").append(toIndentedString(ranking)).append("\n"); sb.append(" relevancyStrictness: ").append(toIndentedString(relevancyStrictness)).append("\n"); @@ -2073,7 +2036,6 @@ public String toString() { sb.append(" replaceSynonymsInHighlight: ").append(toIndentedString(replaceSynonymsInHighlight)).append("\n"); sb.append(" minProximity: ").append(toIndentedString(minProximity)).append("\n"); sb.append(" responseFields: ").append(toIndentedString(responseFields)).append("\n"); - sb.append(" maxFacetHits: ").append(toIndentedString(maxFacetHits)).append("\n"); sb.append(" maxValuesPerFacet: ").append(toIndentedString(maxValuesPerFacet)).append("\n"); sb.append(" sortFacetValuesBy: ").append(toIndentedString(sortFacetValuesBy)).append("\n"); sb diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/InsideBoundingBox.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/InsideBoundingBox.java new file mode 100644 index 0000000000..3d24d8619b --- /dev/null +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/InsideBoundingBox.java @@ -0,0 +1,111 @@ +// 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. + +package com.algolia.model.recommend; + +import com.algolia.exceptions.AlgoliaRuntimeException; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.core.*; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.annotation.*; +import java.io.IOException; +import java.util.List; +import java.util.logging.Logger; + +/** InsideBoundingBox */ +@JsonDeserialize(using = InsideBoundingBox.Deserializer.class) +public interface InsideBoundingBox { + // InsideBoundingBox as String wrapper. + static InsideBoundingBox of(String value) { + return new StringWrapper(value); + } + + // InsideBoundingBox as List> wrapper. + static InsideBoundingBox of(List> value) { + return new ListOfListOfDoubleWrapper(value); + } + + // InsideBoundingBox as String wrapper. + @JsonSerialize(using = StringWrapper.Serializer.class) + class StringWrapper implements InsideBoundingBox { + + private final String value; + + StringWrapper(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + static class Serializer extends JsonSerializer { + + @Override + public void serialize(StringWrapper value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeObject(value.getValue()); + } + } + } + + // InsideBoundingBox as List> wrapper. + @JsonSerialize(using = ListOfListOfDoubleWrapper.Serializer.class) + class ListOfListOfDoubleWrapper implements InsideBoundingBox { + + private final List> value; + + ListOfListOfDoubleWrapper(List> value) { + this.value = value; + } + + public List> getValue() { + return value; + } + + static class Serializer extends JsonSerializer { + + @Override + public void serialize(ListOfListOfDoubleWrapper value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeObject(value.getValue()); + } + } + } + + class Deserializer extends JsonDeserializer { + + private static final Logger LOGGER = Logger.getLogger(Deserializer.class.getName()); + + @Override + public InsideBoundingBox deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { + JsonNode tree = jp.readValueAsTree(); + // deserialize String + if (tree.isTextual()) { + try (JsonParser parser = tree.traverse(jp.getCodec())) { + String value = parser.readValueAs(String.class); + return new InsideBoundingBox.StringWrapper(value); + } catch (Exception e) { + // deserialization failed, continue + LOGGER.finest("Failed to deserialize oneOf String (error: " + e.getMessage() + ") (type: String)"); + } + } + // deserialize List> + if (tree.isArray()) { + try (JsonParser parser = tree.traverse(jp.getCodec())) { + List> value = parser.readValueAs(new TypeReference>>() {}); + return new InsideBoundingBox.ListOfListOfDoubleWrapper(value); + } catch (Exception e) { + // deserialization failed, continue + LOGGER.finest("Failed to deserialize oneOf List> (error: " + e.getMessage() + ") (type: List>)"); + } + } + throw new AlgoliaRuntimeException(String.format("Failed to deserialize json element: %s", tree)); + } + + /** Handle deserialization of the 'null' value. */ + @Override + public InsideBoundingBox getNullValue(DeserializationContext ctxt) throws JsonMappingException { + return null; + } + } +} diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/OptionalWords.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/OptionalWords.java new file mode 100644 index 0000000000..67612bc7c3 --- /dev/null +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/OptionalWords.java @@ -0,0 +1,111 @@ +// 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. + +package com.algolia.model.recommend; + +import com.algolia.exceptions.AlgoliaRuntimeException; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.core.*; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.annotation.*; +import java.io.IOException; +import java.util.List; +import java.util.logging.Logger; + +/** OptionalWords */ +@JsonDeserialize(using = OptionalWords.Deserializer.class) +public interface OptionalWords { + // OptionalWords as String wrapper. + static OptionalWords of(String value) { + return new StringWrapper(value); + } + + // OptionalWords as List wrapper. + static OptionalWords of(List value) { + return new ListOfStringWrapper(value); + } + + // OptionalWords as String wrapper. + @JsonSerialize(using = StringWrapper.Serializer.class) + class StringWrapper implements OptionalWords { + + private final String value; + + StringWrapper(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + static class Serializer extends JsonSerializer { + + @Override + public void serialize(StringWrapper value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeObject(value.getValue()); + } + } + } + + // OptionalWords as List wrapper. + @JsonSerialize(using = ListOfStringWrapper.Serializer.class) + class ListOfStringWrapper implements OptionalWords { + + private final List value; + + ListOfStringWrapper(List value) { + this.value = value; + } + + public List getValue() { + return value; + } + + static class Serializer extends JsonSerializer { + + @Override + public void serialize(ListOfStringWrapper value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeObject(value.getValue()); + } + } + } + + class Deserializer extends JsonDeserializer { + + private static final Logger LOGGER = Logger.getLogger(Deserializer.class.getName()); + + @Override + public OptionalWords deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { + JsonNode tree = jp.readValueAsTree(); + // deserialize String + if (tree.isTextual()) { + try (JsonParser parser = tree.traverse(jp.getCodec())) { + String value = parser.readValueAs(String.class); + return new OptionalWords.StringWrapper(value); + } catch (Exception e) { + // deserialization failed, continue + LOGGER.finest("Failed to deserialize oneOf String (error: " + e.getMessage() + ") (type: String)"); + } + } + // deserialize List + if (tree.isArray()) { + try (JsonParser parser = tree.traverse(jp.getCodec())) { + List value = parser.readValueAs(new TypeReference>() {}); + return new OptionalWords.ListOfStringWrapper(value); + } catch (Exception e) { + // deserialization failed, continue + LOGGER.finest("Failed to deserialize oneOf List (error: " + e.getMessage() + ") (type: List)"); + } + } + throw new AlgoliaRuntimeException(String.format("Failed to deserialize json element: %s", tree)); + } + + /** Handle deserialization of the 'null' value. */ + @Override + public OptionalWords getNullValue(DeserializationContext ctxt) throws JsonMappingException { + return null; + } + } +} diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendSearchParams.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendSearchParams.java index d74beea49b..49e066f21e 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendSearchParams.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendSearchParams.java @@ -60,7 +60,7 @@ public class RecommendSearchParams { private Integer minimumAroundRadius; @JsonProperty("insideBoundingBox") - private List> insideBoundingBox; + private InsideBoundingBox insideBoundingBox; @JsonProperty("insidePolygon") private List> insidePolygon; @@ -152,6 +152,9 @@ public class RecommendSearchParams { @JsonProperty("attributeForDistinct") private String attributeForDistinct; + @JsonProperty("maxFacetHits") + private Integer maxFacetHits; + @JsonProperty("attributesToRetrieve") private List attributesToRetrieve; @@ -222,7 +225,7 @@ public class RecommendSearchParams { private Boolean advancedSyntax; @JsonProperty("optionalWords") - private List optionalWords; + private OptionalWords optionalWords; @JsonProperty("disableExactOnAttributes") private List disableExactOnAttributes; @@ -248,9 +251,6 @@ public class RecommendSearchParams { @JsonProperty("responseFields") private List responseFields; - @JsonProperty("maxFacetHits") - private Integer maxFacetHits; - @JsonProperty("maxValuesPerFacet") private Integer maxValuesPerFacet; @@ -500,28 +500,14 @@ public Integer getMinimumAroundRadius() { return minimumAroundRadius; } - public RecommendSearchParams setInsideBoundingBox(List> insideBoundingBox) { + public RecommendSearchParams setInsideBoundingBox(InsideBoundingBox insideBoundingBox) { this.insideBoundingBox = insideBoundingBox; return this; } - public RecommendSearchParams addInsideBoundingBox(List insideBoundingBoxItem) { - if (this.insideBoundingBox == null) { - this.insideBoundingBox = new ArrayList<>(); - } - this.insideBoundingBox.add(insideBoundingBoxItem); - return this; - } - - /** - * 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). - */ + /** Get insideBoundingBox */ @javax.annotation.Nullable - public List> getInsideBoundingBox() { + public InsideBoundingBox getInsideBoundingBox() { return insideBoundingBox; } @@ -1120,6 +1106,21 @@ public String getAttributeForDistinct() { return attributeForDistinct; } + public RecommendSearchParams setMaxFacetHits(Integer maxFacetHits) { + this.maxFacetHits = maxFacetHits; + return this; + } + + /** + * 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 + */ + @javax.annotation.Nullable + public Integer getMaxFacetHits() { + return maxFacetHits; + } + public RecommendSearchParams setAttributesToRetrieve(List attributesToRetrieve) { this.attributesToRetrieve = attributesToRetrieve; return this; @@ -1507,38 +1508,14 @@ public Boolean getAdvancedSyntax() { return advancedSyntax; } - public RecommendSearchParams setOptionalWords(List optionalWords) { + public RecommendSearchParams setOptionalWords(OptionalWords optionalWords) { this.optionalWords = optionalWords; return this; } - public RecommendSearchParams addOptionalWords(String optionalWordsItem) { - if (this.optionalWords == null) { - this.optionalWords = new ArrayList<>(); - } - this.optionalWords.add(optionalWordsItem); - return this; - } - - /** - * 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). - */ + /** Get optionalWords */ @javax.annotation.Nullable - public List getOptionalWords() { + public OptionalWords getOptionalWords() { return optionalWords; } @@ -1705,21 +1682,6 @@ public List getResponseFields() { return responseFields; } - public RecommendSearchParams setMaxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - return this; - } - - /** - * 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 - */ - @javax.annotation.Nullable - public Integer getMaxFacetHits() { - return maxFacetHits; - } - public RecommendSearchParams setMaxValuesPerFacet(Integer maxValuesPerFacet) { this.maxValuesPerFacet = maxValuesPerFacet; return this; @@ -1858,6 +1820,7 @@ public boolean equals(Object o) { Objects.equals(this.userData, recommendSearchParams.userData) && Objects.equals(this.customNormalization, recommendSearchParams.customNormalization) && Objects.equals(this.attributeForDistinct, recommendSearchParams.attributeForDistinct) && + Objects.equals(this.maxFacetHits, recommendSearchParams.maxFacetHits) && Objects.equals(this.attributesToRetrieve, recommendSearchParams.attributesToRetrieve) && Objects.equals(this.ranking, recommendSearchParams.ranking) && Objects.equals(this.relevancyStrictness, recommendSearchParams.relevancyStrictness) && @@ -1890,7 +1853,6 @@ public boolean equals(Object o) { Objects.equals(this.replaceSynonymsInHighlight, recommendSearchParams.replaceSynonymsInHighlight) && Objects.equals(this.minProximity, recommendSearchParams.minProximity) && Objects.equals(this.responseFields, recommendSearchParams.responseFields) && - Objects.equals(this.maxFacetHits, recommendSearchParams.maxFacetHits) && Objects.equals(this.maxValuesPerFacet, recommendSearchParams.maxValuesPerFacet) && Objects.equals(this.sortFacetValuesBy, recommendSearchParams.sortFacetValuesBy) && Objects.equals(this.attributeCriteriaComputedByMinProximity, recommendSearchParams.attributeCriteriaComputedByMinProximity) && @@ -1949,6 +1911,7 @@ public int hashCode() { userData, customNormalization, attributeForDistinct, + maxFacetHits, attributesToRetrieve, ranking, relevancyStrictness, @@ -1981,7 +1944,6 @@ public int hashCode() { replaceSynonymsInHighlight, minProximity, responseFields, - maxFacetHits, maxValuesPerFacet, sortFacetValuesBy, attributeCriteriaComputedByMinProximity, @@ -2041,6 +2003,7 @@ public String toString() { sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); sb.append(" customNormalization: ").append(toIndentedString(customNormalization)).append("\n"); sb.append(" attributeForDistinct: ").append(toIndentedString(attributeForDistinct)).append("\n"); + sb.append(" maxFacetHits: ").append(toIndentedString(maxFacetHits)).append("\n"); sb.append(" attributesToRetrieve: ").append(toIndentedString(attributesToRetrieve)).append("\n"); sb.append(" ranking: ").append(toIndentedString(ranking)).append("\n"); sb.append(" relevancyStrictness: ").append(toIndentedString(relevancyStrictness)).append("\n"); @@ -2073,7 +2036,6 @@ public String toString() { sb.append(" replaceSynonymsInHighlight: ").append(toIndentedString(replaceSynonymsInHighlight)).append("\n"); sb.append(" minProximity: ").append(toIndentedString(minProximity)).append("\n"); sb.append(" responseFields: ").append(toIndentedString(responseFields)).append("\n"); - sb.append(" maxFacetHits: ").append(toIndentedString(maxFacetHits)).append("\n"); sb.append(" maxValuesPerFacet: ").append(toIndentedString(maxValuesPerFacet)).append("\n"); sb.append(" sortFacetValuesBy: ").append(toIndentedString(sortFacetValuesBy)).append("\n"); sb diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/BrowseParamsObject.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/BrowseParamsObject.java index f63981fafc..064fb2b718 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/BrowseParamsObject.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/BrowseParamsObject.java @@ -71,7 +71,7 @@ public class BrowseParamsObject implements BrowseParams { private Integer minimumAroundRadius; @JsonProperty("insideBoundingBox") - private List> insideBoundingBox; + private InsideBoundingBox insideBoundingBox; @JsonProperty("insidePolygon") private List> insidePolygon; @@ -194,7 +194,7 @@ public class BrowseParamsObject implements BrowseParams { private Boolean advancedSyntax; @JsonProperty("optionalWords") - private List optionalWords; + private OptionalWords optionalWords; @JsonProperty("disableExactOnAttributes") private List disableExactOnAttributes; @@ -220,9 +220,6 @@ public class BrowseParamsObject implements BrowseParams { @JsonProperty("responseFields") private List responseFields; - @JsonProperty("maxFacetHits") - private Integer maxFacetHits; - @JsonProperty("maxValuesPerFacet") private Integer maxValuesPerFacet; @@ -519,28 +516,14 @@ public Integer getMinimumAroundRadius() { return minimumAroundRadius; } - public BrowseParamsObject setInsideBoundingBox(List> insideBoundingBox) { + public BrowseParamsObject setInsideBoundingBox(InsideBoundingBox insideBoundingBox) { this.insideBoundingBox = insideBoundingBox; return this; } - public BrowseParamsObject addInsideBoundingBox(List insideBoundingBoxItem) { - if (this.insideBoundingBox == null) { - this.insideBoundingBox = new ArrayList<>(); - } - this.insideBoundingBox.add(insideBoundingBoxItem); - return this; - } - - /** - * 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). - */ + /** Get insideBoundingBox */ @javax.annotation.Nullable - public List> getInsideBoundingBox() { + public InsideBoundingBox getInsideBoundingBox() { return insideBoundingBox; } @@ -1205,38 +1188,14 @@ public Boolean getAdvancedSyntax() { return advancedSyntax; } - public BrowseParamsObject setOptionalWords(List optionalWords) { + public BrowseParamsObject setOptionalWords(OptionalWords optionalWords) { this.optionalWords = optionalWords; return this; } - public BrowseParamsObject addOptionalWords(String optionalWordsItem) { - if (this.optionalWords == null) { - this.optionalWords = new ArrayList<>(); - } - this.optionalWords.add(optionalWordsItem); - return this; - } - - /** - * 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). - */ + /** Get optionalWords */ @javax.annotation.Nullable - public List getOptionalWords() { + public OptionalWords getOptionalWords() { return optionalWords; } @@ -1403,21 +1362,6 @@ public List getResponseFields() { return responseFields; } - public BrowseParamsObject setMaxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - return this; - } - - /** - * 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 - */ - @javax.annotation.Nullable - public Integer getMaxFacetHits() { - return maxFacetHits; - } - public BrowseParamsObject setMaxValuesPerFacet(Integer maxValuesPerFacet) { this.maxValuesPerFacet = maxValuesPerFacet; return this; @@ -1594,7 +1538,6 @@ public boolean equals(Object o) { Objects.equals(this.replaceSynonymsInHighlight, browseParamsObject.replaceSynonymsInHighlight) && Objects.equals(this.minProximity, browseParamsObject.minProximity) && Objects.equals(this.responseFields, browseParamsObject.responseFields) && - Objects.equals(this.maxFacetHits, browseParamsObject.maxFacetHits) && Objects.equals(this.maxValuesPerFacet, browseParamsObject.maxValuesPerFacet) && Objects.equals(this.sortFacetValuesBy, browseParamsObject.sortFacetValuesBy) && Objects.equals(this.attributeCriteriaComputedByMinProximity, browseParamsObject.attributeCriteriaComputedByMinProximity) && @@ -1677,7 +1620,6 @@ public int hashCode() { replaceSynonymsInHighlight, minProximity, responseFields, - maxFacetHits, maxValuesPerFacet, sortFacetValuesBy, attributeCriteriaComputedByMinProximity, @@ -1761,7 +1703,6 @@ public String toString() { sb.append(" replaceSynonymsInHighlight: ").append(toIndentedString(replaceSynonymsInHighlight)).append("\n"); sb.append(" minProximity: ").append(toIndentedString(minProximity)).append("\n"); sb.append(" responseFields: ").append(toIndentedString(responseFields)).append("\n"); - sb.append(" maxFacetHits: ").append(toIndentedString(maxFacetHits)).append("\n"); sb.append(" maxValuesPerFacet: ").append(toIndentedString(maxValuesPerFacet)).append("\n"); sb.append(" sortFacetValuesBy: ").append(toIndentedString(sortFacetValuesBy)).append("\n"); sb diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/ConsequenceParams.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/ConsequenceParams.java index 517c0e40fd..f0fa96ce59 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/ConsequenceParams.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/ConsequenceParams.java @@ -67,7 +67,7 @@ public class ConsequenceParams { private Integer minimumAroundRadius; @JsonProperty("insideBoundingBox") - private List> insideBoundingBox; + private InsideBoundingBox insideBoundingBox; @JsonProperty("insidePolygon") private List> insidePolygon; @@ -190,7 +190,7 @@ public class ConsequenceParams { private Boolean advancedSyntax; @JsonProperty("optionalWords") - private List optionalWords; + private OptionalWords optionalWords; @JsonProperty("disableExactOnAttributes") private List disableExactOnAttributes; @@ -216,9 +216,6 @@ public class ConsequenceParams { @JsonProperty("responseFields") private List responseFields; - @JsonProperty("maxFacetHits") - private Integer maxFacetHits; - @JsonProperty("maxValuesPerFacet") private Integer maxValuesPerFacet; @@ -510,28 +507,14 @@ public Integer getMinimumAroundRadius() { return minimumAroundRadius; } - public ConsequenceParams setInsideBoundingBox(List> insideBoundingBox) { + public ConsequenceParams setInsideBoundingBox(InsideBoundingBox insideBoundingBox) { this.insideBoundingBox = insideBoundingBox; return this; } - public ConsequenceParams addInsideBoundingBox(List insideBoundingBoxItem) { - if (this.insideBoundingBox == null) { - this.insideBoundingBox = new ArrayList<>(); - } - this.insideBoundingBox.add(insideBoundingBoxItem); - return this; - } - - /** - * 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). - */ + /** Get insideBoundingBox */ @javax.annotation.Nullable - public List> getInsideBoundingBox() { + public InsideBoundingBox getInsideBoundingBox() { return insideBoundingBox; } @@ -1196,38 +1179,14 @@ public Boolean getAdvancedSyntax() { return advancedSyntax; } - public ConsequenceParams setOptionalWords(List optionalWords) { + public ConsequenceParams setOptionalWords(OptionalWords optionalWords) { this.optionalWords = optionalWords; return this; } - public ConsequenceParams addOptionalWords(String optionalWordsItem) { - if (this.optionalWords == null) { - this.optionalWords = new ArrayList<>(); - } - this.optionalWords.add(optionalWordsItem); - return this; - } - - /** - * 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). - */ + /** Get optionalWords */ @javax.annotation.Nullable - public List getOptionalWords() { + public OptionalWords getOptionalWords() { return optionalWords; } @@ -1394,21 +1353,6 @@ public List getResponseFields() { return responseFields; } - public ConsequenceParams setMaxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - return this; - } - - /** - * 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 - */ - @javax.annotation.Nullable - public Integer getMaxFacetHits() { - return maxFacetHits; - } - public ConsequenceParams setMaxValuesPerFacet(Integer maxValuesPerFacet) { this.maxValuesPerFacet = maxValuesPerFacet; return this; @@ -1602,7 +1546,6 @@ public boolean equals(Object o) { Objects.equals(this.replaceSynonymsInHighlight, consequenceParams.replaceSynonymsInHighlight) && Objects.equals(this.minProximity, consequenceParams.minProximity) && Objects.equals(this.responseFields, consequenceParams.responseFields) && - Objects.equals(this.maxFacetHits, consequenceParams.maxFacetHits) && Objects.equals(this.maxValuesPerFacet, consequenceParams.maxValuesPerFacet) && Objects.equals(this.sortFacetValuesBy, consequenceParams.sortFacetValuesBy) && Objects.equals(this.attributeCriteriaComputedByMinProximity, consequenceParams.attributeCriteriaComputedByMinProximity) && @@ -1686,7 +1629,6 @@ public int hashCode() { replaceSynonymsInHighlight, minProximity, responseFields, - maxFacetHits, maxValuesPerFacet, sortFacetValuesBy, attributeCriteriaComputedByMinProximity, @@ -1771,7 +1713,6 @@ public String toString() { sb.append(" replaceSynonymsInHighlight: ").append(toIndentedString(replaceSynonymsInHighlight)).append("\n"); sb.append(" minProximity: ").append(toIndentedString(minProximity)).append("\n"); sb.append(" responseFields: ").append(toIndentedString(responseFields)).append("\n"); - sb.append(" maxFacetHits: ").append(toIndentedString(maxFacetHits)).append("\n"); sb.append(" maxValuesPerFacet: ").append(toIndentedString(maxValuesPerFacet)).append("\n"); sb.append(" sortFacetValuesBy: ").append(toIndentedString(sortFacetValuesBy)).append("\n"); sb diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/DeleteByParams.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/DeleteByParams.java index 8c2648e900..029e8e53ea 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/DeleteByParams.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/DeleteByParams.java @@ -31,7 +31,7 @@ public class DeleteByParams { private AroundRadius aroundRadius; @JsonProperty("insideBoundingBox") - private List> insideBoundingBox; + private InsideBoundingBox insideBoundingBox; @JsonProperty("insidePolygon") private List> insidePolygon; @@ -124,28 +124,14 @@ public AroundRadius getAroundRadius() { return aroundRadius; } - public DeleteByParams setInsideBoundingBox(List> insideBoundingBox) { + public DeleteByParams setInsideBoundingBox(InsideBoundingBox insideBoundingBox) { this.insideBoundingBox = insideBoundingBox; return this; } - public DeleteByParams addInsideBoundingBox(List insideBoundingBoxItem) { - if (this.insideBoundingBox == null) { - this.insideBoundingBox = new ArrayList<>(); - } - this.insideBoundingBox.add(insideBoundingBoxItem); - return this; - } - - /** - * 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). - */ + /** Get insideBoundingBox */ @javax.annotation.Nullable - public List> getInsideBoundingBox() { + public InsideBoundingBox getInsideBoundingBox() { return insideBoundingBox; } diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/IndexSettings.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/IndexSettings.java index 4974996b99..efc4f6ab12 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/IndexSettings.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/IndexSettings.java @@ -65,6 +65,9 @@ public class IndexSettings { @JsonProperty("attributeForDistinct") private String attributeForDistinct; + @JsonProperty("maxFacetHits") + private Integer maxFacetHits; + @JsonProperty("attributesToRetrieve") private List attributesToRetrieve; @@ -150,7 +153,7 @@ public class IndexSettings { private Boolean advancedSyntax; @JsonProperty("optionalWords") - private List optionalWords; + private OptionalWords optionalWords; @JsonProperty("disableExactOnAttributes") private List disableExactOnAttributes; @@ -176,9 +179,6 @@ public class IndexSettings { @JsonProperty("responseFields") private List responseFields; - @JsonProperty("maxFacetHits") - private Integer maxFacetHits; - @JsonProperty("maxValuesPerFacet") private Integer maxValuesPerFacet; @@ -585,6 +585,21 @@ public String getAttributeForDistinct() { return attributeForDistinct; } + public IndexSettings setMaxFacetHits(Integer maxFacetHits) { + this.maxFacetHits = maxFacetHits; + return this; + } + + /** + * 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 + */ + @javax.annotation.Nullable + public Integer getMaxFacetHits() { + return maxFacetHits; + } + public IndexSettings setAttributesToRetrieve(List attributesToRetrieve) { this.attributesToRetrieve = attributesToRetrieve; return this; @@ -1050,38 +1065,14 @@ public Boolean getAdvancedSyntax() { return advancedSyntax; } - public IndexSettings setOptionalWords(List optionalWords) { + public IndexSettings setOptionalWords(OptionalWords optionalWords) { this.optionalWords = optionalWords; return this; } - public IndexSettings addOptionalWords(String optionalWordsItem) { - if (this.optionalWords == null) { - this.optionalWords = new ArrayList<>(); - } - this.optionalWords.add(optionalWordsItem); - return this; - } - - /** - * 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). - */ + /** Get optionalWords */ @javax.annotation.Nullable - public List getOptionalWords() { + public OptionalWords getOptionalWords() { return optionalWords; } @@ -1248,21 +1239,6 @@ public List getResponseFields() { return responseFields; } - public IndexSettings setMaxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - return this; - } - - /** - * 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 - */ - @javax.annotation.Nullable - public Integer getMaxFacetHits() { - return maxFacetHits; - } - public IndexSettings setMaxValuesPerFacet(Integer maxValuesPerFacet) { this.maxValuesPerFacet = maxValuesPerFacet; return this; @@ -1372,6 +1348,7 @@ public boolean equals(Object o) { Objects.equals(this.userData, indexSettings.userData) && Objects.equals(this.customNormalization, indexSettings.customNormalization) && Objects.equals(this.attributeForDistinct, indexSettings.attributeForDistinct) && + Objects.equals(this.maxFacetHits, indexSettings.maxFacetHits) && Objects.equals(this.attributesToRetrieve, indexSettings.attributesToRetrieve) && Objects.equals(this.ranking, indexSettings.ranking) && Objects.equals(this.customRanking, indexSettings.customRanking) && @@ -1409,7 +1386,6 @@ public boolean equals(Object o) { Objects.equals(this.replaceSynonymsInHighlight, indexSettings.replaceSynonymsInHighlight) && Objects.equals(this.minProximity, indexSettings.minProximity) && Objects.equals(this.responseFields, indexSettings.responseFields) && - Objects.equals(this.maxFacetHits, indexSettings.maxFacetHits) && Objects.equals(this.maxValuesPerFacet, indexSettings.maxValuesPerFacet) && Objects.equals(this.sortFacetValuesBy, indexSettings.sortFacetValuesBy) && Objects.equals(this.attributeCriteriaComputedByMinProximity, indexSettings.attributeCriteriaComputedByMinProximity) && @@ -1439,6 +1415,7 @@ public int hashCode() { userData, customNormalization, attributeForDistinct, + maxFacetHits, attributesToRetrieve, ranking, customRanking, @@ -1476,7 +1453,6 @@ public int hashCode() { replaceSynonymsInHighlight, minProximity, responseFields, - maxFacetHits, maxValuesPerFacet, sortFacetValuesBy, attributeCriteriaComputedByMinProximity, @@ -1507,6 +1483,7 @@ public String toString() { sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); sb.append(" customNormalization: ").append(toIndentedString(customNormalization)).append("\n"); sb.append(" attributeForDistinct: ").append(toIndentedString(attributeForDistinct)).append("\n"); + sb.append(" maxFacetHits: ").append(toIndentedString(maxFacetHits)).append("\n"); sb.append(" attributesToRetrieve: ").append(toIndentedString(attributesToRetrieve)).append("\n"); sb.append(" ranking: ").append(toIndentedString(ranking)).append("\n"); sb.append(" customRanking: ").append(toIndentedString(customRanking)).append("\n"); @@ -1544,7 +1521,6 @@ public String toString() { sb.append(" replaceSynonymsInHighlight: ").append(toIndentedString(replaceSynonymsInHighlight)).append("\n"); sb.append(" minProximity: ").append(toIndentedString(minProximity)).append("\n"); sb.append(" responseFields: ").append(toIndentedString(responseFields)).append("\n"); - sb.append(" maxFacetHits: ").append(toIndentedString(maxFacetHits)).append("\n"); sb.append(" maxValuesPerFacet: ").append(toIndentedString(maxValuesPerFacet)).append("\n"); sb.append(" sortFacetValuesBy: ").append(toIndentedString(sortFacetValuesBy)).append("\n"); sb diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/InsideBoundingBox.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/InsideBoundingBox.java new file mode 100644 index 0000000000..bb0b74c553 --- /dev/null +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/InsideBoundingBox.java @@ -0,0 +1,111 @@ +// 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. + +package com.algolia.model.search; + +import com.algolia.exceptions.AlgoliaRuntimeException; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.core.*; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.annotation.*; +import java.io.IOException; +import java.util.List; +import java.util.logging.Logger; + +/** InsideBoundingBox */ +@JsonDeserialize(using = InsideBoundingBox.Deserializer.class) +public interface InsideBoundingBox { + // InsideBoundingBox as String wrapper. + static InsideBoundingBox of(String value) { + return new StringWrapper(value); + } + + // InsideBoundingBox as List> wrapper. + static InsideBoundingBox of(List> value) { + return new ListOfListOfDoubleWrapper(value); + } + + // InsideBoundingBox as String wrapper. + @JsonSerialize(using = StringWrapper.Serializer.class) + class StringWrapper implements InsideBoundingBox { + + private final String value; + + StringWrapper(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + static class Serializer extends JsonSerializer { + + @Override + public void serialize(StringWrapper value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeObject(value.getValue()); + } + } + } + + // InsideBoundingBox as List> wrapper. + @JsonSerialize(using = ListOfListOfDoubleWrapper.Serializer.class) + class ListOfListOfDoubleWrapper implements InsideBoundingBox { + + private final List> value; + + ListOfListOfDoubleWrapper(List> value) { + this.value = value; + } + + public List> getValue() { + return value; + } + + static class Serializer extends JsonSerializer { + + @Override + public void serialize(ListOfListOfDoubleWrapper value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeObject(value.getValue()); + } + } + } + + class Deserializer extends JsonDeserializer { + + private static final Logger LOGGER = Logger.getLogger(Deserializer.class.getName()); + + @Override + public InsideBoundingBox deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { + JsonNode tree = jp.readValueAsTree(); + // deserialize String + if (tree.isTextual()) { + try (JsonParser parser = tree.traverse(jp.getCodec())) { + String value = parser.readValueAs(String.class); + return new InsideBoundingBox.StringWrapper(value); + } catch (Exception e) { + // deserialization failed, continue + LOGGER.finest("Failed to deserialize oneOf String (error: " + e.getMessage() + ") (type: String)"); + } + } + // deserialize List> + if (tree.isArray()) { + try (JsonParser parser = tree.traverse(jp.getCodec())) { + List> value = parser.readValueAs(new TypeReference>>() {}); + return new InsideBoundingBox.ListOfListOfDoubleWrapper(value); + } catch (Exception e) { + // deserialization failed, continue + LOGGER.finest("Failed to deserialize oneOf List> (error: " + e.getMessage() + ") (type: List>)"); + } + } + throw new AlgoliaRuntimeException(String.format("Failed to deserialize json element: %s", tree)); + } + + /** Handle deserialization of the 'null' value. */ + @Override + public InsideBoundingBox getNullValue(DeserializationContext ctxt) throws JsonMappingException { + return null; + } + } +} diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/OptionalWords.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/OptionalWords.java new file mode 100644 index 0000000000..994a970228 --- /dev/null +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/OptionalWords.java @@ -0,0 +1,111 @@ +// 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. + +package com.algolia.model.search; + +import com.algolia.exceptions.AlgoliaRuntimeException; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.core.*; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.annotation.*; +import java.io.IOException; +import java.util.List; +import java.util.logging.Logger; + +/** OptionalWords */ +@JsonDeserialize(using = OptionalWords.Deserializer.class) +public interface OptionalWords { + // OptionalWords as String wrapper. + static OptionalWords of(String value) { + return new StringWrapper(value); + } + + // OptionalWords as List wrapper. + static OptionalWords of(List value) { + return new ListOfStringWrapper(value); + } + + // OptionalWords as String wrapper. + @JsonSerialize(using = StringWrapper.Serializer.class) + class StringWrapper implements OptionalWords { + + private final String value; + + StringWrapper(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + static class Serializer extends JsonSerializer { + + @Override + public void serialize(StringWrapper value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeObject(value.getValue()); + } + } + } + + // OptionalWords as List wrapper. + @JsonSerialize(using = ListOfStringWrapper.Serializer.class) + class ListOfStringWrapper implements OptionalWords { + + private final List value; + + ListOfStringWrapper(List value) { + this.value = value; + } + + public List getValue() { + return value; + } + + static class Serializer extends JsonSerializer { + + @Override + public void serialize(ListOfStringWrapper value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeObject(value.getValue()); + } + } + } + + class Deserializer extends JsonDeserializer { + + private static final Logger LOGGER = Logger.getLogger(Deserializer.class.getName()); + + @Override + public OptionalWords deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { + JsonNode tree = jp.readValueAsTree(); + // deserialize String + if (tree.isTextual()) { + try (JsonParser parser = tree.traverse(jp.getCodec())) { + String value = parser.readValueAs(String.class); + return new OptionalWords.StringWrapper(value); + } catch (Exception e) { + // deserialization failed, continue + LOGGER.finest("Failed to deserialize oneOf String (error: " + e.getMessage() + ") (type: String)"); + } + } + // deserialize List + if (tree.isArray()) { + try (JsonParser parser = tree.traverse(jp.getCodec())) { + List value = parser.readValueAs(new TypeReference>() {}); + return new OptionalWords.ListOfStringWrapper(value); + } catch (Exception e) { + // deserialization failed, continue + LOGGER.finest("Failed to deserialize oneOf List (error: " + e.getMessage() + ") (type: List)"); + } + } + throw new AlgoliaRuntimeException(String.format("Failed to deserialize json element: %s", tree)); + } + + /** Handle deserialization of the 'null' value. */ + @Override + public OptionalWords getNullValue(DeserializationContext ctxt) throws JsonMappingException { + return null; + } + } +} diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SearchForFacets.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SearchForFacets.java index 129e68a543..4dedde99c8 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SearchForFacets.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SearchForFacets.java @@ -74,7 +74,7 @@ public class SearchForFacets implements SearchQuery { private Integer minimumAroundRadius; @JsonProperty("insideBoundingBox") - private List> insideBoundingBox; + private InsideBoundingBox insideBoundingBox; @JsonProperty("insidePolygon") private List> insidePolygon; @@ -197,7 +197,7 @@ public class SearchForFacets implements SearchQuery { private Boolean advancedSyntax; @JsonProperty("optionalWords") - private List optionalWords; + private OptionalWords optionalWords; @JsonProperty("disableExactOnAttributes") private List disableExactOnAttributes; @@ -223,9 +223,6 @@ public class SearchForFacets implements SearchQuery { @JsonProperty("responseFields") private List responseFields; - @JsonProperty("maxFacetHits") - private Integer maxFacetHits; - @JsonProperty("maxValuesPerFacet") private Integer maxValuesPerFacet; @@ -253,6 +250,9 @@ public class SearchForFacets implements SearchQuery { @JsonProperty("facetQuery") private String facetQuery; + @JsonProperty("maxFacetHits") + private Integer maxFacetHits; + @JsonProperty("type") private SearchTypeFacet type; @@ -542,28 +542,14 @@ public Integer getMinimumAroundRadius() { return minimumAroundRadius; } - public SearchForFacets setInsideBoundingBox(List> insideBoundingBox) { + public SearchForFacets setInsideBoundingBox(InsideBoundingBox insideBoundingBox) { this.insideBoundingBox = insideBoundingBox; return this; } - public SearchForFacets addInsideBoundingBox(List insideBoundingBoxItem) { - if (this.insideBoundingBox == null) { - this.insideBoundingBox = new ArrayList<>(); - } - this.insideBoundingBox.add(insideBoundingBoxItem); - return this; - } - - /** - * 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). - */ + /** Get insideBoundingBox */ @javax.annotation.Nullable - public List> getInsideBoundingBox() { + public InsideBoundingBox getInsideBoundingBox() { return insideBoundingBox; } @@ -1228,38 +1214,14 @@ public Boolean getAdvancedSyntax() { return advancedSyntax; } - public SearchForFacets setOptionalWords(List optionalWords) { + public SearchForFacets setOptionalWords(OptionalWords optionalWords) { this.optionalWords = optionalWords; return this; } - public SearchForFacets addOptionalWords(String optionalWordsItem) { - if (this.optionalWords == null) { - this.optionalWords = new ArrayList<>(); - } - this.optionalWords.add(optionalWordsItem); - return this; - } - - /** - * 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). - */ + /** Get optionalWords */ @javax.annotation.Nullable - public List getOptionalWords() { + public OptionalWords getOptionalWords() { return optionalWords; } @@ -1426,21 +1388,6 @@ public List getResponseFields() { return responseFields; } - public SearchForFacets setMaxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - return this; - } - - /** - * 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 - */ - @javax.annotation.Nullable - public Integer getMaxFacetHits() { - return maxFacetHits; - } - public SearchForFacets setMaxValuesPerFacet(Integer maxValuesPerFacet) { this.maxValuesPerFacet = maxValuesPerFacet; return this; @@ -1556,6 +1503,21 @@ public String getFacetQuery() { return facetQuery; } + public SearchForFacets setMaxFacetHits(Integer maxFacetHits) { + this.maxFacetHits = maxFacetHits; + return this; + } + + /** + * 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 + */ + @javax.annotation.Nullable + public Integer getMaxFacetHits() { + return maxFacetHits; + } + public SearchForFacets setType(SearchTypeFacet type) { this.type = type; return this; @@ -1647,7 +1609,6 @@ public boolean equals(Object o) { Objects.equals(this.replaceSynonymsInHighlight, searchForFacets.replaceSynonymsInHighlight) && Objects.equals(this.minProximity, searchForFacets.minProximity) && Objects.equals(this.responseFields, searchForFacets.responseFields) && - Objects.equals(this.maxFacetHits, searchForFacets.maxFacetHits) && Objects.equals(this.maxValuesPerFacet, searchForFacets.maxValuesPerFacet) && Objects.equals(this.sortFacetValuesBy, searchForFacets.sortFacetValuesBy) && Objects.equals(this.attributeCriteriaComputedByMinProximity, searchForFacets.attributeCriteriaComputedByMinProximity) && @@ -1657,6 +1618,7 @@ public boolean equals(Object o) { Objects.equals(this.facet, searchForFacets.facet) && Objects.equals(this.indexName, searchForFacets.indexName) && Objects.equals(this.facetQuery, searchForFacets.facetQuery) && + Objects.equals(this.maxFacetHits, searchForFacets.maxFacetHits) && Objects.equals(this.type, searchForFacets.type) ); } @@ -1734,7 +1696,6 @@ public int hashCode() { replaceSynonymsInHighlight, minProximity, responseFields, - maxFacetHits, maxValuesPerFacet, sortFacetValuesBy, attributeCriteriaComputedByMinProximity, @@ -1744,6 +1705,7 @@ public int hashCode() { facet, indexName, facetQuery, + maxFacetHits, type ); } @@ -1822,7 +1784,6 @@ public String toString() { sb.append(" replaceSynonymsInHighlight: ").append(toIndentedString(replaceSynonymsInHighlight)).append("\n"); sb.append(" minProximity: ").append(toIndentedString(minProximity)).append("\n"); sb.append(" responseFields: ").append(toIndentedString(responseFields)).append("\n"); - sb.append(" maxFacetHits: ").append(toIndentedString(maxFacetHits)).append("\n"); sb.append(" maxValuesPerFacet: ").append(toIndentedString(maxValuesPerFacet)).append("\n"); sb.append(" sortFacetValuesBy: ").append(toIndentedString(sortFacetValuesBy)).append("\n"); sb @@ -1835,6 +1796,7 @@ public String toString() { sb.append(" facet: ").append(toIndentedString(facet)).append("\n"); sb.append(" indexName: ").append(toIndentedString(indexName)).append("\n"); sb.append(" facetQuery: ").append(toIndentedString(facetQuery)).append("\n"); + sb.append(" maxFacetHits: ").append(toIndentedString(maxFacetHits)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SearchForHits.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SearchForHits.java index 1cf2c190ec..b6267de8d8 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SearchForHits.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SearchForHits.java @@ -74,7 +74,7 @@ public class SearchForHits implements SearchQuery { private Integer minimumAroundRadius; @JsonProperty("insideBoundingBox") - private List> insideBoundingBox; + private InsideBoundingBox insideBoundingBox; @JsonProperty("insidePolygon") private List> insidePolygon; @@ -197,7 +197,7 @@ public class SearchForHits implements SearchQuery { private Boolean advancedSyntax; @JsonProperty("optionalWords") - private List optionalWords; + private OptionalWords optionalWords; @JsonProperty("disableExactOnAttributes") private List disableExactOnAttributes; @@ -223,9 +223,6 @@ public class SearchForHits implements SearchQuery { @JsonProperty("responseFields") private List responseFields; - @JsonProperty("maxFacetHits") - private Integer maxFacetHits; - @JsonProperty("maxValuesPerFacet") private Integer maxValuesPerFacet; @@ -536,28 +533,14 @@ public Integer getMinimumAroundRadius() { return minimumAroundRadius; } - public SearchForHits setInsideBoundingBox(List> insideBoundingBox) { + public SearchForHits setInsideBoundingBox(InsideBoundingBox insideBoundingBox) { this.insideBoundingBox = insideBoundingBox; return this; } - public SearchForHits addInsideBoundingBox(List insideBoundingBoxItem) { - if (this.insideBoundingBox == null) { - this.insideBoundingBox = new ArrayList<>(); - } - this.insideBoundingBox.add(insideBoundingBoxItem); - return this; - } - - /** - * 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). - */ + /** Get insideBoundingBox */ @javax.annotation.Nullable - public List> getInsideBoundingBox() { + public InsideBoundingBox getInsideBoundingBox() { return insideBoundingBox; } @@ -1222,38 +1205,14 @@ public Boolean getAdvancedSyntax() { return advancedSyntax; } - public SearchForHits setOptionalWords(List optionalWords) { + public SearchForHits setOptionalWords(OptionalWords optionalWords) { this.optionalWords = optionalWords; return this; } - public SearchForHits addOptionalWords(String optionalWordsItem) { - if (this.optionalWords == null) { - this.optionalWords = new ArrayList<>(); - } - this.optionalWords.add(optionalWordsItem); - return this; - } - - /** - * 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). - */ + /** Get optionalWords */ @javax.annotation.Nullable - public List getOptionalWords() { + public OptionalWords getOptionalWords() { return optionalWords; } @@ -1420,21 +1379,6 @@ public List getResponseFields() { return responseFields; } - public SearchForHits setMaxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - return this; - } - - /** - * 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 - */ - @javax.annotation.Nullable - public Integer getMaxFacetHits() { - return maxFacetHits; - } - public SearchForHits setMaxValuesPerFacet(Integer maxValuesPerFacet) { this.maxValuesPerFacet = maxValuesPerFacet; return this; @@ -1619,7 +1563,6 @@ public boolean equals(Object o) { Objects.equals(this.replaceSynonymsInHighlight, searchForHits.replaceSynonymsInHighlight) && Objects.equals(this.minProximity, searchForHits.minProximity) && Objects.equals(this.responseFields, searchForHits.responseFields) && - Objects.equals(this.maxFacetHits, searchForHits.maxFacetHits) && Objects.equals(this.maxValuesPerFacet, searchForHits.maxValuesPerFacet) && Objects.equals(this.sortFacetValuesBy, searchForHits.sortFacetValuesBy) && Objects.equals(this.attributeCriteriaComputedByMinProximity, searchForHits.attributeCriteriaComputedByMinProximity) && @@ -1704,7 +1647,6 @@ public int hashCode() { replaceSynonymsInHighlight, minProximity, responseFields, - maxFacetHits, maxValuesPerFacet, sortFacetValuesBy, attributeCriteriaComputedByMinProximity, @@ -1790,7 +1732,6 @@ public String toString() { sb.append(" replaceSynonymsInHighlight: ").append(toIndentedString(replaceSynonymsInHighlight)).append("\n"); sb.append(" minProximity: ").append(toIndentedString(minProximity)).append("\n"); sb.append(" responseFields: ").append(toIndentedString(responseFields)).append("\n"); - sb.append(" maxFacetHits: ").append(toIndentedString(maxFacetHits)).append("\n"); sb.append(" maxValuesPerFacet: ").append(toIndentedString(maxValuesPerFacet)).append("\n"); sb.append(" sortFacetValuesBy: ").append(toIndentedString(sortFacetValuesBy)).append("\n"); sb diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SearchParamsObject.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SearchParamsObject.java index 4cff07050d..be6c9e4963 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SearchParamsObject.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SearchParamsObject.java @@ -71,7 +71,7 @@ public class SearchParamsObject implements SearchParams { private Integer minimumAroundRadius; @JsonProperty("insideBoundingBox") - private List> insideBoundingBox; + private InsideBoundingBox insideBoundingBox; @JsonProperty("insidePolygon") private List> insidePolygon; @@ -194,7 +194,7 @@ public class SearchParamsObject implements SearchParams { private Boolean advancedSyntax; @JsonProperty("optionalWords") - private List optionalWords; + private OptionalWords optionalWords; @JsonProperty("disableExactOnAttributes") private List disableExactOnAttributes; @@ -220,9 +220,6 @@ public class SearchParamsObject implements SearchParams { @JsonProperty("responseFields") private List responseFields; - @JsonProperty("maxFacetHits") - private Integer maxFacetHits; - @JsonProperty("maxValuesPerFacet") private Integer maxValuesPerFacet; @@ -516,28 +513,14 @@ public Integer getMinimumAroundRadius() { return minimumAroundRadius; } - public SearchParamsObject setInsideBoundingBox(List> insideBoundingBox) { + public SearchParamsObject setInsideBoundingBox(InsideBoundingBox insideBoundingBox) { this.insideBoundingBox = insideBoundingBox; return this; } - public SearchParamsObject addInsideBoundingBox(List insideBoundingBoxItem) { - if (this.insideBoundingBox == null) { - this.insideBoundingBox = new ArrayList<>(); - } - this.insideBoundingBox.add(insideBoundingBoxItem); - return this; - } - - /** - * 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). - */ + /** Get insideBoundingBox */ @javax.annotation.Nullable - public List> getInsideBoundingBox() { + public InsideBoundingBox getInsideBoundingBox() { return insideBoundingBox; } @@ -1202,38 +1185,14 @@ public Boolean getAdvancedSyntax() { return advancedSyntax; } - public SearchParamsObject setOptionalWords(List optionalWords) { + public SearchParamsObject setOptionalWords(OptionalWords optionalWords) { this.optionalWords = optionalWords; return this; } - public SearchParamsObject addOptionalWords(String optionalWordsItem) { - if (this.optionalWords == null) { - this.optionalWords = new ArrayList<>(); - } - this.optionalWords.add(optionalWordsItem); - return this; - } - - /** - * 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). - */ + /** Get optionalWords */ @javax.annotation.Nullable - public List getOptionalWords() { + public OptionalWords getOptionalWords() { return optionalWords; } @@ -1400,21 +1359,6 @@ public List getResponseFields() { return responseFields; } - public SearchParamsObject setMaxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - return this; - } - - /** - * 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 - */ - @javax.annotation.Nullable - public Integer getMaxFacetHits() { - return maxFacetHits; - } - public SearchParamsObject setMaxValuesPerFacet(Integer maxValuesPerFacet) { this.maxValuesPerFacet = maxValuesPerFacet; return this; @@ -1576,7 +1520,6 @@ public boolean equals(Object o) { Objects.equals(this.replaceSynonymsInHighlight, searchParamsObject.replaceSynonymsInHighlight) && Objects.equals(this.minProximity, searchParamsObject.minProximity) && Objects.equals(this.responseFields, searchParamsObject.responseFields) && - Objects.equals(this.maxFacetHits, searchParamsObject.maxFacetHits) && Objects.equals(this.maxValuesPerFacet, searchParamsObject.maxValuesPerFacet) && Objects.equals(this.sortFacetValuesBy, searchParamsObject.sortFacetValuesBy) && Objects.equals(this.attributeCriteriaComputedByMinProximity, searchParamsObject.attributeCriteriaComputedByMinProximity) && @@ -1658,7 +1601,6 @@ public int hashCode() { replaceSynonymsInHighlight, minProximity, responseFields, - maxFacetHits, maxValuesPerFacet, sortFacetValuesBy, attributeCriteriaComputedByMinProximity, @@ -1741,7 +1683,6 @@ public String toString() { sb.append(" replaceSynonymsInHighlight: ").append(toIndentedString(replaceSynonymsInHighlight)).append("\n"); sb.append(" minProximity: ").append(toIndentedString(minProximity)).append("\n"); sb.append(" responseFields: ").append(toIndentedString(responseFields)).append("\n"); - sb.append(" maxFacetHits: ").append(toIndentedString(maxFacetHits)).append("\n"); sb.append(" maxValuesPerFacet: ").append(toIndentedString(maxValuesPerFacet)).append("\n"); sb.append(" sortFacetValuesBy: ").append(toIndentedString(sortFacetValuesBy)).append("\n"); sb diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SettingsResponse.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SettingsResponse.java index 54f7761ecc..afcc2cdbcc 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SettingsResponse.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/SettingsResponse.java @@ -65,6 +65,9 @@ public class SettingsResponse { @JsonProperty("attributeForDistinct") private String attributeForDistinct; + @JsonProperty("maxFacetHits") + private Integer maxFacetHits; + @JsonProperty("attributesToRetrieve") private List attributesToRetrieve; @@ -150,7 +153,7 @@ public class SettingsResponse { private Boolean advancedSyntax; @JsonProperty("optionalWords") - private List optionalWords; + private OptionalWords optionalWords; @JsonProperty("disableExactOnAttributes") private List disableExactOnAttributes; @@ -176,9 +179,6 @@ public class SettingsResponse { @JsonProperty("responseFields") private List responseFields; - @JsonProperty("maxFacetHits") - private Integer maxFacetHits; - @JsonProperty("maxValuesPerFacet") private Integer maxValuesPerFacet; @@ -588,6 +588,21 @@ public String getAttributeForDistinct() { return attributeForDistinct; } + public SettingsResponse setMaxFacetHits(Integer maxFacetHits) { + this.maxFacetHits = maxFacetHits; + return this; + } + + /** + * 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 + */ + @javax.annotation.Nullable + public Integer getMaxFacetHits() { + return maxFacetHits; + } + public SettingsResponse setAttributesToRetrieve(List attributesToRetrieve) { this.attributesToRetrieve = attributesToRetrieve; return this; @@ -1053,38 +1068,14 @@ public Boolean getAdvancedSyntax() { return advancedSyntax; } - public SettingsResponse setOptionalWords(List optionalWords) { + public SettingsResponse setOptionalWords(OptionalWords optionalWords) { this.optionalWords = optionalWords; return this; } - public SettingsResponse addOptionalWords(String optionalWordsItem) { - if (this.optionalWords == null) { - this.optionalWords = new ArrayList<>(); - } - this.optionalWords.add(optionalWordsItem); - return this; - } - - /** - * 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). - */ + /** Get optionalWords */ @javax.annotation.Nullable - public List getOptionalWords() { + public OptionalWords getOptionalWords() { return optionalWords; } @@ -1251,21 +1242,6 @@ public List getResponseFields() { return responseFields; } - public SettingsResponse setMaxFacetHits(Integer maxFacetHits) { - this.maxFacetHits = maxFacetHits; - return this; - } - - /** - * 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 - */ - @javax.annotation.Nullable - public Integer getMaxFacetHits() { - return maxFacetHits; - } - public SettingsResponse setMaxValuesPerFacet(Integer maxValuesPerFacet) { this.maxValuesPerFacet = maxValuesPerFacet; return this; @@ -1386,6 +1362,7 @@ public boolean equals(Object o) { Objects.equals(this.userData, settingsResponse.userData) && Objects.equals(this.customNormalization, settingsResponse.customNormalization) && Objects.equals(this.attributeForDistinct, settingsResponse.attributeForDistinct) && + Objects.equals(this.maxFacetHits, settingsResponse.maxFacetHits) && Objects.equals(this.attributesToRetrieve, settingsResponse.attributesToRetrieve) && Objects.equals(this.ranking, settingsResponse.ranking) && Objects.equals(this.customRanking, settingsResponse.customRanking) && @@ -1423,7 +1400,6 @@ public boolean equals(Object o) { Objects.equals(this.replaceSynonymsInHighlight, settingsResponse.replaceSynonymsInHighlight) && Objects.equals(this.minProximity, settingsResponse.minProximity) && Objects.equals(this.responseFields, settingsResponse.responseFields) && - Objects.equals(this.maxFacetHits, settingsResponse.maxFacetHits) && Objects.equals(this.maxValuesPerFacet, settingsResponse.maxValuesPerFacet) && Objects.equals(this.sortFacetValuesBy, settingsResponse.sortFacetValuesBy) && Objects.equals(this.attributeCriteriaComputedByMinProximity, settingsResponse.attributeCriteriaComputedByMinProximity) && @@ -1454,6 +1430,7 @@ public int hashCode() { userData, customNormalization, attributeForDistinct, + maxFacetHits, attributesToRetrieve, ranking, customRanking, @@ -1491,7 +1468,6 @@ public int hashCode() { replaceSynonymsInHighlight, minProximity, responseFields, - maxFacetHits, maxValuesPerFacet, sortFacetValuesBy, attributeCriteriaComputedByMinProximity, @@ -1523,6 +1499,7 @@ public String toString() { sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); sb.append(" customNormalization: ").append(toIndentedString(customNormalization)).append("\n"); sb.append(" attributeForDistinct: ").append(toIndentedString(attributeForDistinct)).append("\n"); + sb.append(" maxFacetHits: ").append(toIndentedString(maxFacetHits)).append("\n"); sb.append(" attributesToRetrieve: ").append(toIndentedString(attributesToRetrieve)).append("\n"); sb.append(" ranking: ").append(toIndentedString(ranking)).append("\n"); sb.append(" customRanking: ").append(toIndentedString(customRanking)).append("\n"); @@ -1560,7 +1537,6 @@ public String toString() { sb.append(" replaceSynonymsInHighlight: ").append(toIndentedString(replaceSynonymsInHighlight)).append("\n"); sb.append(" minProximity: ").append(toIndentedString(minProximity)).append("\n"); sb.append(" responseFields: ").append(toIndentedString(responseFields)).append("\n"); - sb.append(" maxFacetHits: ").append(toIndentedString(maxFacetHits)).append("\n"); sb.append(" maxValuesPerFacet: ").append(toIndentedString(maxValuesPerFacet)).append("\n"); sb.append(" sortFacetValuesBy: ").append(toIndentedString(sortFacetValuesBy)).append("\n"); sb diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/builds/models.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/builds/models.ts index bd92007780..f58ec0096e 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/builds/models.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/builds/models.ts @@ -46,8 +46,8 @@ import type { CustomGetProps, CustomPostProps, CustomPutProps, - DeleteSourceProps, DeletedAtResponse, + DeleteSourceProps, Distinct, Edit, EditType, @@ -56,19 +56,21 @@ import type { Exhaustive, FacetFilters, FacetOrdering, - FacetStats, Facets, + FacetStats, GetTaskProps, HighlightResult, HighlightResultOption, IgnorePlurals, IndexSettingsAsSearchParams, + InsideBoundingBox, Languages, - MatchLevel, MatchedGeoLocation, + MatchLevel, Mode, NumericFilters, OptionalFilters, + OptionalWords, Params, Personalization, Promote, @@ -77,7 +79,6 @@ import type { QueryType, Range, RankingInfo, - ReRankingApplyFilter, Redirect, RedirectRuleIndexData, RedirectRuleIndexMetadata, @@ -85,6 +86,7 @@ import type { RemoveStopWords, RemoveWordsIfNoResults, RenderingContent, + ReRankingApplyFilter, SearchPagination, SearchParams, SearchParamsObject, @@ -105,14 +107,24 @@ import type { } from '@algolia/client-search'; import { apiClientVersion } from '@algolia/client-search'; -type Region = +export * from '@algolia/client-abtesting'; +export * from '@algolia/client-analytics'; +export * from '@algolia/client-insights'; +export * from '@algolia/client-personalization'; +export * from '@algolia/client-query-suggestions'; +export * from '@algolia/client-search'; +export * from '@algolia/ingestion'; +export * from '@algolia/monitoring'; +export * from '@algolia/recommend'; + +export type Region = | AbtestingRegion | AnalyticsRegion | IngestionRegion | InsightsRegion | PersonalizationRegion | QuerySuggestionsRegion; -type RegionOptions = +export type RegionOptions = | AbtestingRegionOptions | AnalyticsRegionOptions | IngestionRegionOptions @@ -120,24 +132,27 @@ type RegionOptions = | PersonalizationRegionOptions | QuerySuggestionsRegionOptions; -export * from '@algolia/client-abtesting'; -export * from '@algolia/client-analytics'; -export * from '@algolia/client-insights'; -export * from '@algolia/client-personalization'; -export * from '@algolia/client-query-suggestions'; -export * from '@algolia/client-search'; -export * from '@algolia/ingestion'; -export * from '@algolia/monitoring'; -export * from '@algolia/recommend'; - export type { AbtestingRegion, AbtestingRegionOptions, + AnalyticsRegion, + AnalyticsRegionOptions, + EventType, + IngestionRegion, + IngestionRegionOptions, + InsightsRegion, + InsightsRegionOptions, + PersonalizationRegion, + PersonalizationRegionOptions, + QuerySuggestionsRegion, + QuerySuggestionsRegionOptions, + Status, +}; + +export type { Action, AdvancedSyntaxFeatures, AlternativesAsExact, - AnalyticsRegion, - AnalyticsRegionOptions, Anchoring, AroundPrecision, AroundRadius, @@ -163,56 +178,47 @@ export type { CustomGetProps, CustomPostProps, CustomPutProps, - DeleteSourceProps, DeletedAtResponse, + DeleteSourceProps, Distinct, Edit, EditType, ErrorBase, - EventType, ExactOnSingleWordQuery, Exhaustive, FacetFilters, FacetOrdering, - FacetStats, Facets, + FacetStats, GetTaskProps, HighlightResult, HighlightResultOption, IgnorePlurals, IndexSettingsAsSearchParams, - IngestionRegion, - IngestionRegionOptions, - InsightsRegion, - InsightsRegionOptions, + InsideBoundingBox, Languages, - MatchLevel, MatchedGeoLocation, + MatchLevel, Mode, NumericFilters, OptionalFilters, + OptionalWords, Params, Personalization, - PersonalizationRegion, - PersonalizationRegionOptions, Promote, PromoteObjectID, PromoteObjectIDs, - QuerySuggestionsRegion, - QuerySuggestionsRegionOptions, QueryType, Range, RankingInfo, - ReRankingApplyFilter, Redirect, RedirectRuleIndexData, RedirectRuleIndexMetadata, RedirectURL, - Region, - RegionOptions, RemoveStopWords, RemoveWordsIfNoResults, RenderingContent, + ReRankingApplyFilter, SearchPagination, SearchParams, SearchParamsObject, @@ -222,7 +228,6 @@ export type { SnippetResultOption, SortRemainingBy, Source, - Status, SupportedLanguage, TagFilters, TaskStatus, @@ -231,9 +236,10 @@ export type { TypoToleranceEnum, Value, Widgets, - apiClientVersion, }; +export { apiClientVersion }; + /** * Options forwarded to the client initialized via the `init` method. */ diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseIndexSettings.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseIndexSettings.ts index 51d450a358..3e69db00bd 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseIndexSettings.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseIndexSettings.ts @@ -87,4 +87,9 @@ export type BaseIndexSettings = { * Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. */ attributeForDistinct?: string; + + /** + * 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). + */ + maxFacetHits?: number; }; diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseRecommendIndexSettings.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseRecommendIndexSettings.ts index d6f5e5cee1..07a53745b8 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseRecommendIndexSettings.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseRecommendIndexSettings.ts @@ -5,6 +5,7 @@ import type { AlternativesAsExact } from './alternativesAsExact'; import type { Distinct } from './distinct'; import type { ExactOnSingleWordQuery } from './exactOnSingleWordQuery'; import type { IgnorePlurals } from './ignorePlurals'; +import type { OptionalWords } from './optionalWords'; import type { QueryType } from './queryType'; import type { ReRankingApplyFilter } from './reRankingApplyFilter'; import type { RemoveStopWords } from './removeStopWords'; @@ -114,10 +115,7 @@ export type BaseRecommendIndexSettings = { */ advancedSyntax?: boolean; - /** - * 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). - */ - optionalWords?: Array; + optionalWords?: OptionalWords | null; /** * 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. @@ -153,11 +151,6 @@ export type BaseRecommendIndexSettings = { */ responseFields?: Array; - /** - * 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). - */ - maxFacetHits?: number; - /** * Maximum number of facet values to return for each facet. */ diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseRecommendSearchParams.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseRecommendSearchParams.ts index 0c9814285c..bd10f6bac1 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseRecommendSearchParams.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseRecommendSearchParams.ts @@ -3,6 +3,7 @@ import type { AroundPrecision } from './aroundPrecision'; import type { AroundRadius } from './aroundRadius'; import type { FacetFilters } from './facetFilters'; +import type { InsideBoundingBox } from './insideBoundingBox'; import type { NumericFilters } from './numericFilters'; import type { OptionalFilters } from './optionalFilters'; import type { SupportedLanguage } from './supportedLanguage'; @@ -66,10 +67,7 @@ export type BaseRecommendSearchParams = { */ minimumAroundRadius?: number; - /** - * 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). - */ - insideBoundingBox?: Array>; + insideBoundingBox?: InsideBoundingBox | null; /** * 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`. diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseSearchParamsWithoutQuery.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseSearchParamsWithoutQuery.ts index 5771203010..69fcbe82af 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseSearchParamsWithoutQuery.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/baseSearchParamsWithoutQuery.ts @@ -3,6 +3,7 @@ import type { AroundPrecision } from './aroundPrecision'; import type { AroundRadius } from './aroundRadius'; import type { FacetFilters } from './facetFilters'; +import type { InsideBoundingBox } from './insideBoundingBox'; import type { NumericFilters } from './numericFilters'; import type { OptionalFilters } from './optionalFilters'; import type { SupportedLanguage } from './supportedLanguage'; @@ -81,10 +82,7 @@ export type BaseSearchParamsWithoutQuery = { */ minimumAroundRadius?: number; - /** - * 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). - */ - insideBoundingBox?: Array>; + insideBoundingBox?: InsideBoundingBox | null; /** * 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`. diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/index.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/index.ts index e67ddd63eb..f58133a792 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/index.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/index.ts @@ -54,6 +54,7 @@ export * from './ignorePlurals'; export * from './indexSettings'; export * from './indexSettingsAsSearchParams'; export * from './indexSettingsFacets'; +export * from './insideBoundingBox'; export * from './lookingSimilar'; export * from './lookingSimilarModel'; export * from './lookingSimilarQuery'; @@ -62,6 +63,7 @@ export * from './matchLevel'; export * from './mode'; export * from './numericFilters'; export * from './optionalFilters'; +export * from './optionalWords'; export * from './params'; export * from './personalization'; export * from './queryType'; diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/indexSettingsAsSearchParams.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/indexSettingsAsSearchParams.ts index 99d1ddd575..265011d891 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/indexSettingsAsSearchParams.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/indexSettingsAsSearchParams.ts @@ -6,6 +6,7 @@ import type { Distinct } from './distinct'; import type { ExactOnSingleWordQuery } from './exactOnSingleWordQuery'; import type { IgnorePlurals } from './ignorePlurals'; import type { Mode } from './mode'; +import type { OptionalWords } from './optionalWords'; import type { QueryType } from './queryType'; import type { ReRankingApplyFilter } from './reRankingApplyFilter'; import type { RemoveStopWords } from './removeStopWords'; @@ -135,10 +136,7 @@ export type IndexSettingsAsSearchParams = { */ advancedSyntax?: boolean; - /** - * 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). - */ - optionalWords?: Array; + optionalWords?: OptionalWords | null; /** * 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. @@ -174,11 +172,6 @@ export type IndexSettingsAsSearchParams = { */ responseFields?: Array; - /** - * 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). - */ - maxFacetHits?: number; - /** * Maximum number of facet values to return for each facet. */ diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/insideBoundingBox.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/insideBoundingBox.ts new file mode 100644 index 0000000000..8a498532f3 --- /dev/null +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/insideBoundingBox.ts @@ -0,0 +1,3 @@ +// 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. + +export type InsideBoundingBox = string | Array>; diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/optionalWords.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/optionalWords.ts new file mode 100644 index 0000000000..51d42589eb --- /dev/null +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/optionalWords.ts @@ -0,0 +1,3 @@ +// 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. + +export type OptionalWords = string | Array; diff --git a/clients/algoliasearch-client-javascript/packages/client-composition/model/index.ts b/clients/algoliasearch-client-javascript/packages/client-composition/model/index.ts index d04cde911f..f940740da6 100644 --- a/clients/algoliasearch-client-javascript/packages/client-composition/model/index.ts +++ b/clients/algoliasearch-client-javascript/packages/client-composition/model/index.ts @@ -48,6 +48,7 @@ export * from './hitRankingInfo'; export * from './ignorePlurals'; export * from './injection'; export * from './insetsQueryParameters'; +export * from './insideBoundingBox'; export * from './listCompositionsResponse'; export * from './main'; export * from './mainInjectionQueryParameters'; @@ -57,6 +58,7 @@ export * from './multipleBatchRequest'; export * from './multipleBatchResponse'; export * from './numericFilters'; export * from './optionalFilters'; +export * from './optionalWords'; export * from './params'; export * from './personalization'; export * from './queryType'; diff --git a/clients/algoliasearch-client-javascript/packages/client-composition/model/insetsQueryParameters.ts b/clients/algoliasearch-client-javascript/packages/client-composition/model/insetsQueryParameters.ts index 0e8de96661..80b98c6ef0 100644 --- a/clients/algoliasearch-client-javascript/packages/client-composition/model/insetsQueryParameters.ts +++ b/clients/algoliasearch-client-javascript/packages/client-composition/model/insetsQueryParameters.ts @@ -8,6 +8,7 @@ import type { FacetFilters } from './facetFilters'; import type { IgnorePlurals } from './ignorePlurals'; import type { NumericFilters } from './numericFilters'; import type { OptionalFilters } from './optionalFilters'; +import type { OptionalWords } from './optionalWords'; import type { QueryType } from './queryType'; import type { RemoveStopWords } from './removeStopWords'; import type { RemoveWordsIfNoResults } from './removeWordsIfNoResults'; @@ -136,10 +137,7 @@ export type InsetsQueryParameters = { */ advancedSyntax?: boolean; - /** - * 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). - */ - optionalWords?: Array; + optionalWords?: OptionalWords | null; /** * 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. diff --git a/clients/algoliasearch-client-javascript/packages/client-composition/model/insideBoundingBox.ts b/clients/algoliasearch-client-javascript/packages/client-composition/model/insideBoundingBox.ts new file mode 100644 index 0000000000..8a498532f3 --- /dev/null +++ b/clients/algoliasearch-client-javascript/packages/client-composition/model/insideBoundingBox.ts @@ -0,0 +1,3 @@ +// 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. + +export type InsideBoundingBox = string | Array>; diff --git a/clients/algoliasearch-client-javascript/packages/client-composition/model/optionalWords.ts b/clients/algoliasearch-client-javascript/packages/client-composition/model/optionalWords.ts new file mode 100644 index 0000000000..51d42589eb --- /dev/null +++ b/clients/algoliasearch-client-javascript/packages/client-composition/model/optionalWords.ts @@ -0,0 +1,3 @@ +// 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. + +export type OptionalWords = string | Array; diff --git a/clients/algoliasearch-client-javascript/packages/client-composition/model/params.ts b/clients/algoliasearch-client-javascript/packages/client-composition/model/params.ts index 3b75d5bd3b..013907f5cd 100644 --- a/clients/algoliasearch-client-javascript/packages/client-composition/model/params.ts +++ b/clients/algoliasearch-client-javascript/packages/client-composition/model/params.ts @@ -3,6 +3,7 @@ import type { AroundPrecision } from './aroundPrecision'; import type { AroundRadius } from './aroundRadius'; import type { FacetFilters } from './facetFilters'; +import type { InsideBoundingBox } from './insideBoundingBox'; import type { NumericFilters } from './numericFilters'; import type { OptionalFilters } from './optionalFilters'; import type { SupportedLanguage } from './supportedLanguage'; @@ -60,10 +61,7 @@ export type Params = { */ minimumAroundRadius?: number; - /** - * 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). - */ - insideBoundingBox?: Array>; + insideBoundingBox?: InsideBoundingBox | null; /** * 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`. diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/baseIndexSettings.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/baseIndexSettings.ts index 51d450a358..3e69db00bd 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/baseIndexSettings.ts +++ b/clients/algoliasearch-client-javascript/packages/client-search/model/baseIndexSettings.ts @@ -87,4 +87,9 @@ export type BaseIndexSettings = { * Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. */ attributeForDistinct?: string; + + /** + * 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). + */ + maxFacetHits?: number; }; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchParamsWithoutQuery.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchParamsWithoutQuery.ts index 5771203010..69fcbe82af 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchParamsWithoutQuery.ts +++ b/clients/algoliasearch-client-javascript/packages/client-search/model/baseSearchParamsWithoutQuery.ts @@ -3,6 +3,7 @@ import type { AroundPrecision } from './aroundPrecision'; import type { AroundRadius } from './aroundRadius'; import type { FacetFilters } from './facetFilters'; +import type { InsideBoundingBox } from './insideBoundingBox'; import type { NumericFilters } from './numericFilters'; import type { OptionalFilters } from './optionalFilters'; import type { SupportedLanguage } from './supportedLanguage'; @@ -81,10 +82,7 @@ export type BaseSearchParamsWithoutQuery = { */ minimumAroundRadius?: number; - /** - * 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). - */ - insideBoundingBox?: Array>; + insideBoundingBox?: InsideBoundingBox | null; /** * 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`. diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/deleteByParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/deleteByParams.ts index ad5fda3b7c..ac77bb7df4 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/deleteByParams.ts +++ b/clients/algoliasearch-client-javascript/packages/client-search/model/deleteByParams.ts @@ -2,6 +2,7 @@ import type { AroundRadius } from './aroundRadius'; import type { FacetFilters } from './facetFilters'; +import type { InsideBoundingBox } from './insideBoundingBox'; import type { NumericFilters } from './numericFilters'; import type { TagFilters } from './tagFilters'; @@ -24,10 +25,7 @@ export type DeleteByParams = { aroundRadius?: 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). - */ - insideBoundingBox?: Array>; + insideBoundingBox?: InsideBoundingBox | null; /** * 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`. diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/index.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/index.ts index 13e821cb3b..250bff4132 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/index.ts +++ b/clients/algoliasearch-client-javascript/packages/client-search/model/index.ts @@ -86,6 +86,7 @@ export * from './hit'; export * from './ignorePlurals'; export * from './indexSettings'; export * from './indexSettingsAsSearchParams'; +export * from './insideBoundingBox'; export * from './languages'; export * from './listApiKeysResponse'; export * from './listClustersResponse'; @@ -103,6 +104,7 @@ export * from './numericFilters'; export * from './operationIndexParams'; export * from './operationType'; export * from './optionalFilters'; +export * from './optionalWords'; export * from './params'; export * from './personalization'; export * from './promote'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/indexSettingsAsSearchParams.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/indexSettingsAsSearchParams.ts index 99d1ddd575..265011d891 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/indexSettingsAsSearchParams.ts +++ b/clients/algoliasearch-client-javascript/packages/client-search/model/indexSettingsAsSearchParams.ts @@ -6,6 +6,7 @@ import type { Distinct } from './distinct'; import type { ExactOnSingleWordQuery } from './exactOnSingleWordQuery'; import type { IgnorePlurals } from './ignorePlurals'; import type { Mode } from './mode'; +import type { OptionalWords } from './optionalWords'; import type { QueryType } from './queryType'; import type { ReRankingApplyFilter } from './reRankingApplyFilter'; import type { RemoveStopWords } from './removeStopWords'; @@ -135,10 +136,7 @@ export type IndexSettingsAsSearchParams = { */ advancedSyntax?: boolean; - /** - * 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). - */ - optionalWords?: Array; + optionalWords?: OptionalWords | null; /** * 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. @@ -174,11 +172,6 @@ export type IndexSettingsAsSearchParams = { */ responseFields?: Array; - /** - * 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). - */ - maxFacetHits?: number; - /** * Maximum number of facet values to return for each facet. */ diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/insideBoundingBox.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/insideBoundingBox.ts new file mode 100644 index 0000000000..8a498532f3 --- /dev/null +++ b/clients/algoliasearch-client-javascript/packages/client-search/model/insideBoundingBox.ts @@ -0,0 +1,3 @@ +// 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. + +export type InsideBoundingBox = string | Array>; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/optionalWords.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/optionalWords.ts new file mode 100644 index 0000000000..51d42589eb --- /dev/null +++ b/clients/algoliasearch-client-javascript/packages/client-search/model/optionalWords.ts @@ -0,0 +1,3 @@ +// 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. + +export type OptionalWords = string | Array; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/baseIndexSettings.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/baseIndexSettings.ts index 51d450a358..3e69db00bd 100644 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/baseIndexSettings.ts +++ b/clients/algoliasearch-client-javascript/packages/recommend/model/baseIndexSettings.ts @@ -87,4 +87,9 @@ export type BaseIndexSettings = { * Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. */ attributeForDistinct?: string; + + /** + * 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). + */ + maxFacetHits?: number; }; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/baseRecommendIndexSettings.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/baseRecommendIndexSettings.ts index d6f5e5cee1..07a53745b8 100644 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/baseRecommendIndexSettings.ts +++ b/clients/algoliasearch-client-javascript/packages/recommend/model/baseRecommendIndexSettings.ts @@ -5,6 +5,7 @@ import type { AlternativesAsExact } from './alternativesAsExact'; import type { Distinct } from './distinct'; import type { ExactOnSingleWordQuery } from './exactOnSingleWordQuery'; import type { IgnorePlurals } from './ignorePlurals'; +import type { OptionalWords } from './optionalWords'; import type { QueryType } from './queryType'; import type { ReRankingApplyFilter } from './reRankingApplyFilter'; import type { RemoveStopWords } from './removeStopWords'; @@ -114,10 +115,7 @@ export type BaseRecommendIndexSettings = { */ advancedSyntax?: boolean; - /** - * 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). - */ - optionalWords?: Array; + optionalWords?: OptionalWords | null; /** * 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. @@ -153,11 +151,6 @@ export type BaseRecommendIndexSettings = { */ responseFields?: Array; - /** - * 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). - */ - maxFacetHits?: number; - /** * Maximum number of facet values to return for each facet. */ diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/baseRecommendSearchParams.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/baseRecommendSearchParams.ts index 0c9814285c..bd10f6bac1 100644 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/baseRecommendSearchParams.ts +++ b/clients/algoliasearch-client-javascript/packages/recommend/model/baseRecommendSearchParams.ts @@ -3,6 +3,7 @@ import type { AroundPrecision } from './aroundPrecision'; import type { AroundRadius } from './aroundRadius'; import type { FacetFilters } from './facetFilters'; +import type { InsideBoundingBox } from './insideBoundingBox'; import type { NumericFilters } from './numericFilters'; import type { OptionalFilters } from './optionalFilters'; import type { SupportedLanguage } from './supportedLanguage'; @@ -66,10 +67,7 @@ export type BaseRecommendSearchParams = { */ minimumAroundRadius?: number; - /** - * 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). - */ - insideBoundingBox?: Array>; + insideBoundingBox?: InsideBoundingBox | null; /** * 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`. diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/index.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/index.ts index 6dc010ab54..f984c96237 100644 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/index.ts +++ b/clients/algoliasearch-client-javascript/packages/recommend/model/index.ts @@ -39,6 +39,7 @@ export * from './highlightResult'; export * from './highlightResultOption'; export * from './ignorePlurals'; export * from './indexSettingsFacets'; +export * from './insideBoundingBox'; export * from './lookingSimilar'; export * from './lookingSimilarModel'; export * from './lookingSimilarQuery'; @@ -46,6 +47,7 @@ export * from './matchedGeoLocation'; export * from './matchLevel'; export * from './numericFilters'; export * from './optionalFilters'; +export * from './optionalWords'; export * from './paramsConsequence'; export * from './personalization'; export * from './promoteConsequenceObject'; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/insideBoundingBox.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/insideBoundingBox.ts new file mode 100644 index 0000000000..8a498532f3 --- /dev/null +++ b/clients/algoliasearch-client-javascript/packages/recommend/model/insideBoundingBox.ts @@ -0,0 +1,3 @@ +// 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. + +export type InsideBoundingBox = string | Array>; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/optionalWords.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/optionalWords.ts new file mode 100644 index 0000000000..51d42589eb --- /dev/null +++ b/clients/algoliasearch-client-javascript/packages/recommend/model/optionalWords.ts @@ -0,0 +1,3 @@ +// 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. + +export type OptionalWords = string | Array; diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/FallbackParams.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/FallbackParams.kt index 38025abc7e..17ab76ba5c 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/FallbackParams.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/FallbackParams.kt @@ -22,7 +22,7 @@ import kotlinx.serialization.json.* * @param aroundRadius * @param aroundPrecision * @param minimumAroundRadius Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox 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). + * @param insideBoundingBox * @param insidePolygon 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`. * @param naturalLanguages ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. * @param ruleContexts Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. @@ -53,6 +53,7 @@ import kotlinx.serialization.json.* * @param userData An object with custom data. You can store up to 32kB as custom data. * @param customNormalization Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/). * @param attributeForDistinct Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. + * @param maxFacetHits 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). * @param attributesToRetrieve 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. * @param ranking Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/). * @param relevancyStrictness Relevancy threshold below which less relevant results aren't included in the results. You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results. @@ -76,7 +77,7 @@ import kotlinx.serialization.json.* * @param queryType * @param removeWordsIfNoResults * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords 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). + * @param optionalWords * @param disableExactOnAttributes 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. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -85,7 +86,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits 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). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -135,8 +135,7 @@ public data class FallbackParams( /** Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. */ @SerialName(value = "minimumAroundRadius") val minimumAroundRadius: Int? = null, - /** 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). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** 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`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, @@ -228,6 +227,9 @@ public data class FallbackParams( /** Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. */ @SerialName(value = "attributeForDistinct") val attributeForDistinct: String? = null, + /** 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). */ + @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, + /** 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. */ @SerialName(value = "attributesToRetrieve") val attributesToRetrieve: List? = null, @@ -292,8 +294,7 @@ public data class FallbackParams( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** 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). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** 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. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -317,9 +318,6 @@ public data class FallbackParams( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** 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). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/InsideBoundingBox.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/InsideBoundingBox.kt new file mode 100644 index 0000000000..3aa562bb3a --- /dev/null +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/InsideBoundingBox.kt @@ -0,0 +1,49 @@ +/** 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. */ +package com.algolia.client.model.recommend + +import com.algolia.client.exception.AlgoliaClientException +import com.algolia.client.extensions.internal.* +import kotlinx.serialization.* +import kotlinx.serialization.builtins.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* +import kotlinx.serialization.json.* +import kotlin.jvm.JvmInline + +/** + * InsideBoundingBox + * + * Implementations: + * - [List>] - *[InsideBoundingBox.of]* + * - [String] - *[InsideBoundingBox.of]* + */ +@Serializable(InsideBoundingBoxSerializer::class) +public sealed interface InsideBoundingBox { + @Serializable + @JvmInline + public value class StringValue(public val value: String) : InsideBoundingBox + + @Serializable + @JvmInline + public value class ListOfListOfDoubleValue(public val value: List>) : InsideBoundingBox + + public companion object { + + public fun of(value: String): InsideBoundingBox { + return StringValue(value) + } + public fun of(value: List>): InsideBoundingBox { + return ListOfListOfDoubleValue(value) + } + } +} + +internal class InsideBoundingBoxSerializer : JsonContentPolymorphicSerializer(InsideBoundingBox::class) { + override fun selectDeserializer(element: JsonElement): DeserializationStrategy { + return when { + element.isString -> InsideBoundingBox.StringValue.serializer() + element is JsonArray -> InsideBoundingBox.ListOfListOfDoubleValue.serializer() + else -> throw AlgoliaClientException("Failed to deserialize json element: $element") + } + } +} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/OptionalWords.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/OptionalWords.kt new file mode 100644 index 0000000000..5a55670727 --- /dev/null +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/OptionalWords.kt @@ -0,0 +1,49 @@ +/** 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. */ +package com.algolia.client.model.recommend + +import com.algolia.client.exception.AlgoliaClientException +import com.algolia.client.extensions.internal.* +import kotlinx.serialization.* +import kotlinx.serialization.builtins.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* +import kotlinx.serialization.json.* +import kotlin.jvm.JvmInline + +/** + * OptionalWords + * + * Implementations: + * - [List] - *[OptionalWords.of]* + * - [String] - *[OptionalWords.of]* + */ +@Serializable(OptionalWordsSerializer::class) +public sealed interface OptionalWords { + @Serializable + @JvmInline + public value class StringValue(public val value: String) : OptionalWords + + @Serializable + @JvmInline + public value class ListOfStringValue(public val value: List) : OptionalWords + + public companion object { + + public fun of(value: String): OptionalWords { + return StringValue(value) + } + public fun of(value: List): OptionalWords { + return ListOfStringValue(value) + } + } +} + +internal class OptionalWordsSerializer : JsonContentPolymorphicSerializer(OptionalWords::class) { + override fun selectDeserializer(element: JsonElement): DeserializationStrategy { + return when { + element.isString -> OptionalWords.StringValue.serializer() + element is JsonArray -> OptionalWords.ListOfStringValue.serializer() + else -> throw AlgoliaClientException("Failed to deserialize json element: $element") + } + } +} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendSearchParams.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendSearchParams.kt index 4bfed718e5..c455829f1e 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendSearchParams.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendSearchParams.kt @@ -22,7 +22,7 @@ import kotlinx.serialization.json.* * @param aroundRadius * @param aroundPrecision * @param minimumAroundRadius Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox 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). + * @param insideBoundingBox * @param insidePolygon 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`. * @param naturalLanguages ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. * @param ruleContexts Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. @@ -53,6 +53,7 @@ import kotlinx.serialization.json.* * @param userData An object with custom data. You can store up to 32kB as custom data. * @param customNormalization Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/). * @param attributeForDistinct Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. + * @param maxFacetHits 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). * @param attributesToRetrieve 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. * @param ranking Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/). * @param relevancyStrictness Relevancy threshold below which less relevant results aren't included in the results. You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results. @@ -76,7 +77,7 @@ import kotlinx.serialization.json.* * @param queryType * @param removeWordsIfNoResults * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords 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). + * @param optionalWords * @param disableExactOnAttributes 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. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -85,7 +86,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits 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). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -135,8 +135,7 @@ public data class RecommendSearchParams( /** Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. */ @SerialName(value = "minimumAroundRadius") val minimumAroundRadius: Int? = null, - /** 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). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** 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`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, @@ -228,6 +227,9 @@ public data class RecommendSearchParams( /** Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. */ @SerialName(value = "attributeForDistinct") val attributeForDistinct: String? = null, + /** 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). */ + @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, + /** 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. */ @SerialName(value = "attributesToRetrieve") val attributesToRetrieve: List? = null, @@ -292,8 +294,7 @@ public data class RecommendSearchParams( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** 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). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** 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. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -317,9 +318,6 @@ public data class RecommendSearchParams( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** 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). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/BrowseParamsObject.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/BrowseParamsObject.kt index 5f8a9cdce7..2089cc5886 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/BrowseParamsObject.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/BrowseParamsObject.kt @@ -26,7 +26,7 @@ import kotlinx.serialization.json.* * @param aroundRadius * @param aroundPrecision * @param minimumAroundRadius Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox 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). + * @param insideBoundingBox * @param insidePolygon 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`. * @param naturalLanguages ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. * @param ruleContexts Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. @@ -67,7 +67,7 @@ import kotlinx.serialization.json.* * @param mode * @param semanticSearch * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords 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). + * @param optionalWords * @param disableExactOnAttributes 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. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -76,7 +76,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits 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). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -139,8 +138,7 @@ public data class BrowseParamsObject( /** Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. */ @SerialName(value = "minimumAroundRadius") val minimumAroundRadius: Int? = null, - /** 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). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** 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`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, @@ -255,8 +253,7 @@ public data class BrowseParamsObject( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** 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). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** 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. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -280,9 +277,6 @@ public data class BrowseParamsObject( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** 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). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/ConsequenceParams.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/ConsequenceParams.kt index 9b7caeaf3a..dac1711052 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/ConsequenceParams.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/ConsequenceParams.kt @@ -25,7 +25,7 @@ import kotlinx.serialization.json.* * @param aroundRadius * @param aroundPrecision * @param minimumAroundRadius Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox 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). + * @param insideBoundingBox * @param insidePolygon 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`. * @param naturalLanguages ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. * @param ruleContexts Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. @@ -66,7 +66,7 @@ import kotlinx.serialization.json.* * @param mode * @param semanticSearch * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords 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). + * @param optionalWords * @param disableExactOnAttributes 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. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -75,7 +75,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits 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). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -137,8 +136,7 @@ public data class ConsequenceParams( /** Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. */ @SerialName(value = "minimumAroundRadius") val minimumAroundRadius: Int? = null, - /** 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). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** 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`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, @@ -253,8 +251,7 @@ public data class ConsequenceParams( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** 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). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** 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. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -278,9 +275,6 @@ public data class ConsequenceParams( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** 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). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/DeleteByParams.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/DeleteByParams.kt index 6b2431dc94..178de8e8e7 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/DeleteByParams.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/DeleteByParams.kt @@ -13,7 +13,7 @@ import kotlinx.serialization.json.* * @param tagFilters * @param aroundLatLng Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within a circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`. * @param aroundRadius - * @param insideBoundingBox 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). + * @param insideBoundingBox * @param insidePolygon 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`. */ @Serializable @@ -33,8 +33,7 @@ public data class DeleteByParams( @SerialName(value = "aroundRadius") val aroundRadius: AroundRadius? = null, - /** 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). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** 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`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/IndexSettings.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/IndexSettings.kt index 7a0b1013f2..6af5f87ff1 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/IndexSettings.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/IndexSettings.kt @@ -24,6 +24,7 @@ import kotlinx.serialization.json.* * @param userData An object with custom data. You can store up to 32kB as custom data. * @param customNormalization Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/). * @param attributeForDistinct Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. + * @param maxFacetHits 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). * @param attributesToRetrieve 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. * @param ranking Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/). * @param customRanking Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes, or the other attributes will never be applied. @@ -52,7 +53,7 @@ import kotlinx.serialization.json.* * @param mode * @param semanticSearch * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords 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). + * @param optionalWords * @param disableExactOnAttributes 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. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -61,7 +62,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits 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). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -123,6 +123,9 @@ public data class IndexSettings( /** Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. */ @SerialName(value = "attributeForDistinct") val attributeForDistinct: String? = null, + /** 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). */ + @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, + /** 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. */ @SerialName(value = "attributesToRetrieve") val attributesToRetrieve: List? = null, @@ -200,8 +203,7 @@ public data class IndexSettings( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** 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). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** 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. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -225,9 +227,6 @@ public data class IndexSettings( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** 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). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/InsideBoundingBox.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/InsideBoundingBox.kt new file mode 100644 index 0000000000..176a718790 --- /dev/null +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/InsideBoundingBox.kt @@ -0,0 +1,49 @@ +/** 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. */ +package com.algolia.client.model.search + +import com.algolia.client.exception.AlgoliaClientException +import com.algolia.client.extensions.internal.* +import kotlinx.serialization.* +import kotlinx.serialization.builtins.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* +import kotlinx.serialization.json.* +import kotlin.jvm.JvmInline + +/** + * InsideBoundingBox + * + * Implementations: + * - [List>] - *[InsideBoundingBox.of]* + * - [String] - *[InsideBoundingBox.of]* + */ +@Serializable(InsideBoundingBoxSerializer::class) +public sealed interface InsideBoundingBox { + @Serializable + @JvmInline + public value class StringValue(public val value: String) : InsideBoundingBox + + @Serializable + @JvmInline + public value class ListOfListOfDoubleValue(public val value: List>) : InsideBoundingBox + + public companion object { + + public fun of(value: String): InsideBoundingBox { + return StringValue(value) + } + public fun of(value: List>): InsideBoundingBox { + return ListOfListOfDoubleValue(value) + } + } +} + +internal class InsideBoundingBoxSerializer : JsonContentPolymorphicSerializer(InsideBoundingBox::class) { + override fun selectDeserializer(element: JsonElement): DeserializationStrategy { + return when { + element.isString -> InsideBoundingBox.StringValue.serializer() + element is JsonArray -> InsideBoundingBox.ListOfListOfDoubleValue.serializer() + else -> throw AlgoliaClientException("Failed to deserialize json element: $element") + } + } +} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/OptionalWords.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/OptionalWords.kt new file mode 100644 index 0000000000..ed33ea11e4 --- /dev/null +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/OptionalWords.kt @@ -0,0 +1,49 @@ +/** 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. */ +package com.algolia.client.model.search + +import com.algolia.client.exception.AlgoliaClientException +import com.algolia.client.extensions.internal.* +import kotlinx.serialization.* +import kotlinx.serialization.builtins.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* +import kotlinx.serialization.json.* +import kotlin.jvm.JvmInline + +/** + * OptionalWords + * + * Implementations: + * - [List] - *[OptionalWords.of]* + * - [String] - *[OptionalWords.of]* + */ +@Serializable(OptionalWordsSerializer::class) +public sealed interface OptionalWords { + @Serializable + @JvmInline + public value class StringValue(public val value: String) : OptionalWords + + @Serializable + @JvmInline + public value class ListOfStringValue(public val value: List) : OptionalWords + + public companion object { + + public fun of(value: String): OptionalWords { + return StringValue(value) + } + public fun of(value: List): OptionalWords { + return ListOfStringValue(value) + } + } +} + +internal class OptionalWordsSerializer : JsonContentPolymorphicSerializer(OptionalWords::class) { + override fun selectDeserializer(element: JsonElement): DeserializationStrategy { + return when { + element.isString -> OptionalWords.StringValue.serializer() + element is JsonArray -> OptionalWords.ListOfStringValue.serializer() + else -> throw AlgoliaClientException("Failed to deserialize json element: $element") + } + } +} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForFacets.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForFacets.kt index 400f2198b2..87c440015f 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForFacets.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForFacets.kt @@ -30,7 +30,7 @@ import kotlinx.serialization.json.* * @param aroundRadius * @param aroundPrecision * @param minimumAroundRadius Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox 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). + * @param insideBoundingBox * @param insidePolygon 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`. * @param naturalLanguages ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. * @param ruleContexts Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. @@ -71,7 +71,7 @@ import kotlinx.serialization.json.* * @param mode * @param semanticSearch * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords 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). + * @param optionalWords * @param disableExactOnAttributes 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. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -80,7 +80,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits 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). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -88,6 +87,7 @@ import kotlinx.serialization.json.* * @param enableReRanking Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. * @param reRankingApplyFilter * @param facetQuery Text to search inside the facet's values. + * @param maxFacetHits 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). */ @Serializable public data class SearchForFacets( @@ -154,8 +154,7 @@ public data class SearchForFacets( /** Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. */ @SerialName(value = "minimumAroundRadius") val minimumAroundRadius: Int? = null, - /** 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). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** 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`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, @@ -270,8 +269,7 @@ public data class SearchForFacets( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** 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). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** 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. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -295,9 +293,6 @@ public data class SearchForFacets( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** 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). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, @@ -316,4 +311,7 @@ public data class SearchForFacets( /** Text to search inside the facet's values. */ @SerialName(value = "facetQuery") val facetQuery: String? = null, + + /** 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). */ + @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, ) : SearchQuery diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForHits.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForHits.kt index a4c07a24fc..208d459a77 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForHits.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForHits.kt @@ -28,7 +28,7 @@ import kotlinx.serialization.json.* * @param aroundRadius * @param aroundPrecision * @param minimumAroundRadius Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox 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). + * @param insideBoundingBox * @param insidePolygon 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`. * @param naturalLanguages ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. * @param ruleContexts Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. @@ -69,7 +69,7 @@ import kotlinx.serialization.json.* * @param mode * @param semanticSearch * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords 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). + * @param optionalWords * @param disableExactOnAttributes 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. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -78,7 +78,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits 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). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -147,8 +146,7 @@ public data class SearchForHits( /** Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. */ @SerialName(value = "minimumAroundRadius") val minimumAroundRadius: Int? = null, - /** 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). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** 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`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, @@ -263,8 +261,7 @@ public data class SearchForHits( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** 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). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** 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. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -288,9 +285,6 @@ public data class SearchForHits( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** 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). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchParamsObject.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchParamsObject.kt index 4d8afa882d..05ef814726 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchParamsObject.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchParamsObject.kt @@ -26,7 +26,7 @@ import kotlinx.serialization.json.* * @param aroundRadius * @param aroundPrecision * @param minimumAroundRadius Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox 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). + * @param insideBoundingBox * @param insidePolygon 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`. * @param naturalLanguages ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. * @param ruleContexts Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. @@ -67,7 +67,7 @@ import kotlinx.serialization.json.* * @param mode * @param semanticSearch * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords 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). + * @param optionalWords * @param disableExactOnAttributes 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. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -76,7 +76,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits 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). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -138,8 +137,7 @@ public data class SearchParamsObject( /** Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. */ @SerialName(value = "minimumAroundRadius") val minimumAroundRadius: Int? = null, - /** 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). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** 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`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, @@ -254,8 +252,7 @@ public data class SearchParamsObject( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** 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). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** 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. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -279,9 +276,6 @@ public data class SearchParamsObject( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** 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). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SettingsResponse.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SettingsResponse.kt index 3947dd47bc..6dbd2bca6e 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SettingsResponse.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/SettingsResponse.kt @@ -24,6 +24,7 @@ import kotlinx.serialization.json.* * @param userData An object with custom data. You can store up to 32kB as custom data. * @param customNormalization Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/). * @param attributeForDistinct Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. + * @param maxFacetHits 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). * @param attributesToRetrieve 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. * @param ranking Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/). * @param customRanking Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes, or the other attributes will never be applied. @@ -52,7 +53,7 @@ import kotlinx.serialization.json.* * @param mode * @param semanticSearch * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords 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). + * @param optionalWords * @param disableExactOnAttributes 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. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -61,7 +62,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits 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). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -124,6 +124,9 @@ public data class SettingsResponse( /** Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. */ @SerialName(value = "attributeForDistinct") val attributeForDistinct: String? = null, + /** 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). */ + @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, + /** 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. */ @SerialName(value = "attributesToRetrieve") val attributesToRetrieve: List? = null, @@ -201,8 +204,7 @@ public data class SettingsResponse( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** 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). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** 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. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -226,9 +228,6 @@ public data class SettingsResponse( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** 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). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, diff --git a/clients/algoliasearch-client-php/lib/Api/SearchClient.php b/clients/algoliasearch-client-php/lib/Api/SearchClient.php index ecf3a7616d..7d8ddd96e5 100644 --- a/clients/algoliasearch-client-php/lib/Api/SearchClient.php +++ b/clients/algoliasearch-client-php/lib/Api/SearchClient.php @@ -817,7 +817,7 @@ public function deleteApiKey($key, $requestOptions = []) * - $deleteByParams['tagFilters'] => (array) * - $deleteByParams['aroundLatLng'] => (string) Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within a circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`. * - $deleteByParams['aroundRadius'] => (array) - * - $deleteByParams['insideBoundingBox'] => (array) 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). + * - $deleteByParams['insideBoundingBox'] => (array) * - $deleteByParams['insidePolygon'] => (array) 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`. * * @see DeleteByParams diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/FallbackParams.php b/clients/algoliasearch-client-php/lib/Model/Recommend/FallbackParams.php index 2f2edd59f5..24c0ab8d87 100644 --- a/clients/algoliasearch-client-php/lib/Model/Recommend/FallbackParams.php +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/FallbackParams.php @@ -35,7 +35,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Recommend\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Recommend\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Recommend\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Recommend\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -66,6 +66,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'userData' => 'object', 'customNormalization' => 'array>', 'attributeForDistinct' => 'string', + 'maxFacetHits' => 'int', 'attributesToRetrieve' => 'string[]', 'ranking' => 'string[]', 'relevancyStrictness' => 'int', @@ -89,7 +90,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'queryType' => '\Algolia\AlgoliaSearch\Model\Recommend\QueryType', 'removeWordsIfNoResults' => '\Algolia\AlgoliaSearch\Model\Recommend\RemoveWordsIfNoResults', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Recommend\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Recommend\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Recommend\AlternativesAsExact[]', @@ -98,7 +99,6 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -128,7 +128,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -159,6 +159,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'userData' => null, 'customNormalization' => null, 'attributeForDistinct' => null, + 'maxFacetHits' => null, 'attributesToRetrieve' => null, 'ranking' => null, 'relevancyStrictness' => null, @@ -191,7 +192,6 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -253,6 +253,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'userData' => 'userData', 'customNormalization' => 'customNormalization', 'attributeForDistinct' => 'attributeForDistinct', + 'maxFacetHits' => 'maxFacetHits', 'attributesToRetrieve' => 'attributesToRetrieve', 'ranking' => 'ranking', 'relevancyStrictness' => 'relevancyStrictness', @@ -285,7 +286,6 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -346,6 +346,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'userData' => 'setUserData', 'customNormalization' => 'setCustomNormalization', 'attributeForDistinct' => 'setAttributeForDistinct', + 'maxFacetHits' => 'setMaxFacetHits', 'attributesToRetrieve' => 'setAttributesToRetrieve', 'ranking' => 'setRanking', 'relevancyStrictness' => 'setRelevancyStrictness', @@ -378,7 +379,6 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -439,6 +439,7 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'userData' => 'getUserData', 'customNormalization' => 'getCustomNormalization', 'attributeForDistinct' => 'getAttributeForDistinct', + 'maxFacetHits' => 'getMaxFacetHits', 'attributesToRetrieve' => 'getAttributesToRetrieve', 'ranking' => 'getRanking', 'relevancyStrictness' => 'getRelevancyStrictness', @@ -471,7 +472,6 @@ class FallbackParams extends AbstractModel implements ModelInterface, \ArrayAcce 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -632,6 +632,9 @@ public function __construct(?array $data = null) if (isset($data['attributeForDistinct'])) { $this->container['attributeForDistinct'] = $data['attributeForDistinct']; } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } if (isset($data['attributesToRetrieve'])) { $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; } @@ -728,9 +731,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1186,7 +1186,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1196,7 +1196,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -1927,6 +1927,30 @@ public function setAttributeForDistinct($attributeForDistinct) return $this; } + /** + * Gets maxFacetHits. + * + * @return null|int + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits. + * + * @param null|int $maxFacetHits 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). + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + /** * Gets attributesToRetrieve. * @@ -2482,7 +2506,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2492,7 +2516,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords 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). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2695,30 +2719,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits 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). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/InsideBoundingBox.php b/clients/algoliasearch-client-php/lib/Model/Recommend/InsideBoundingBox.php new file mode 100644 index 0000000000..109c266cb4 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/InsideBoundingBox.php @@ -0,0 +1,188 @@ +listInvalidProperties()); + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/OptionalWords.php b/clients/algoliasearch-client-php/lib/Model/Recommend/OptionalWords.php new file mode 100644 index 0000000000..bda029ed4e --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/OptionalWords.php @@ -0,0 +1,188 @@ +listInvalidProperties()); + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendSearchParams.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendSearchParams.php index a5bf051a42..a32d7d408b 100644 --- a/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendSearchParams.php +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendSearchParams.php @@ -37,7 +37,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Recommend\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Recommend\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Recommend\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Recommend\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -68,6 +68,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'userData' => 'object', 'customNormalization' => 'array>', 'attributeForDistinct' => 'string', + 'maxFacetHits' => 'int', 'attributesToRetrieve' => 'string[]', 'ranking' => 'string[]', 'relevancyStrictness' => 'int', @@ -91,7 +92,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'queryType' => '\Algolia\AlgoliaSearch\Model\Recommend\QueryType', 'removeWordsIfNoResults' => '\Algolia\AlgoliaSearch\Model\Recommend\RemoveWordsIfNoResults', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Recommend\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Recommend\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Recommend\AlternativesAsExact[]', @@ -100,7 +101,6 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -130,7 +130,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -161,6 +161,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'userData' => null, 'customNormalization' => null, 'attributeForDistinct' => null, + 'maxFacetHits' => null, 'attributesToRetrieve' => null, 'ranking' => null, 'relevancyStrictness' => null, @@ -193,7 +194,6 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -255,6 +255,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'userData' => 'userData', 'customNormalization' => 'customNormalization', 'attributeForDistinct' => 'attributeForDistinct', + 'maxFacetHits' => 'maxFacetHits', 'attributesToRetrieve' => 'attributesToRetrieve', 'ranking' => 'ranking', 'relevancyStrictness' => 'relevancyStrictness', @@ -287,7 +288,6 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -348,6 +348,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'userData' => 'setUserData', 'customNormalization' => 'setCustomNormalization', 'attributeForDistinct' => 'setAttributeForDistinct', + 'maxFacetHits' => 'setMaxFacetHits', 'attributesToRetrieve' => 'setAttributesToRetrieve', 'ranking' => 'setRanking', 'relevancyStrictness' => 'setRelevancyStrictness', @@ -380,7 +381,6 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -441,6 +441,7 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'userData' => 'getUserData', 'customNormalization' => 'getCustomNormalization', 'attributeForDistinct' => 'getAttributeForDistinct', + 'maxFacetHits' => 'getMaxFacetHits', 'attributesToRetrieve' => 'getAttributesToRetrieve', 'ranking' => 'getRanking', 'relevancyStrictness' => 'getRelevancyStrictness', @@ -473,7 +474,6 @@ class RecommendSearchParams extends AbstractModel implements ModelInterface, \Ar 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -634,6 +634,9 @@ public function __construct(?array $data = null) if (isset($data['attributeForDistinct'])) { $this->container['attributeForDistinct'] = $data['attributeForDistinct']; } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } if (isset($data['attributesToRetrieve'])) { $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; } @@ -730,9 +733,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1188,7 +1188,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1198,7 +1198,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -1929,6 +1929,30 @@ public function setAttributeForDistinct($attributeForDistinct) return $this; } + /** + * Gets maxFacetHits. + * + * @return null|int + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits. + * + * @param null|int $maxFacetHits 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). + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + /** * Gets attributesToRetrieve. * @@ -2484,7 +2508,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2494,7 +2518,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords 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). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2697,30 +2721,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits 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). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BrowseParams.php b/clients/algoliasearch-client-php/lib/Model/Search/BrowseParams.php index 6840ddbc92..fef8b568d4 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/BrowseParams.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/BrowseParams.php @@ -40,7 +40,7 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -81,7 +81,7 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -90,7 +90,6 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -126,7 +125,7 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -176,7 +175,6 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -263,7 +261,6 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -349,7 +346,6 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -435,7 +431,6 @@ class BrowseParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -669,9 +664,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1250,7 +1242,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1260,7 +1252,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2234,7 +2226,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2244,7 +2236,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords 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). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2447,30 +2439,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits 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). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BrowseParamsObject.php b/clients/algoliasearch-client-php/lib/Model/Search/BrowseParamsObject.php index d86addefcc..6a3d37a25e 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/BrowseParamsObject.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/BrowseParamsObject.php @@ -39,7 +39,7 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -80,7 +80,7 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -89,7 +89,6 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -124,7 +123,7 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -174,7 +173,6 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -260,7 +258,6 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -345,7 +342,6 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -430,7 +426,6 @@ class BrowseParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -661,9 +656,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1218,7 +1210,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1228,7 +1220,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2202,7 +2194,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2212,7 +2204,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords 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). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2415,30 +2407,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits 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). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/clients/algoliasearch-client-php/lib/Model/Search/ConsequenceParams.php b/clients/algoliasearch-client-php/lib/Model/Search/ConsequenceParams.php index b6a3a06b70..9c60d751c8 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/ConsequenceParams.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/ConsequenceParams.php @@ -38,7 +38,7 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -79,7 +79,7 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -88,7 +88,6 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -124,7 +123,7 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -174,7 +173,6 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -261,7 +259,6 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -347,7 +344,6 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -433,7 +429,6 @@ class ConsequenceParams extends AbstractModel implements ModelInterface, \ArrayA 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -663,9 +658,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1202,7 +1194,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1212,7 +1204,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2186,7 +2178,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2196,7 +2188,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords 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). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2399,30 +2391,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits 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). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/clients/algoliasearch-client-php/lib/Model/Search/DeleteByParams.php b/clients/algoliasearch-client-php/lib/Model/Search/DeleteByParams.php index 2b9f2d6fdd..46a30b705b 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/DeleteByParams.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/DeleteByParams.php @@ -26,7 +26,7 @@ class DeleteByParams extends AbstractModel implements ModelInterface, \ArrayAcce 'tagFilters' => '\Algolia\AlgoliaSearch\Model\Search\TagFilters', 'aroundLatLng' => 'string', 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', ]; @@ -42,7 +42,7 @@ class DeleteByParams extends AbstractModel implements ModelInterface, \ArrayAcce 'tagFilters' => null, 'aroundLatLng' => null, 'aroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', ]; @@ -354,7 +354,7 @@ public function setAroundRadius($aroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -364,7 +364,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Search/IndexSettings.php b/clients/algoliasearch-client-php/lib/Model/Search/IndexSettings.php index 68e816a155..a82482af60 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/IndexSettings.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/IndexSettings.php @@ -39,6 +39,7 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'userData' => 'object', 'customNormalization' => 'array>', 'attributeForDistinct' => 'string', + 'maxFacetHits' => 'int', 'attributesToRetrieve' => 'string[]', 'ranking' => 'string[]', 'customRanking' => 'string[]', @@ -67,7 +68,7 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -76,7 +77,6 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -108,6 +108,7 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'userData' => null, 'customNormalization' => null, 'attributeForDistinct' => null, + 'maxFacetHits' => null, 'attributesToRetrieve' => null, 'ranking' => null, 'customRanking' => null, @@ -145,7 +146,6 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -178,6 +178,7 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'userData' => 'userData', 'customNormalization' => 'customNormalization', 'attributeForDistinct' => 'attributeForDistinct', + 'maxFacetHits' => 'maxFacetHits', 'attributesToRetrieve' => 'attributesToRetrieve', 'ranking' => 'ranking', 'customRanking' => 'customRanking', @@ -215,7 +216,6 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -247,6 +247,7 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'userData' => 'setUserData', 'customNormalization' => 'setCustomNormalization', 'attributeForDistinct' => 'setAttributeForDistinct', + 'maxFacetHits' => 'setMaxFacetHits', 'attributesToRetrieve' => 'setAttributesToRetrieve', 'ranking' => 'setRanking', 'customRanking' => 'setCustomRanking', @@ -284,7 +285,6 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -316,6 +316,7 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'userData' => 'getUserData', 'customNormalization' => 'getCustomNormalization', 'attributeForDistinct' => 'getAttributeForDistinct', + 'maxFacetHits' => 'getMaxFacetHits', 'attributesToRetrieve' => 'getAttributesToRetrieve', 'ranking' => 'getRanking', 'customRanking' => 'getCustomRanking', @@ -353,7 +354,6 @@ class IndexSettings extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -427,6 +427,9 @@ public function __construct(?array $data = null) if (isset($data['attributeForDistinct'])) { $this->container['attributeForDistinct'] = $data['attributeForDistinct']; } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } if (isset($data['attributesToRetrieve'])) { $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; } @@ -538,9 +541,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1041,6 +1041,30 @@ public function setAttributeForDistinct($attributeForDistinct) return $this; } + /** + * Gets maxFacetHits. + * + * @return null|int + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits. + * + * @param null|int $maxFacetHits 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). + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + /** * Gets attributesToRetrieve. * @@ -1716,7 +1740,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -1726,7 +1750,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords 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). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -1929,30 +1953,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits 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). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/clients/algoliasearch-client-php/lib/Model/Search/InsideBoundingBox.php b/clients/algoliasearch-client-php/lib/Model/Search/InsideBoundingBox.php new file mode 100644 index 0000000000..630c76c93d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/InsideBoundingBox.php @@ -0,0 +1,188 @@ +listInvalidProperties()); + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/clients/algoliasearch-client-php/lib/Model/Search/OptionalWords.php b/clients/algoliasearch-client-php/lib/Model/Search/OptionalWords.php new file mode 100644 index 0000000000..4af9fdbef1 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/OptionalWords.php @@ -0,0 +1,188 @@ +listInvalidProperties()); + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchForFacets.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchForFacets.php index 2334b3fcf6..d2f758476c 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/SearchForFacets.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchForFacets.php @@ -40,7 +40,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -81,7 +81,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -90,7 +90,6 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -100,6 +99,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'facet' => 'string', 'indexName' => 'string', 'facetQuery' => 'string', + 'maxFacetHits' => 'int', 'type' => '\Algolia\AlgoliaSearch\Model\Search\SearchTypeFacet', ]; @@ -129,7 +129,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -179,7 +179,6 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -189,6 +188,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'facet' => null, 'indexName' => null, 'facetQuery' => null, + 'maxFacetHits' => null, 'type' => null, ]; @@ -269,7 +269,6 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -279,6 +278,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'facet' => 'facet', 'indexName' => 'indexName', 'facetQuery' => 'facetQuery', + 'maxFacetHits' => 'maxFacetHits', 'type' => 'type', ]; @@ -358,7 +358,6 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -368,6 +367,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'facet' => 'setFacet', 'indexName' => 'setIndexName', 'facetQuery' => 'setFacetQuery', + 'maxFacetHits' => 'setMaxFacetHits', 'type' => 'setType', ]; @@ -447,7 +447,6 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -457,6 +456,7 @@ class SearchForFacets extends AbstractModel implements ModelInterface, \ArrayAcc 'facet' => 'getFacet', 'indexName' => 'getIndexName', 'facetQuery' => 'getFacetQuery', + 'maxFacetHits' => 'getMaxFacetHits', 'type' => 'getType', ]; @@ -684,9 +684,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -714,6 +711,9 @@ public function __construct(?array $data = null) if (isset($data['facetQuery'])) { $this->container['facetQuery'] = $data['facetQuery']; } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } if (isset($data['type'])) { $this->container['type'] = $data['type']; } @@ -1286,7 +1286,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1296,7 +1296,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2270,7 +2270,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2280,7 +2280,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords 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). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2483,30 +2483,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits 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). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * @@ -2723,6 +2699,30 @@ public function setFacetQuery($facetQuery) return $this; } + /** + * Gets maxFacetHits. + * + * @return null|int + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits. + * + * @param null|int $maxFacetHits 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). + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + /** * Gets type. * diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchForHits.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchForHits.php index 289d602d6b..053b2820be 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/SearchForHits.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchForHits.php @@ -40,7 +40,7 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -81,7 +81,7 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -90,7 +90,6 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -127,7 +126,7 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -177,7 +176,6 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -265,7 +263,6 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -352,7 +349,6 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -439,7 +435,6 @@ class SearchForHits extends AbstractModel implements ModelInterface, \ArrayAcces 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -674,9 +669,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1264,7 +1256,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1274,7 +1266,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2248,7 +2240,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2258,7 +2250,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords 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). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2461,30 +2453,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits 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). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchParams.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchParams.php index b693c9dbf0..a0a60d7368 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/SearchParams.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchParams.php @@ -40,7 +40,7 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -81,7 +81,7 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -90,7 +90,6 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -125,7 +124,7 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -175,7 +174,6 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -261,7 +259,6 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -346,7 +343,6 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -431,7 +427,6 @@ class SearchParams extends AbstractModel implements ModelInterface, \ArrayAccess 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -664,9 +659,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1242,7 +1234,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1252,7 +1244,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2226,7 +2218,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2236,7 +2228,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords 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). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2439,30 +2431,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits 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). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchParamsObject.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchParamsObject.php index be82b36b8e..a52ea64f92 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/SearchParamsObject.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchParamsObject.php @@ -41,7 +41,7 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -82,7 +82,7 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -91,7 +91,6 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -125,7 +124,7 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -175,7 +174,6 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -260,7 +258,6 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -344,7 +341,6 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -428,7 +424,6 @@ class SearchParamsObject extends AbstractModel implements ModelInterface, \Array 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -658,9 +653,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1212,7 +1204,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1222,7 +1214,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2196,7 +2188,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2206,7 +2198,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords 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). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2409,30 +2401,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits 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). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchQuery.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchQuery.php index 9e4859106e..fd900e5c16 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/SearchQuery.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchQuery.php @@ -40,7 +40,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Search\AroundPrecision', 'minimumAroundRadius' => 'int', - 'insideBoundingBox' => 'float[][]', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Search\InsideBoundingBox', 'insidePolygon' => 'float[][]', 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Search\SupportedLanguage[]', 'ruleContexts' => 'string[]', @@ -81,7 +81,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -90,7 +90,6 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -101,6 +100,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'type' => '\Algolia\AlgoliaSearch\Model\Search\SearchTypeFacet', 'facet' => 'string', 'facetQuery' => 'string', + 'maxFacetHits' => 'int', ]; /** @@ -129,7 +129,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'aroundRadius' => null, 'aroundPrecision' => null, 'minimumAroundRadius' => null, - 'insideBoundingBox' => 'double', + 'insideBoundingBox' => null, 'insidePolygon' => 'double', 'naturalLanguages' => null, 'ruleContexts' => null, @@ -179,7 +179,6 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -190,6 +189,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'type' => null, 'facet' => null, 'facetQuery' => null, + 'maxFacetHits' => null, ]; /** @@ -269,7 +269,6 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -280,6 +279,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'type' => 'type', 'facet' => 'facet', 'facetQuery' => 'facetQuery', + 'maxFacetHits' => 'maxFacetHits', ]; /** @@ -358,7 +358,6 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -369,6 +368,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'type' => 'setType', 'facet' => 'setFacet', 'facetQuery' => 'setFacetQuery', + 'maxFacetHits' => 'setMaxFacetHits', ]; /** @@ -447,7 +447,6 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -458,6 +457,7 @@ class SearchQuery extends AbstractModel implements ModelInterface, \ArrayAccess, 'type' => 'getType', 'facet' => 'getFacet', 'facetQuery' => 'getFacetQuery', + 'maxFacetHits' => 'getMaxFacetHits', ]; /** @@ -684,9 +684,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -717,6 +714,9 @@ public function __construct(?array $data = null) if (isset($data['facetQuery'])) { $this->container['facetQuery'] = $data['facetQuery']; } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } } /** @@ -1286,7 +1286,7 @@ public function setMinimumAroundRadius($minimumAroundRadius) /** * Gets insideBoundingBox. * - * @return null|float[][] + * @return null|InsideBoundingBox */ public function getInsideBoundingBox() { @@ -1296,7 +1296,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox. * - * @param null|float[][] $insideBoundingBox 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). + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox * * @return self */ @@ -2270,7 +2270,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -2280,7 +2280,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords 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). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -2483,30 +2483,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits 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). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * @@ -2747,6 +2723,30 @@ public function setFacetQuery($facetQuery) return $this; } + /** + * Gets maxFacetHits. + * + * @return null|int + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits. + * + * @param null|int $maxFacetHits 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). + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + /** * Returns true if offset exists. False otherwise. * diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SettingsResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/SettingsResponse.php index 982830adc8..718d9cce95 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/SettingsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SettingsResponse.php @@ -37,6 +37,7 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'userData' => 'object', 'customNormalization' => 'array>', 'attributeForDistinct' => 'string', + 'maxFacetHits' => 'int', 'attributesToRetrieve' => 'string[]', 'ranking' => 'string[]', 'customRanking' => 'string[]', @@ -65,7 +66,7 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'mode' => '\Algolia\AlgoliaSearch\Model\Search\Mode', 'semanticSearch' => '\Algolia\AlgoliaSearch\Model\Search\SemanticSearch', 'advancedSyntax' => 'bool', - 'optionalWords' => 'string[]', + 'optionalWords' => '\Algolia\AlgoliaSearch\Model\Search\OptionalWords', 'disableExactOnAttributes' => 'string[]', 'exactOnSingleWordQuery' => '\Algolia\AlgoliaSearch\Model\Search\ExactOnSingleWordQuery', 'alternativesAsExact' => '\Algolia\AlgoliaSearch\Model\Search\AlternativesAsExact[]', @@ -74,7 +75,6 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'replaceSynonymsInHighlight' => 'bool', 'minProximity' => 'int', 'responseFields' => 'string[]', - 'maxFacetHits' => 'int', 'maxValuesPerFacet' => 'int', 'sortFacetValuesBy' => 'string', 'attributeCriteriaComputedByMinProximity' => 'bool', @@ -107,6 +107,7 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'userData' => null, 'customNormalization' => null, 'attributeForDistinct' => null, + 'maxFacetHits' => null, 'attributesToRetrieve' => null, 'ranking' => null, 'customRanking' => null, @@ -144,7 +145,6 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'replaceSynonymsInHighlight' => null, 'minProximity' => null, 'responseFields' => null, - 'maxFacetHits' => null, 'maxValuesPerFacet' => null, 'sortFacetValuesBy' => null, 'attributeCriteriaComputedByMinProximity' => null, @@ -178,6 +178,7 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'userData' => 'userData', 'customNormalization' => 'customNormalization', 'attributeForDistinct' => 'attributeForDistinct', + 'maxFacetHits' => 'maxFacetHits', 'attributesToRetrieve' => 'attributesToRetrieve', 'ranking' => 'ranking', 'customRanking' => 'customRanking', @@ -215,7 +216,6 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', 'minProximity' => 'minProximity', 'responseFields' => 'responseFields', - 'maxFacetHits' => 'maxFacetHits', 'maxValuesPerFacet' => 'maxValuesPerFacet', 'sortFacetValuesBy' => 'sortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', @@ -248,6 +248,7 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'userData' => 'setUserData', 'customNormalization' => 'setCustomNormalization', 'attributeForDistinct' => 'setAttributeForDistinct', + 'maxFacetHits' => 'setMaxFacetHits', 'attributesToRetrieve' => 'setAttributesToRetrieve', 'ranking' => 'setRanking', 'customRanking' => 'setCustomRanking', @@ -285,7 +286,6 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', 'minProximity' => 'setMinProximity', 'responseFields' => 'setResponseFields', - 'maxFacetHits' => 'setMaxFacetHits', 'maxValuesPerFacet' => 'setMaxValuesPerFacet', 'sortFacetValuesBy' => 'setSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', @@ -318,6 +318,7 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'userData' => 'getUserData', 'customNormalization' => 'getCustomNormalization', 'attributeForDistinct' => 'getAttributeForDistinct', + 'maxFacetHits' => 'getMaxFacetHits', 'attributesToRetrieve' => 'getAttributesToRetrieve', 'ranking' => 'getRanking', 'customRanking' => 'getCustomRanking', @@ -355,7 +356,6 @@ class SettingsResponse extends AbstractModel implements ModelInterface, \ArrayAc 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', 'minProximity' => 'getMinProximity', 'responseFields' => 'getResponseFields', - 'maxFacetHits' => 'getMaxFacetHits', 'maxValuesPerFacet' => 'getMaxValuesPerFacet', 'sortFacetValuesBy' => 'getSortFacetValuesBy', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', @@ -430,6 +430,9 @@ public function __construct(?array $data = null) if (isset($data['attributeForDistinct'])) { $this->container['attributeForDistinct'] = $data['attributeForDistinct']; } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } if (isset($data['attributesToRetrieve'])) { $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; } @@ -541,9 +544,6 @@ public function __construct(?array $data = null) if (isset($data['responseFields'])) { $this->container['responseFields'] = $data['responseFields']; } - if (isset($data['maxFacetHits'])) { - $this->container['maxFacetHits'] = $data['maxFacetHits']; - } if (isset($data['maxValuesPerFacet'])) { $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; } @@ -1047,6 +1047,30 @@ public function setAttributeForDistinct($attributeForDistinct) return $this; } + /** + * Gets maxFacetHits. + * + * @return null|int + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits. + * + * @param null|int $maxFacetHits 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). + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + /** * Gets attributesToRetrieve. * @@ -1722,7 +1746,7 @@ public function setAdvancedSyntax($advancedSyntax) /** * Gets optionalWords. * - * @return null|string[] + * @return null|OptionalWords */ public function getOptionalWords() { @@ -1732,7 +1756,7 @@ public function getOptionalWords() /** * Sets optionalWords. * - * @param null|string[] $optionalWords 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). + * @param null|OptionalWords $optionalWords optionalWords * * @return self */ @@ -1935,30 +1959,6 @@ public function setResponseFields($responseFields) return $this; } - /** - * Gets maxFacetHits. - * - * @return null|int - */ - public function getMaxFacetHits() - { - return $this->container['maxFacetHits'] ?? null; - } - - /** - * Sets maxFacetHits. - * - * @param null|int $maxFacetHits 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). - * - * @return self - */ - public function setMaxFacetHits($maxFacetHits) - { - $this->container['maxFacetHits'] = $maxFacetHits; - - return $this; - } - /** * Gets maxValuesPerFacet. * diff --git a/clients/algoliasearch-client-python/algoliasearch/recommend/models/fallback_params.py b/clients/algoliasearch-client-python/algoliasearch/recommend/models/fallback_params.py index f7fae5d892..4552fe7df1 100644 --- a/clients/algoliasearch-client-python/algoliasearch/recommend/models/fallback_params.py +++ b/clients/algoliasearch-client-python/algoliasearch/recommend/models/fallback_params.py @@ -30,8 +30,10 @@ ) from algoliasearch.recommend.models.facet_filters import FacetFilters from algoliasearch.recommend.models.ignore_plurals import IgnorePlurals +from algoliasearch.recommend.models.inside_bounding_box import InsideBoundingBox from algoliasearch.recommend.models.numeric_filters import NumericFilters from algoliasearch.recommend.models.optional_filters import OptionalFilters +from algoliasearch.recommend.models.optional_words import OptionalWords from algoliasearch.recommend.models.query_type import QueryType from algoliasearch.recommend.models.re_ranking_apply_filter import ReRankingApplyFilter from algoliasearch.recommend.models.remove_stop_words import RemoveStopWords @@ -90,6 +92,7 @@ "user_data": "userData", "custom_normalization": "customNormalization", "attribute_for_distinct": "attributeForDistinct", + "max_facet_hits": "maxFacetHits", "attributes_to_retrieve": "attributesToRetrieve", "ranking": "ranking", "relevancy_strictness": "relevancyStrictness", @@ -122,7 +125,6 @@ "replace_synonyms_in_highlight": "replaceSynonymsInHighlight", "min_proximity": "minProximity", "response_fields": "responseFields", - "max_facet_hits": "maxFacetHits", "max_values_per_facet": "maxValuesPerFacet", "sort_facet_values_by": "sortFacetValuesBy", "attribute_criteria_computed_by_min_proximity": "attributeCriteriaComputedByMinProximity", @@ -165,8 +167,7 @@ class FallbackParams(BaseModel): around_precision: Optional[AroundPrecision] = None minimum_around_radius: Optional[int] = None """ Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. """ - inside_bounding_box: Optional[List[List[float]]] = None - """ 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). """ + inside_bounding_box: Optional[InsideBoundingBox] = None inside_polygon: Optional[List[List[float]]] = None """ 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`. """ natural_languages: Optional[List[SupportedLanguage]] = None @@ -227,6 +228,8 @@ class FallbackParams(BaseModel): """ Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/). """ attribute_for_distinct: Optional[str] = None """ Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. """ + max_facet_hits: Optional[int] = None + """ 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). """ attributes_to_retrieve: Optional[List[str]] = None """ 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. """ ranking: Optional[List[str]] = None @@ -268,8 +271,7 @@ class FallbackParams(BaseModel): remove_words_if_no_results: Optional[RemoveWordsIfNoResults] = None advanced_syntax: Optional[bool] = None """ Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. """ - optional_words: Optional[List[str]] = None - """ 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). """ + optional_words: Optional[OptionalWords] = None disable_exact_on_attributes: Optional[List[str]] = None """ 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. """ exact_on_single_word_query: Optional[ExactOnSingleWordQuery] = None @@ -284,8 +286,6 @@ class FallbackParams(BaseModel): """ Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. """ response_fields: Optional[List[str]] = None """ Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. """ - max_facet_hits: Optional[int] = None - """ 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). """ max_values_per_facet: Optional[int] = None """ Maximum number of facet values to return for each facet. """ sort_facet_values_by: Optional[str] = None @@ -360,6 +360,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("aroundPrecision") is not None else None ) + obj["insideBoundingBox"] = ( + InsideBoundingBox.from_dict(obj["insideBoundingBox"]) + if obj.get("insideBoundingBox") is not None + else None + ) obj["naturalLanguages"] = obj.get("naturalLanguages") obj["indexLanguages"] = obj.get("indexLanguages") obj["typoTolerance"] = ( @@ -380,6 +385,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: obj["queryLanguages"] = obj.get("queryLanguages") obj["queryType"] = obj.get("queryType") obj["removeWordsIfNoResults"] = obj.get("removeWordsIfNoResults") + obj["optionalWords"] = ( + OptionalWords.from_dict(obj["optionalWords"]) + if obj.get("optionalWords") is not None + else None + ) obj["exactOnSingleWordQuery"] = obj.get("exactOnSingleWordQuery") obj["alternativesAsExact"] = obj.get("alternativesAsExact") obj["advancedSyntaxFeatures"] = obj.get("advancedSyntaxFeatures") diff --git a/clients/algoliasearch-client-python/algoliasearch/recommend/models/inside_bounding_box.py b/clients/algoliasearch-client-python/algoliasearch/recommend/models/inside_bounding_box.py new file mode 100644 index 0000000000..5c2edc0107 --- /dev/null +++ b/clients/algoliasearch-client-python/algoliasearch/recommend/models/inside_bounding_box.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" +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. +""" + +from __future__ import annotations + +from json import dumps, loads +from sys import version_info +from typing import Any, Dict, List, Optional, Set, Union + +from pydantic import BaseModel, Field, ValidationError, model_serializer + +if version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + + +class InsideBoundingBox(BaseModel): + """ + InsideBoundingBox + """ + + oneof_schema_1_validator: Optional[str] = Field(default=None) + + oneof_schema_2_validator: Optional[List[List[float]]] = Field(default=None) + """ 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). """ + actual_instance: Union[List[List[float]], str, None] = None + one_of_schemas: Set[str] = {"List[List[float]]", "str"} + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError( + "If a position argument is used, only 1 is allowed to set `actual_instance`" + ) + if kwargs: + raise ValueError( + "If a position argument is used, keyword arguments cannot be used." + ) + super().__init__(actual_instance=args[0]) # pyright: ignore + else: + super().__init__(**kwargs) + + @model_serializer + def unwrap_actual_instance(self) -> Union[List[List[float]], str, Self, None]: + """ + Unwraps the `actual_instance` when calling the `to_json` method. + """ + return self.actual_instance if hasattr(self, "actual_instance") else self + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + """Create an instance of InsideBoundingBox from a JSON string""" + return cls.from_json(dumps(obj)) + + @classmethod + def from_json(cls, json_str: Optional[str]) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + + try: + instance.oneof_schema_1_validator = loads(json_str) + instance.actual_instance = instance.oneof_schema_1_validator + + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + try: + instance.oneof_schema_2_validator = loads(json_str) + instance.actual_instance = instance.oneof_schema_2_validator + + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + raise ValueError( + "No match found when deserializing the JSON string into InsideBoundingBox with oneOf schemas: List[List[float]], str. Details: " + + ", ".join(error_messages) + ) + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable( + self.actual_instance.to_json # pyright: ignore + ): + return self.actual_instance.to_json() # pyright: ignore + else: + return dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[List[float]], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable( + self.actual_instance.to_dict # pyright: ignore + ): + return self.actual_instance.to_dict() # pyright: ignore + else: + return self.actual_instance # pyright: ignore diff --git a/clients/algoliasearch-client-python/algoliasearch/recommend/models/optional_words.py b/clients/algoliasearch-client-python/algoliasearch/recommend/models/optional_words.py new file mode 100644 index 0000000000..e19f73dd93 --- /dev/null +++ b/clients/algoliasearch-client-python/algoliasearch/recommend/models/optional_words.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" +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. +""" + +from __future__ import annotations + +from json import dumps, loads +from sys import version_info +from typing import Any, Dict, List, Optional, Set, Union + +from pydantic import BaseModel, Field, ValidationError, model_serializer + +if version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + + +class OptionalWords(BaseModel): + """ + OptionalWords + """ + + oneof_schema_1_validator: Optional[str] = Field(default=None) + + oneof_schema_2_validator: Optional[List[str]] = Field(default=None) + """ 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). """ + actual_instance: Union[List[str], str, None] = None + one_of_schemas: Set[str] = {"List[str]", "str"} + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError( + "If a position argument is used, only 1 is allowed to set `actual_instance`" + ) + if kwargs: + raise ValueError( + "If a position argument is used, keyword arguments cannot be used." + ) + super().__init__(actual_instance=args[0]) # pyright: ignore + else: + super().__init__(**kwargs) + + @model_serializer + def unwrap_actual_instance(self) -> Union[List[str], str, Self, None]: + """ + Unwraps the `actual_instance` when calling the `to_json` method. + """ + return self.actual_instance if hasattr(self, "actual_instance") else self + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + """Create an instance of OptionalWords from a JSON string""" + return cls.from_json(dumps(obj)) + + @classmethod + def from_json(cls, json_str: Optional[str]) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + + try: + instance.oneof_schema_1_validator = loads(json_str) + instance.actual_instance = instance.oneof_schema_1_validator + + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + try: + instance.oneof_schema_2_validator = loads(json_str) + instance.actual_instance = instance.oneof_schema_2_validator + + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + raise ValueError( + "No match found when deserializing the JSON string into OptionalWords with oneOf schemas: List[str], str. Details: " + + ", ".join(error_messages) + ) + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable( + self.actual_instance.to_json # pyright: ignore + ): + return self.actual_instance.to_json() # pyright: ignore + else: + return dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[str], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable( + self.actual_instance.to_dict # pyright: ignore + ): + return self.actual_instance.to_dict() # pyright: ignore + else: + return self.actual_instance # pyright: ignore diff --git a/clients/algoliasearch-client-python/algoliasearch/recommend/models/recommend_search_params.py b/clients/algoliasearch-client-python/algoliasearch/recommend/models/recommend_search_params.py index ccd6eb7898..5c36fe326e 100644 --- a/clients/algoliasearch-client-python/algoliasearch/recommend/models/recommend_search_params.py +++ b/clients/algoliasearch-client-python/algoliasearch/recommend/models/recommend_search_params.py @@ -30,8 +30,10 @@ ) from algoliasearch.recommend.models.facet_filters import FacetFilters from algoliasearch.recommend.models.ignore_plurals import IgnorePlurals +from algoliasearch.recommend.models.inside_bounding_box import InsideBoundingBox from algoliasearch.recommend.models.numeric_filters import NumericFilters from algoliasearch.recommend.models.optional_filters import OptionalFilters +from algoliasearch.recommend.models.optional_words import OptionalWords from algoliasearch.recommend.models.query_type import QueryType from algoliasearch.recommend.models.re_ranking_apply_filter import ReRankingApplyFilter from algoliasearch.recommend.models.remove_stop_words import RemoveStopWords @@ -90,6 +92,7 @@ "user_data": "userData", "custom_normalization": "customNormalization", "attribute_for_distinct": "attributeForDistinct", + "max_facet_hits": "maxFacetHits", "attributes_to_retrieve": "attributesToRetrieve", "ranking": "ranking", "relevancy_strictness": "relevancyStrictness", @@ -122,7 +125,6 @@ "replace_synonyms_in_highlight": "replaceSynonymsInHighlight", "min_proximity": "minProximity", "response_fields": "responseFields", - "max_facet_hits": "maxFacetHits", "max_values_per_facet": "maxValuesPerFacet", "sort_facet_values_by": "sortFacetValuesBy", "attribute_criteria_computed_by_min_proximity": "attributeCriteriaComputedByMinProximity", @@ -165,8 +167,7 @@ class RecommendSearchParams(BaseModel): around_precision: Optional[AroundPrecision] = None minimum_around_radius: Optional[int] = None """ Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. """ - inside_bounding_box: Optional[List[List[float]]] = None - """ 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). """ + inside_bounding_box: Optional[InsideBoundingBox] = None inside_polygon: Optional[List[List[float]]] = None """ 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`. """ natural_languages: Optional[List[SupportedLanguage]] = None @@ -227,6 +228,8 @@ class RecommendSearchParams(BaseModel): """ Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/). """ attribute_for_distinct: Optional[str] = None """ Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. """ + max_facet_hits: Optional[int] = None + """ 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). """ attributes_to_retrieve: Optional[List[str]] = None """ 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. """ ranking: Optional[List[str]] = None @@ -268,8 +271,7 @@ class RecommendSearchParams(BaseModel): remove_words_if_no_results: Optional[RemoveWordsIfNoResults] = None advanced_syntax: Optional[bool] = None """ Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. """ - optional_words: Optional[List[str]] = None - """ 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). """ + optional_words: Optional[OptionalWords] = None disable_exact_on_attributes: Optional[List[str]] = None """ 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. """ exact_on_single_word_query: Optional[ExactOnSingleWordQuery] = None @@ -284,8 +286,6 @@ class RecommendSearchParams(BaseModel): """ Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. """ response_fields: Optional[List[str]] = None """ Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. """ - max_facet_hits: Optional[int] = None - """ 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). """ max_values_per_facet: Optional[int] = None """ Maximum number of facet values to return for each facet. """ sort_facet_values_by: Optional[str] = None @@ -360,6 +360,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("aroundPrecision") is not None else None ) + obj["insideBoundingBox"] = ( + InsideBoundingBox.from_dict(obj["insideBoundingBox"]) + if obj.get("insideBoundingBox") is not None + else None + ) obj["naturalLanguages"] = obj.get("naturalLanguages") obj["indexLanguages"] = obj.get("indexLanguages") obj["typoTolerance"] = ( @@ -380,6 +385,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: obj["queryLanguages"] = obj.get("queryLanguages") obj["queryType"] = obj.get("queryType") obj["removeWordsIfNoResults"] = obj.get("removeWordsIfNoResults") + obj["optionalWords"] = ( + OptionalWords.from_dict(obj["optionalWords"]) + if obj.get("optionalWords") is not None + else None + ) obj["exactOnSingleWordQuery"] = obj.get("exactOnSingleWordQuery") obj["alternativesAsExact"] = obj.get("alternativesAsExact") obj["advancedSyntaxFeatures"] = obj.get("advancedSyntaxFeatures") diff --git a/clients/algoliasearch-client-python/algoliasearch/search/models/browse_params_object.py b/clients/algoliasearch-client-python/algoliasearch/search/models/browse_params_object.py index fd36dd39e6..f824e52350 100644 --- a/clients/algoliasearch-client-python/algoliasearch/search/models/browse_params_object.py +++ b/clients/algoliasearch-client-python/algoliasearch/search/models/browse_params_object.py @@ -28,9 +28,11 @@ ) from algoliasearch.search.models.facet_filters import FacetFilters from algoliasearch.search.models.ignore_plurals import IgnorePlurals +from algoliasearch.search.models.inside_bounding_box import InsideBoundingBox from algoliasearch.search.models.mode import Mode from algoliasearch.search.models.numeric_filters import NumericFilters from algoliasearch.search.models.optional_filters import OptionalFilters +from algoliasearch.search.models.optional_words import OptionalWords from algoliasearch.search.models.query_type import QueryType from algoliasearch.search.models.re_ranking_apply_filter import ReRankingApplyFilter from algoliasearch.search.models.remove_stop_words import RemoveStopWords @@ -113,7 +115,6 @@ "replace_synonyms_in_highlight": "replaceSynonymsInHighlight", "min_proximity": "minProximity", "response_fields": "responseFields", - "max_facet_hits": "maxFacetHits", "max_values_per_facet": "maxValuesPerFacet", "sort_facet_values_by": "sortFacetValuesBy", "attribute_criteria_computed_by_min_proximity": "attributeCriteriaComputedByMinProximity", @@ -165,8 +166,7 @@ class BrowseParamsObject(BaseModel): around_precision: Optional[AroundPrecision] = None minimum_around_radius: Optional[int] = None """ Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. """ - inside_bounding_box: Optional[List[List[float]]] = None - """ 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). """ + inside_bounding_box: Optional[InsideBoundingBox] = None inside_polygon: Optional[List[List[float]]] = None """ 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`. """ natural_languages: Optional[List[SupportedLanguage]] = None @@ -240,8 +240,7 @@ class BrowseParamsObject(BaseModel): semantic_search: Optional[SemanticSearch] = None advanced_syntax: Optional[bool] = None """ Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. """ - optional_words: Optional[List[str]] = None - """ 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). """ + optional_words: Optional[OptionalWords] = None disable_exact_on_attributes: Optional[List[str]] = None """ 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. """ exact_on_single_word_query: Optional[ExactOnSingleWordQuery] = None @@ -256,8 +255,6 @@ class BrowseParamsObject(BaseModel): """ Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. """ response_fields: Optional[List[str]] = None """ Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. """ - max_facet_hits: Optional[int] = None - """ 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). """ max_values_per_facet: Optional[int] = None """ Maximum number of facet values to return for each facet. """ sort_facet_values_by: Optional[str] = None @@ -334,6 +331,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("aroundPrecision") is not None else None ) + obj["insideBoundingBox"] = ( + InsideBoundingBox.from_dict(obj["insideBoundingBox"]) + if obj.get("insideBoundingBox") is not None + else None + ) obj["naturalLanguages"] = obj.get("naturalLanguages") obj["typoTolerance"] = ( TypoTolerance.from_dict(obj["typoTolerance"]) @@ -359,6 +361,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("semanticSearch") is not None else None ) + obj["optionalWords"] = ( + OptionalWords.from_dict(obj["optionalWords"]) + if obj.get("optionalWords") is not None + else None + ) obj["exactOnSingleWordQuery"] = obj.get("exactOnSingleWordQuery") obj["alternativesAsExact"] = obj.get("alternativesAsExact") obj["advancedSyntaxFeatures"] = obj.get("advancedSyntaxFeatures") diff --git a/clients/algoliasearch-client-python/algoliasearch/search/models/consequence_params.py b/clients/algoliasearch-client-python/algoliasearch/search/models/consequence_params.py index 69560ece37..e3d30241b7 100644 --- a/clients/algoliasearch-client-python/algoliasearch/search/models/consequence_params.py +++ b/clients/algoliasearch-client-python/algoliasearch/search/models/consequence_params.py @@ -30,9 +30,11 @@ ) from algoliasearch.search.models.facet_filters import FacetFilters from algoliasearch.search.models.ignore_plurals import IgnorePlurals +from algoliasearch.search.models.inside_bounding_box import InsideBoundingBox from algoliasearch.search.models.mode import Mode from algoliasearch.search.models.numeric_filters import NumericFilters from algoliasearch.search.models.optional_filters import OptionalFilters +from algoliasearch.search.models.optional_words import OptionalWords from algoliasearch.search.models.query_type import QueryType from algoliasearch.search.models.re_ranking_apply_filter import ReRankingApplyFilter from algoliasearch.search.models.remove_stop_words import RemoveStopWords @@ -114,7 +116,6 @@ "replace_synonyms_in_highlight": "replaceSynonymsInHighlight", "min_proximity": "minProximity", "response_fields": "responseFields", - "max_facet_hits": "maxFacetHits", "max_values_per_facet": "maxValuesPerFacet", "sort_facet_values_by": "sortFacetValuesBy", "attribute_criteria_computed_by_min_proximity": "attributeCriteriaComputedByMinProximity", @@ -166,8 +167,7 @@ class ConsequenceParams(BaseModel): around_precision: Optional[AroundPrecision] = None minimum_around_radius: Optional[int] = None """ Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. """ - inside_bounding_box: Optional[List[List[float]]] = None - """ 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). """ + inside_bounding_box: Optional[InsideBoundingBox] = None inside_polygon: Optional[List[List[float]]] = None """ 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`. """ natural_languages: Optional[List[SupportedLanguage]] = None @@ -241,8 +241,7 @@ class ConsequenceParams(BaseModel): semantic_search: Optional[SemanticSearch] = None advanced_syntax: Optional[bool] = None """ Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. """ - optional_words: Optional[List[str]] = None - """ 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). """ + optional_words: Optional[OptionalWords] = None disable_exact_on_attributes: Optional[List[str]] = None """ 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. """ exact_on_single_word_query: Optional[ExactOnSingleWordQuery] = None @@ -257,8 +256,6 @@ class ConsequenceParams(BaseModel): """ Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. """ response_fields: Optional[List[str]] = None """ Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. """ - max_facet_hits: Optional[int] = None - """ 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). """ max_values_per_facet: Optional[int] = None """ Maximum number of facet values to return for each facet. """ sort_facet_values_by: Optional[str] = None @@ -336,6 +333,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("aroundPrecision") is not None else None ) + obj["insideBoundingBox"] = ( + InsideBoundingBox.from_dict(obj["insideBoundingBox"]) + if obj.get("insideBoundingBox") is not None + else None + ) obj["naturalLanguages"] = obj.get("naturalLanguages") obj["typoTolerance"] = ( TypoTolerance.from_dict(obj["typoTolerance"]) @@ -361,6 +363,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("semanticSearch") is not None else None ) + obj["optionalWords"] = ( + OptionalWords.from_dict(obj["optionalWords"]) + if obj.get("optionalWords") is not None + else None + ) obj["exactOnSingleWordQuery"] = obj.get("exactOnSingleWordQuery") obj["alternativesAsExact"] = obj.get("alternativesAsExact") obj["advancedSyntaxFeatures"] = obj.get("advancedSyntaxFeatures") diff --git a/clients/algoliasearch-client-python/algoliasearch/search/models/delete_by_params.py b/clients/algoliasearch-client-python/algoliasearch/search/models/delete_by_params.py index fa4e0589be..3433f01d54 100644 --- a/clients/algoliasearch-client-python/algoliasearch/search/models/delete_by_params.py +++ b/clients/algoliasearch-client-python/algoliasearch/search/models/delete_by_params.py @@ -20,6 +20,7 @@ from algoliasearch.search.models.around_radius import AroundRadius from algoliasearch.search.models.facet_filters import FacetFilters +from algoliasearch.search.models.inside_bounding_box import InsideBoundingBox from algoliasearch.search.models.numeric_filters import NumericFilters from algoliasearch.search.models.tag_filters import TagFilters @@ -52,8 +53,7 @@ class DeleteByParams(BaseModel): around_lat_lng: Optional[str] = None """ Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within a circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`. """ around_radius: Optional[AroundRadius] = None - inside_bounding_box: Optional[List[List[float]]] = None - """ 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). """ + inside_bounding_box: Optional[InsideBoundingBox] = None inside_polygon: Optional[List[List[float]]] = None """ 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`. """ @@ -110,5 +110,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("aroundRadius") is not None else None ) + obj["insideBoundingBox"] = ( + InsideBoundingBox.from_dict(obj["insideBoundingBox"]) + if obj.get("insideBoundingBox") is not None + else None + ) return cls.model_validate(obj) diff --git a/clients/algoliasearch-client-python/algoliasearch/search/models/index_settings.py b/clients/algoliasearch-client-python/algoliasearch/search/models/index_settings.py index de2eb156dd..937aaa1e0f 100644 --- a/clients/algoliasearch-client-python/algoliasearch/search/models/index_settings.py +++ b/clients/algoliasearch-client-python/algoliasearch/search/models/index_settings.py @@ -26,6 +26,7 @@ ) from algoliasearch.search.models.ignore_plurals import IgnorePlurals from algoliasearch.search.models.mode import Mode +from algoliasearch.search.models.optional_words import OptionalWords from algoliasearch.search.models.query_type import QueryType from algoliasearch.search.models.re_ranking_apply_filter import ReRankingApplyFilter from algoliasearch.search.models.remove_stop_words import RemoveStopWords @@ -55,6 +56,7 @@ "user_data": "userData", "custom_normalization": "customNormalization", "attribute_for_distinct": "attributeForDistinct", + "max_facet_hits": "maxFacetHits", "attributes_to_retrieve": "attributesToRetrieve", "ranking": "ranking", "custom_ranking": "customRanking", @@ -92,7 +94,6 @@ "replace_synonyms_in_highlight": "replaceSynonymsInHighlight", "min_proximity": "minProximity", "response_fields": "responseFields", - "max_facet_hits": "maxFacetHits", "max_values_per_facet": "maxValuesPerFacet", "sort_facet_values_by": "sortFacetValuesBy", "attribute_criteria_computed_by_min_proximity": "attributeCriteriaComputedByMinProximity", @@ -145,6 +146,8 @@ class IndexSettings(BaseModel): """ Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/). """ attribute_for_distinct: Optional[str] = None """ Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. """ + max_facet_hits: Optional[int] = None + """ 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). """ attributes_to_retrieve: Optional[List[str]] = None """ 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. """ ranking: Optional[List[str]] = None @@ -194,8 +197,7 @@ class IndexSettings(BaseModel): semantic_search: Optional[SemanticSearch] = None advanced_syntax: Optional[bool] = None """ Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. """ - optional_words: Optional[List[str]] = None - """ 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). """ + optional_words: Optional[OptionalWords] = None disable_exact_on_attributes: Optional[List[str]] = None """ 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. """ exact_on_single_word_query: Optional[ExactOnSingleWordQuery] = None @@ -210,8 +212,6 @@ class IndexSettings(BaseModel): """ Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. """ response_fields: Optional[List[str]] = None """ Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. """ - max_facet_hits: Optional[int] = None - """ 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). """ max_values_per_facet: Optional[int] = None """ Maximum number of facet values to return for each facet. """ sort_facet_values_by: Optional[str] = None @@ -281,6 +281,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("semanticSearch") is not None else None ) + obj["optionalWords"] = ( + OptionalWords.from_dict(obj["optionalWords"]) + if obj.get("optionalWords") is not None + else None + ) obj["exactOnSingleWordQuery"] = obj.get("exactOnSingleWordQuery") obj["alternativesAsExact"] = obj.get("alternativesAsExact") obj["advancedSyntaxFeatures"] = obj.get("advancedSyntaxFeatures") diff --git a/clients/algoliasearch-client-python/algoliasearch/search/models/inside_bounding_box.py b/clients/algoliasearch-client-python/algoliasearch/search/models/inside_bounding_box.py new file mode 100644 index 0000000000..5c2edc0107 --- /dev/null +++ b/clients/algoliasearch-client-python/algoliasearch/search/models/inside_bounding_box.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" +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. +""" + +from __future__ import annotations + +from json import dumps, loads +from sys import version_info +from typing import Any, Dict, List, Optional, Set, Union + +from pydantic import BaseModel, Field, ValidationError, model_serializer + +if version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + + +class InsideBoundingBox(BaseModel): + """ + InsideBoundingBox + """ + + oneof_schema_1_validator: Optional[str] = Field(default=None) + + oneof_schema_2_validator: Optional[List[List[float]]] = Field(default=None) + """ 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). """ + actual_instance: Union[List[List[float]], str, None] = None + one_of_schemas: Set[str] = {"List[List[float]]", "str"} + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError( + "If a position argument is used, only 1 is allowed to set `actual_instance`" + ) + if kwargs: + raise ValueError( + "If a position argument is used, keyword arguments cannot be used." + ) + super().__init__(actual_instance=args[0]) # pyright: ignore + else: + super().__init__(**kwargs) + + @model_serializer + def unwrap_actual_instance(self) -> Union[List[List[float]], str, Self, None]: + """ + Unwraps the `actual_instance` when calling the `to_json` method. + """ + return self.actual_instance if hasattr(self, "actual_instance") else self + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + """Create an instance of InsideBoundingBox from a JSON string""" + return cls.from_json(dumps(obj)) + + @classmethod + def from_json(cls, json_str: Optional[str]) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + + try: + instance.oneof_schema_1_validator = loads(json_str) + instance.actual_instance = instance.oneof_schema_1_validator + + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + try: + instance.oneof_schema_2_validator = loads(json_str) + instance.actual_instance = instance.oneof_schema_2_validator + + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + raise ValueError( + "No match found when deserializing the JSON string into InsideBoundingBox with oneOf schemas: List[List[float]], str. Details: " + + ", ".join(error_messages) + ) + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable( + self.actual_instance.to_json # pyright: ignore + ): + return self.actual_instance.to_json() # pyright: ignore + else: + return dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[List[float]], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable( + self.actual_instance.to_dict # pyright: ignore + ): + return self.actual_instance.to_dict() # pyright: ignore + else: + return self.actual_instance # pyright: ignore diff --git a/clients/algoliasearch-client-python/algoliasearch/search/models/optional_words.py b/clients/algoliasearch-client-python/algoliasearch/search/models/optional_words.py new file mode 100644 index 0000000000..e19f73dd93 --- /dev/null +++ b/clients/algoliasearch-client-python/algoliasearch/search/models/optional_words.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" +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. +""" + +from __future__ import annotations + +from json import dumps, loads +from sys import version_info +from typing import Any, Dict, List, Optional, Set, Union + +from pydantic import BaseModel, Field, ValidationError, model_serializer + +if version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + + +class OptionalWords(BaseModel): + """ + OptionalWords + """ + + oneof_schema_1_validator: Optional[str] = Field(default=None) + + oneof_schema_2_validator: Optional[List[str]] = Field(default=None) + """ 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). """ + actual_instance: Union[List[str], str, None] = None + one_of_schemas: Set[str] = {"List[str]", "str"} + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError( + "If a position argument is used, only 1 is allowed to set `actual_instance`" + ) + if kwargs: + raise ValueError( + "If a position argument is used, keyword arguments cannot be used." + ) + super().__init__(actual_instance=args[0]) # pyright: ignore + else: + super().__init__(**kwargs) + + @model_serializer + def unwrap_actual_instance(self) -> Union[List[str], str, Self, None]: + """ + Unwraps the `actual_instance` when calling the `to_json` method. + """ + return self.actual_instance if hasattr(self, "actual_instance") else self + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + """Create an instance of OptionalWords from a JSON string""" + return cls.from_json(dumps(obj)) + + @classmethod + def from_json(cls, json_str: Optional[str]) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + + try: + instance.oneof_schema_1_validator = loads(json_str) + instance.actual_instance = instance.oneof_schema_1_validator + + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + try: + instance.oneof_schema_2_validator = loads(json_str) + instance.actual_instance = instance.oneof_schema_2_validator + + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + raise ValueError( + "No match found when deserializing the JSON string into OptionalWords with oneOf schemas: List[str], str. Details: " + + ", ".join(error_messages) + ) + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable( + self.actual_instance.to_json # pyright: ignore + ): + return self.actual_instance.to_json() # pyright: ignore + else: + return dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[str], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable( + self.actual_instance.to_dict # pyright: ignore + ): + return self.actual_instance.to_dict() # pyright: ignore + else: + return self.actual_instance # pyright: ignore diff --git a/clients/algoliasearch-client-python/algoliasearch/search/models/search_for_facets.py b/clients/algoliasearch-client-python/algoliasearch/search/models/search_for_facets.py index 709521b1c3..13c88abeb1 100644 --- a/clients/algoliasearch-client-python/algoliasearch/search/models/search_for_facets.py +++ b/clients/algoliasearch-client-python/algoliasearch/search/models/search_for_facets.py @@ -28,9 +28,11 @@ ) from algoliasearch.search.models.facet_filters import FacetFilters from algoliasearch.search.models.ignore_plurals import IgnorePlurals +from algoliasearch.search.models.inside_bounding_box import InsideBoundingBox from algoliasearch.search.models.mode import Mode from algoliasearch.search.models.numeric_filters import NumericFilters from algoliasearch.search.models.optional_filters import OptionalFilters +from algoliasearch.search.models.optional_words import OptionalWords from algoliasearch.search.models.query_type import QueryType from algoliasearch.search.models.re_ranking_apply_filter import ReRankingApplyFilter from algoliasearch.search.models.remove_stop_words import RemoveStopWords @@ -115,7 +117,6 @@ "replace_synonyms_in_highlight": "replaceSynonymsInHighlight", "min_proximity": "minProximity", "response_fields": "responseFields", - "max_facet_hits": "maxFacetHits", "max_values_per_facet": "maxValuesPerFacet", "sort_facet_values_by": "sortFacetValuesBy", "attribute_criteria_computed_by_min_proximity": "attributeCriteriaComputedByMinProximity", @@ -125,6 +126,7 @@ "facet": "facet", "index_name": "indexName", "facet_query": "facetQuery", + "max_facet_hits": "maxFacetHits", "type": "type", } @@ -172,8 +174,7 @@ class SearchForFacets(BaseModel): around_precision: Optional[AroundPrecision] = None minimum_around_radius: Optional[int] = None """ Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. """ - inside_bounding_box: Optional[List[List[float]]] = None - """ 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). """ + inside_bounding_box: Optional[InsideBoundingBox] = None inside_polygon: Optional[List[List[float]]] = None """ 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`. """ natural_languages: Optional[List[SupportedLanguage]] = None @@ -247,8 +248,7 @@ class SearchForFacets(BaseModel): semantic_search: Optional[SemanticSearch] = None advanced_syntax: Optional[bool] = None """ Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. """ - optional_words: Optional[List[str]] = None - """ 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). """ + optional_words: Optional[OptionalWords] = None disable_exact_on_attributes: Optional[List[str]] = None """ 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. """ exact_on_single_word_query: Optional[ExactOnSingleWordQuery] = None @@ -263,8 +263,6 @@ class SearchForFacets(BaseModel): """ Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. """ response_fields: Optional[List[str]] = None """ Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. """ - max_facet_hits: Optional[int] = None - """ 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). """ max_values_per_facet: Optional[int] = None """ Maximum number of facet values to return for each facet. """ sort_facet_values_by: Optional[str] = None @@ -281,6 +279,8 @@ class SearchForFacets(BaseModel): """ Index name (case-sensitive). """ facet_query: Optional[str] = None """ Text to search inside the facet's values. """ + max_facet_hits: Optional[int] = None + """ 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). """ type: SearchTypeFacet model_config = ConfigDict( @@ -346,6 +346,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("aroundPrecision") is not None else None ) + obj["insideBoundingBox"] = ( + InsideBoundingBox.from_dict(obj["insideBoundingBox"]) + if obj.get("insideBoundingBox") is not None + else None + ) obj["naturalLanguages"] = obj.get("naturalLanguages") obj["typoTolerance"] = ( TypoTolerance.from_dict(obj["typoTolerance"]) @@ -371,6 +376,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("semanticSearch") is not None else None ) + obj["optionalWords"] = ( + OptionalWords.from_dict(obj["optionalWords"]) + if obj.get("optionalWords") is not None + else None + ) obj["exactOnSingleWordQuery"] = obj.get("exactOnSingleWordQuery") obj["alternativesAsExact"] = obj.get("alternativesAsExact") obj["advancedSyntaxFeatures"] = obj.get("advancedSyntaxFeatures") diff --git a/clients/algoliasearch-client-python/algoliasearch/search/models/search_for_hits.py b/clients/algoliasearch-client-python/algoliasearch/search/models/search_for_hits.py index 03efe92461..aa6f16b4a8 100644 --- a/clients/algoliasearch-client-python/algoliasearch/search/models/search_for_hits.py +++ b/clients/algoliasearch-client-python/algoliasearch/search/models/search_for_hits.py @@ -28,9 +28,11 @@ ) from algoliasearch.search.models.facet_filters import FacetFilters from algoliasearch.search.models.ignore_plurals import IgnorePlurals +from algoliasearch.search.models.inside_bounding_box import InsideBoundingBox from algoliasearch.search.models.mode import Mode from algoliasearch.search.models.numeric_filters import NumericFilters from algoliasearch.search.models.optional_filters import OptionalFilters +from algoliasearch.search.models.optional_words import OptionalWords from algoliasearch.search.models.query_type import QueryType from algoliasearch.search.models.re_ranking_apply_filter import ReRankingApplyFilter from algoliasearch.search.models.remove_stop_words import RemoveStopWords @@ -115,7 +117,6 @@ "replace_synonyms_in_highlight": "replaceSynonymsInHighlight", "min_proximity": "minProximity", "response_fields": "responseFields", - "max_facet_hits": "maxFacetHits", "max_values_per_facet": "maxValuesPerFacet", "sort_facet_values_by": "sortFacetValuesBy", "attribute_criteria_computed_by_min_proximity": "attributeCriteriaComputedByMinProximity", @@ -170,8 +171,7 @@ class SearchForHits(BaseModel): around_precision: Optional[AroundPrecision] = None minimum_around_radius: Optional[int] = None """ Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. """ - inside_bounding_box: Optional[List[List[float]]] = None - """ 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). """ + inside_bounding_box: Optional[InsideBoundingBox] = None inside_polygon: Optional[List[List[float]]] = None """ 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`. """ natural_languages: Optional[List[SupportedLanguage]] = None @@ -245,8 +245,7 @@ class SearchForHits(BaseModel): semantic_search: Optional[SemanticSearch] = None advanced_syntax: Optional[bool] = None """ Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. """ - optional_words: Optional[List[str]] = None - """ 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). """ + optional_words: Optional[OptionalWords] = None disable_exact_on_attributes: Optional[List[str]] = None """ 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. """ exact_on_single_word_query: Optional[ExactOnSingleWordQuery] = None @@ -261,8 +260,6 @@ class SearchForHits(BaseModel): """ Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. """ response_fields: Optional[List[str]] = None """ Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. """ - max_facet_hits: Optional[int] = None - """ 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). """ max_values_per_facet: Optional[int] = None """ Maximum number of facet values to return for each facet. """ sort_facet_values_by: Optional[str] = None @@ -340,6 +337,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("aroundPrecision") is not None else None ) + obj["insideBoundingBox"] = ( + InsideBoundingBox.from_dict(obj["insideBoundingBox"]) + if obj.get("insideBoundingBox") is not None + else None + ) obj["naturalLanguages"] = obj.get("naturalLanguages") obj["typoTolerance"] = ( TypoTolerance.from_dict(obj["typoTolerance"]) @@ -365,6 +367,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("semanticSearch") is not None else None ) + obj["optionalWords"] = ( + OptionalWords.from_dict(obj["optionalWords"]) + if obj.get("optionalWords") is not None + else None + ) obj["exactOnSingleWordQuery"] = obj.get("exactOnSingleWordQuery") obj["alternativesAsExact"] = obj.get("alternativesAsExact") obj["advancedSyntaxFeatures"] = obj.get("advancedSyntaxFeatures") diff --git a/clients/algoliasearch-client-python/algoliasearch/search/models/search_params_object.py b/clients/algoliasearch-client-python/algoliasearch/search/models/search_params_object.py index 9885d151b1..4078c2085d 100644 --- a/clients/algoliasearch-client-python/algoliasearch/search/models/search_params_object.py +++ b/clients/algoliasearch-client-python/algoliasearch/search/models/search_params_object.py @@ -28,9 +28,11 @@ ) from algoliasearch.search.models.facet_filters import FacetFilters from algoliasearch.search.models.ignore_plurals import IgnorePlurals +from algoliasearch.search.models.inside_bounding_box import InsideBoundingBox from algoliasearch.search.models.mode import Mode from algoliasearch.search.models.numeric_filters import NumericFilters from algoliasearch.search.models.optional_filters import OptionalFilters +from algoliasearch.search.models.optional_words import OptionalWords from algoliasearch.search.models.query_type import QueryType from algoliasearch.search.models.re_ranking_apply_filter import ReRankingApplyFilter from algoliasearch.search.models.remove_stop_words import RemoveStopWords @@ -113,7 +115,6 @@ "replace_synonyms_in_highlight": "replaceSynonymsInHighlight", "min_proximity": "minProximity", "response_fields": "responseFields", - "max_facet_hits": "maxFacetHits", "max_values_per_facet": "maxValuesPerFacet", "sort_facet_values_by": "sortFacetValuesBy", "attribute_criteria_computed_by_min_proximity": "attributeCriteriaComputedByMinProximity", @@ -164,8 +165,7 @@ class SearchParamsObject(BaseModel): around_precision: Optional[AroundPrecision] = None minimum_around_radius: Optional[int] = None """ Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. """ - inside_bounding_box: Optional[List[List[float]]] = None - """ 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). """ + inside_bounding_box: Optional[InsideBoundingBox] = None inside_polygon: Optional[List[List[float]]] = None """ 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`. """ natural_languages: Optional[List[SupportedLanguage]] = None @@ -239,8 +239,7 @@ class SearchParamsObject(BaseModel): semantic_search: Optional[SemanticSearch] = None advanced_syntax: Optional[bool] = None """ Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. """ - optional_words: Optional[List[str]] = None - """ 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). """ + optional_words: Optional[OptionalWords] = None disable_exact_on_attributes: Optional[List[str]] = None """ 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. """ exact_on_single_word_query: Optional[ExactOnSingleWordQuery] = None @@ -255,8 +254,6 @@ class SearchParamsObject(BaseModel): """ Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. """ response_fields: Optional[List[str]] = None """ Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. """ - max_facet_hits: Optional[int] = None - """ 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). """ max_values_per_facet: Optional[int] = None """ Maximum number of facet values to return for each facet. """ sort_facet_values_by: Optional[str] = None @@ -331,6 +328,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("aroundPrecision") is not None else None ) + obj["insideBoundingBox"] = ( + InsideBoundingBox.from_dict(obj["insideBoundingBox"]) + if obj.get("insideBoundingBox") is not None + else None + ) obj["naturalLanguages"] = obj.get("naturalLanguages") obj["typoTolerance"] = ( TypoTolerance.from_dict(obj["typoTolerance"]) @@ -356,6 +358,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("semanticSearch") is not None else None ) + obj["optionalWords"] = ( + OptionalWords.from_dict(obj["optionalWords"]) + if obj.get("optionalWords") is not None + else None + ) obj["exactOnSingleWordQuery"] = obj.get("exactOnSingleWordQuery") obj["alternativesAsExact"] = obj.get("alternativesAsExact") obj["advancedSyntaxFeatures"] = obj.get("advancedSyntaxFeatures") diff --git a/clients/algoliasearch-client-python/algoliasearch/search/models/settings_response.py b/clients/algoliasearch-client-python/algoliasearch/search/models/settings_response.py index 033bf3c2e4..82c6721cf6 100644 --- a/clients/algoliasearch-client-python/algoliasearch/search/models/settings_response.py +++ b/clients/algoliasearch-client-python/algoliasearch/search/models/settings_response.py @@ -26,6 +26,7 @@ ) from algoliasearch.search.models.ignore_plurals import IgnorePlurals from algoliasearch.search.models.mode import Mode +from algoliasearch.search.models.optional_words import OptionalWords from algoliasearch.search.models.query_type import QueryType from algoliasearch.search.models.re_ranking_apply_filter import ReRankingApplyFilter from algoliasearch.search.models.remove_stop_words import RemoveStopWords @@ -55,6 +56,7 @@ "user_data": "userData", "custom_normalization": "customNormalization", "attribute_for_distinct": "attributeForDistinct", + "max_facet_hits": "maxFacetHits", "attributes_to_retrieve": "attributesToRetrieve", "ranking": "ranking", "custom_ranking": "customRanking", @@ -92,7 +94,6 @@ "replace_synonyms_in_highlight": "replaceSynonymsInHighlight", "min_proximity": "minProximity", "response_fields": "responseFields", - "max_facet_hits": "maxFacetHits", "max_values_per_facet": "maxValuesPerFacet", "sort_facet_values_by": "sortFacetValuesBy", "attribute_criteria_computed_by_min_proximity": "attributeCriteriaComputedByMinProximity", @@ -146,6 +147,8 @@ class SettingsResponse(BaseModel): """ Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/). """ attribute_for_distinct: Optional[str] = None """ Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. """ + max_facet_hits: Optional[int] = None + """ 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). """ attributes_to_retrieve: Optional[List[str]] = None """ 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. """ ranking: Optional[List[str]] = None @@ -195,8 +198,7 @@ class SettingsResponse(BaseModel): semantic_search: Optional[SemanticSearch] = None advanced_syntax: Optional[bool] = None """ Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. """ - optional_words: Optional[List[str]] = None - """ 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). """ + optional_words: Optional[OptionalWords] = None disable_exact_on_attributes: Optional[List[str]] = None """ 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. """ exact_on_single_word_query: Optional[ExactOnSingleWordQuery] = None @@ -211,8 +213,6 @@ class SettingsResponse(BaseModel): """ Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. """ response_fields: Optional[List[str]] = None """ Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. """ - max_facet_hits: Optional[int] = None - """ 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). """ max_values_per_facet: Optional[int] = None """ Maximum number of facet values to return for each facet. """ sort_facet_values_by: Optional[str] = None @@ -284,6 +284,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("semanticSearch") is not None else None ) + obj["optionalWords"] = ( + OptionalWords.from_dict(obj["optionalWords"]) + if obj.get("optionalWords") is not None + else None + ) obj["exactOnSingleWordQuery"] = obj.get("exactOnSingleWordQuery") obj["alternativesAsExact"] = obj.get("alternativesAsExact") obj["advancedSyntaxFeatures"] = obj.get("advancedSyntaxFeatures") diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/fallback_params.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/fallback_params.rb index fbf91b76b8..9aa83006c4 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/fallback_params.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/fallback_params.rb @@ -45,7 +45,6 @@ class FallbackParams # Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. attr_accessor :minimum_around_radius - # 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). attr_accessor :inside_bounding_box # 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`. @@ -138,6 +137,9 @@ class FallbackParams # Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. attr_accessor :attribute_for_distinct + # 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). + attr_accessor :max_facet_hits + # 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. attr_accessor :attributes_to_retrieve @@ -202,7 +204,6 @@ class FallbackParams # Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. attr_accessor :advanced_syntax - # 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). attr_accessor :optional_words # 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. @@ -227,9 +228,6 @@ class FallbackParams # Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. attr_accessor :response_fields - # 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). - attr_accessor :max_facet_hits - # Maximum number of facet values to return for each facet. attr_accessor :max_values_per_facet @@ -295,6 +293,7 @@ def self.attribute_map :user_data => :userData, :custom_normalization => :customNormalization, :attribute_for_distinct => :attributeForDistinct, + :max_facet_hits => :maxFacetHits, :attributes_to_retrieve => :attributesToRetrieve, :ranking => :ranking, :relevancy_strictness => :relevancyStrictness, @@ -327,7 +326,6 @@ def self.attribute_map :replace_synonyms_in_highlight => :replaceSynonymsInHighlight, :min_proximity => :minProximity, :response_fields => :responseFields, - :max_facet_hits => :maxFacetHits, :max_values_per_facet => :maxValuesPerFacet, :sort_facet_values_by => :sortFacetValuesBy, :attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity, @@ -360,7 +358,7 @@ def self.types_mapping :around_radius => :"AroundRadius", :around_precision => :"AroundPrecision", :minimum_around_radius => :"Integer", - :inside_bounding_box => :"Array>", + :inside_bounding_box => :"InsideBoundingBox", :inside_polygon => :"Array>", :natural_languages => :"Array", :rule_contexts => :"Array", @@ -391,6 +389,7 @@ def self.types_mapping :user_data => :"Object", :custom_normalization => :"Hash>", :attribute_for_distinct => :"String", + :max_facet_hits => :"Integer", :attributes_to_retrieve => :"Array", :ranking => :"Array", :relevancy_strictness => :"Integer", @@ -414,7 +413,7 @@ def self.types_mapping :query_type => :"QueryType", :remove_words_if_no_results => :"RemoveWordsIfNoResults", :advanced_syntax => :"Boolean", - :optional_words => :"Array", + :optional_words => :"OptionalWords", :disable_exact_on_attributes => :"Array", :exact_on_single_word_query => :"ExactOnSingleWordQuery", :alternatives_as_exact => :"Array", @@ -423,7 +422,6 @@ def self.types_mapping :replace_synonyms_in_highlight => :"Boolean", :min_proximity => :"Integer", :response_fields => :"Array", - :max_facet_hits => :"Integer", :max_values_per_facet => :"Integer", :sort_facet_values_by => :"String", :attribute_criteria_computed_by_min_proximity => :"Boolean", @@ -436,7 +434,10 @@ def self.types_mapping # List of attributes with nullable: true def self.openapi_nullable Set.new( - [] + [ + :inside_bounding_box, + :optional_words + ] ) end @@ -535,9 +536,7 @@ def initialize(attributes = {}) end if attributes.key?(:inside_bounding_box) - if (value = attributes[:inside_bounding_box]).is_a?(Array) - self.inside_bounding_box = value - end + self.inside_bounding_box = attributes[:inside_bounding_box] end if attributes.key?(:inside_polygon) @@ -690,6 +689,10 @@ def initialize(attributes = {}) self.attribute_for_distinct = attributes[:attribute_for_distinct] end + if attributes.key?(:max_facet_hits) + self.max_facet_hits = attributes[:max_facet_hits] + end + if attributes.key?(:attributes_to_retrieve) if (value = attributes[:attributes_to_retrieve]).is_a?(Array) self.attributes_to_retrieve = value @@ -795,9 +798,7 @@ def initialize(attributes = {}) end if attributes.key?(:optional_words) - if (value = attributes[:optional_words]).is_a?(Array) - self.optional_words = value - end + self.optional_words = attributes[:optional_words] end if attributes.key?(:disable_exact_on_attributes) @@ -840,10 +841,6 @@ def initialize(attributes = {}) end end - if attributes.key?(:max_facet_hits) - self.max_facet_hits = attributes[:max_facet_hits] - end - if attributes.key?(:max_values_per_facet) self.max_values_per_facet = attributes[:max_values_per_facet] end @@ -920,6 +917,7 @@ def ==(other) user_data == other.user_data && custom_normalization == other.custom_normalization && attribute_for_distinct == other.attribute_for_distinct && + max_facet_hits == other.max_facet_hits && attributes_to_retrieve == other.attributes_to_retrieve && ranking == other.ranking && relevancy_strictness == other.relevancy_strictness && @@ -952,7 +950,6 @@ def ==(other) replace_synonyms_in_highlight == other.replace_synonyms_in_highlight && min_proximity == other.min_proximity && response_fields == other.response_fields && - max_facet_hits == other.max_facet_hits && max_values_per_facet == other.max_values_per_facet && sort_facet_values_by == other.sort_facet_values_by && attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity && @@ -1017,6 +1014,7 @@ def hash user_data, custom_normalization, attribute_for_distinct, + max_facet_hits, attributes_to_retrieve, ranking, relevancy_strictness, @@ -1049,7 +1047,6 @@ def hash replace_synonyms_in_highlight, min_proximity, response_fields, - max_facet_hits, max_values_per_facet, sort_facet_values_by, attribute_criteria_computed_by_min_proximity, diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/inside_bounding_box.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/inside_bounding_box.rb new file mode 100644 index 0000000000..4f2924262f --- /dev/null +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/inside_bounding_box.rb @@ -0,0 +1,108 @@ +# 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. + +require "date" +require "time" + +module Algolia + module Recommend + module InsideBoundingBox + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :"Array>", + :"String" + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + # "nullable: true" + next if klass == :AnyType + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + # rescue all errors so we keep iterating even if the current item lookup raises + rescue + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when "Boolean" + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when "Float" + return data if data.instance_of?(Float) + when "Integer" + return data if data.instance_of?(Integer) + when "Time" + return Time.parse(data) + when "Date" + return Date.parse(data) + when "String" + return data if data.instance_of?(String) + # "type: object" + when "Object" + return data if data.instance_of?(Hash) + # "type: array" + when /\AArray<(?.+)>\z/ + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + # "type: object" with "additionalProperties: { ... }" + when /\AHash.+)>\z/ + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + # model + else + const = Algolia::Recommend.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) + # nested oneOf model + model = const.build(data) + elsif const.respond_to?(:acceptable_attributes) + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + else + # maybe it's an enum + model = const.build_from_hash(data) + end + + return model if model + end + end + + # if no match by now, raise + raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + + end +end diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/optional_words.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/optional_words.rb new file mode 100644 index 0000000000..f1af98c6a6 --- /dev/null +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/optional_words.rb @@ -0,0 +1,108 @@ +# 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. + +require "date" +require "time" + +module Algolia + module Recommend + module OptionalWords + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :"Array", + :"String" + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + # "nullable: true" + next if klass == :AnyType + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + # rescue all errors so we keep iterating even if the current item lookup raises + rescue + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when "Boolean" + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when "Float" + return data if data.instance_of?(Float) + when "Integer" + return data if data.instance_of?(Integer) + when "Time" + return Time.parse(data) + when "Date" + return Date.parse(data) + when "String" + return data if data.instance_of?(String) + # "type: object" + when "Object" + return data if data.instance_of?(Hash) + # "type: array" + when /\AArray<(?.+)>\z/ + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + # "type: object" with "additionalProperties: { ... }" + when /\AHash.+)>\z/ + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + # model + else + const = Algolia::Recommend.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) + # nested oneOf model + model = const.build(data) + elsif const.respond_to?(:acceptable_attributes) + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + else + # maybe it's an enum + model = const.build_from_hash(data) + end + + return model if model + end + end + + # if no match by now, raise + raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + + end +end diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommend_search_params.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommend_search_params.rb index 4253c8e85d..d7e6a02342 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommend_search_params.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommend_search_params.rb @@ -46,7 +46,6 @@ class RecommendSearchParams # Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. attr_accessor :minimum_around_radius - # 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). attr_accessor :inside_bounding_box # 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`. @@ -139,6 +138,9 @@ class RecommendSearchParams # Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. attr_accessor :attribute_for_distinct + # 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). + attr_accessor :max_facet_hits + # 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. attr_accessor :attributes_to_retrieve @@ -203,7 +205,6 @@ class RecommendSearchParams # Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. attr_accessor :advanced_syntax - # 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). attr_accessor :optional_words # 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. @@ -228,9 +229,6 @@ class RecommendSearchParams # Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. attr_accessor :response_fields - # 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). - attr_accessor :max_facet_hits - # Maximum number of facet values to return for each facet. attr_accessor :max_values_per_facet @@ -296,6 +294,7 @@ def self.attribute_map :user_data => :userData, :custom_normalization => :customNormalization, :attribute_for_distinct => :attributeForDistinct, + :max_facet_hits => :maxFacetHits, :attributes_to_retrieve => :attributesToRetrieve, :ranking => :ranking, :relevancy_strictness => :relevancyStrictness, @@ -328,7 +327,6 @@ def self.attribute_map :replace_synonyms_in_highlight => :replaceSynonymsInHighlight, :min_proximity => :minProximity, :response_fields => :responseFields, - :max_facet_hits => :maxFacetHits, :max_values_per_facet => :maxValuesPerFacet, :sort_facet_values_by => :sortFacetValuesBy, :attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity, @@ -361,7 +359,7 @@ def self.types_mapping :around_radius => :"AroundRadius", :around_precision => :"AroundPrecision", :minimum_around_radius => :"Integer", - :inside_bounding_box => :"Array>", + :inside_bounding_box => :"InsideBoundingBox", :inside_polygon => :"Array>", :natural_languages => :"Array", :rule_contexts => :"Array", @@ -392,6 +390,7 @@ def self.types_mapping :user_data => :"Object", :custom_normalization => :"Hash>", :attribute_for_distinct => :"String", + :max_facet_hits => :"Integer", :attributes_to_retrieve => :"Array", :ranking => :"Array", :relevancy_strictness => :"Integer", @@ -415,7 +414,7 @@ def self.types_mapping :query_type => :"QueryType", :remove_words_if_no_results => :"RemoveWordsIfNoResults", :advanced_syntax => :"Boolean", - :optional_words => :"Array", + :optional_words => :"OptionalWords", :disable_exact_on_attributes => :"Array", :exact_on_single_word_query => :"ExactOnSingleWordQuery", :alternatives_as_exact => :"Array", @@ -424,7 +423,6 @@ def self.types_mapping :replace_synonyms_in_highlight => :"Boolean", :min_proximity => :"Integer", :response_fields => :"Array", - :max_facet_hits => :"Integer", :max_values_per_facet => :"Integer", :sort_facet_values_by => :"String", :attribute_criteria_computed_by_min_proximity => :"Boolean", @@ -437,7 +435,10 @@ def self.types_mapping # List of attributes with nullable: true def self.openapi_nullable Set.new( - [] + [ + :inside_bounding_box, + :optional_words + ] ) end @@ -538,9 +539,7 @@ def initialize(attributes = {}) end if attributes.key?(:inside_bounding_box) - if (value = attributes[:inside_bounding_box]).is_a?(Array) - self.inside_bounding_box = value - end + self.inside_bounding_box = attributes[:inside_bounding_box] end if attributes.key?(:inside_polygon) @@ -693,6 +692,10 @@ def initialize(attributes = {}) self.attribute_for_distinct = attributes[:attribute_for_distinct] end + if attributes.key?(:max_facet_hits) + self.max_facet_hits = attributes[:max_facet_hits] + end + if attributes.key?(:attributes_to_retrieve) if (value = attributes[:attributes_to_retrieve]).is_a?(Array) self.attributes_to_retrieve = value @@ -798,9 +801,7 @@ def initialize(attributes = {}) end if attributes.key?(:optional_words) - if (value = attributes[:optional_words]).is_a?(Array) - self.optional_words = value - end + self.optional_words = attributes[:optional_words] end if attributes.key?(:disable_exact_on_attributes) @@ -843,10 +844,6 @@ def initialize(attributes = {}) end end - if attributes.key?(:max_facet_hits) - self.max_facet_hits = attributes[:max_facet_hits] - end - if attributes.key?(:max_values_per_facet) self.max_values_per_facet = attributes[:max_values_per_facet] end @@ -923,6 +920,7 @@ def ==(other) user_data == other.user_data && custom_normalization == other.custom_normalization && attribute_for_distinct == other.attribute_for_distinct && + max_facet_hits == other.max_facet_hits && attributes_to_retrieve == other.attributes_to_retrieve && ranking == other.ranking && relevancy_strictness == other.relevancy_strictness && @@ -955,7 +953,6 @@ def ==(other) replace_synonyms_in_highlight == other.replace_synonyms_in_highlight && min_proximity == other.min_proximity && response_fields == other.response_fields && - max_facet_hits == other.max_facet_hits && max_values_per_facet == other.max_values_per_facet && sort_facet_values_by == other.sort_facet_values_by && attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity && @@ -1020,6 +1017,7 @@ def hash user_data, custom_normalization, attribute_for_distinct, + max_facet_hits, attributes_to_retrieve, ranking, relevancy_strictness, @@ -1052,7 +1050,6 @@ def hash replace_synonyms_in_highlight, min_proximity, response_fields, - max_facet_hits, max_values_per_facet, sort_facet_values_by, attribute_criteria_computed_by_min_proximity, diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/search/browse_params_object.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/search/browse_params_object.rb index 85c331bd4a..67dab56a86 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/search/browse_params_object.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/search/browse_params_object.rb @@ -57,7 +57,6 @@ class BrowseParamsObject # Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. attr_accessor :minimum_around_radius - # 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). attr_accessor :inside_bounding_box # 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`. @@ -173,7 +172,6 @@ class BrowseParamsObject # Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. attr_accessor :advanced_syntax - # 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). attr_accessor :optional_words # 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. @@ -198,9 +196,6 @@ class BrowseParamsObject # Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. attr_accessor :response_fields - # 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). - attr_accessor :max_facet_hits - # Maximum number of facet values to return for each facet. attr_accessor :max_values_per_facet @@ -292,7 +287,6 @@ def self.attribute_map :replace_synonyms_in_highlight => :replaceSynonymsInHighlight, :min_proximity => :minProximity, :response_fields => :responseFields, - :max_facet_hits => :maxFacetHits, :max_values_per_facet => :maxValuesPerFacet, :sort_facet_values_by => :sortFacetValuesBy, :attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity, @@ -330,7 +324,7 @@ def self.types_mapping :around_radius => :"AroundRadius", :around_precision => :"AroundPrecision", :minimum_around_radius => :"Integer", - :inside_bounding_box => :"Array>", + :inside_bounding_box => :"InsideBoundingBox", :inside_polygon => :"Array>", :natural_languages => :"Array", :rule_contexts => :"Array", @@ -371,7 +365,7 @@ def self.types_mapping :mode => :"Mode", :semantic_search => :"SemanticSearch", :advanced_syntax => :"Boolean", - :optional_words => :"Array", + :optional_words => :"OptionalWords", :disable_exact_on_attributes => :"Array", :exact_on_single_word_query => :"ExactOnSingleWordQuery", :alternatives_as_exact => :"Array", @@ -380,7 +374,6 @@ def self.types_mapping :replace_synonyms_in_highlight => :"Boolean", :min_proximity => :"Integer", :response_fields => :"Array", - :max_facet_hits => :"Integer", :max_values_per_facet => :"Integer", :sort_facet_values_by => :"String", :attribute_criteria_computed_by_min_proximity => :"Boolean", @@ -394,7 +387,10 @@ def self.types_mapping # List of attributes with nullable: true def self.openapi_nullable Set.new( - [] + [ + :inside_bounding_box, + :optional_words + ] ) end @@ -510,9 +506,7 @@ def initialize(attributes = {}) end if attributes.key?(:inside_bounding_box) - if (value = attributes[:inside_bounding_box]).is_a?(Array) - self.inside_bounding_box = value - end + self.inside_bounding_box = attributes[:inside_bounding_box] end if attributes.key?(:inside_polygon) @@ -698,9 +692,7 @@ def initialize(attributes = {}) end if attributes.key?(:optional_words) - if (value = attributes[:optional_words]).is_a?(Array) - self.optional_words = value - end + self.optional_words = attributes[:optional_words] end if attributes.key?(:disable_exact_on_attributes) @@ -743,10 +735,6 @@ def initialize(attributes = {}) end end - if attributes.key?(:max_facet_hits) - self.max_facet_hits = attributes[:max_facet_hits] - end - if attributes.key?(:max_values_per_facet) self.max_values_per_facet = attributes[:max_values_per_facet] end @@ -850,7 +838,6 @@ def ==(other) replace_synonyms_in_highlight == other.replace_synonyms_in_highlight && min_proximity == other.min_proximity && response_fields == other.response_fields && - max_facet_hits == other.max_facet_hits && max_values_per_facet == other.max_values_per_facet && sort_facet_values_by == other.sort_facet_values_by && attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity && @@ -939,7 +926,6 @@ def hash replace_synonyms_in_highlight, min_proximity, response_fields, - max_facet_hits, max_values_per_facet, sort_facet_values_by, attribute_criteria_computed_by_min_proximity, diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/search/consequence_params.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/search/consequence_params.rb index 8bbdfbbb0f..e73916aa1a 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/search/consequence_params.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/search/consequence_params.rb @@ -54,7 +54,6 @@ class ConsequenceParams # Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. attr_accessor :minimum_around_radius - # 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). attr_accessor :inside_bounding_box # 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`. @@ -170,7 +169,6 @@ class ConsequenceParams # Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. attr_accessor :advanced_syntax - # 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). attr_accessor :optional_words # 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. @@ -195,9 +193,6 @@ class ConsequenceParams # Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. attr_accessor :response_fields - # 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). - attr_accessor :max_facet_hits - # Maximum number of facet values to return for each facet. attr_accessor :max_values_per_facet @@ -291,7 +286,6 @@ def self.attribute_map :replace_synonyms_in_highlight => :replaceSynonymsInHighlight, :min_proximity => :minProximity, :response_fields => :responseFields, - :max_facet_hits => :maxFacetHits, :max_values_per_facet => :maxValuesPerFacet, :sort_facet_values_by => :sortFacetValuesBy, :attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity, @@ -330,7 +324,7 @@ def self.types_mapping :around_radius => :"AroundRadius", :around_precision => :"AroundPrecision", :minimum_around_radius => :"Integer", - :inside_bounding_box => :"Array>", + :inside_bounding_box => :"InsideBoundingBox", :inside_polygon => :"Array>", :natural_languages => :"Array", :rule_contexts => :"Array", @@ -371,7 +365,7 @@ def self.types_mapping :mode => :"Mode", :semantic_search => :"SemanticSearch", :advanced_syntax => :"Boolean", - :optional_words => :"Array", + :optional_words => :"OptionalWords", :disable_exact_on_attributes => :"Array", :exact_on_single_word_query => :"ExactOnSingleWordQuery", :alternatives_as_exact => :"Array", @@ -380,7 +374,6 @@ def self.types_mapping :replace_synonyms_in_highlight => :"Boolean", :min_proximity => :"Integer", :response_fields => :"Array", - :max_facet_hits => :"Integer", :max_values_per_facet => :"Integer", :sort_facet_values_by => :"String", :attribute_criteria_computed_by_min_proximity => :"Boolean", @@ -396,7 +389,10 @@ def self.types_mapping # List of attributes with nullable: true def self.openapi_nullable Set.new( - [] + [ + :inside_bounding_box, + :optional_words + ] ) end @@ -509,9 +505,7 @@ def initialize(attributes = {}) end if attributes.key?(:inside_bounding_box) - if (value = attributes[:inside_bounding_box]).is_a?(Array) - self.inside_bounding_box = value - end + self.inside_bounding_box = attributes[:inside_bounding_box] end if attributes.key?(:inside_polygon) @@ -697,9 +691,7 @@ def initialize(attributes = {}) end if attributes.key?(:optional_words) - if (value = attributes[:optional_words]).is_a?(Array) - self.optional_words = value - end + self.optional_words = attributes[:optional_words] end if attributes.key?(:disable_exact_on_attributes) @@ -742,10 +734,6 @@ def initialize(attributes = {}) end end - if attributes.key?(:max_facet_hits) - self.max_facet_hits = attributes[:max_facet_hits] - end - if attributes.key?(:max_values_per_facet) self.max_values_per_facet = attributes[:max_values_per_facet] end @@ -856,7 +844,6 @@ def ==(other) replace_synonyms_in_highlight == other.replace_synonyms_in_highlight && min_proximity == other.min_proximity && response_fields == other.response_fields && - max_facet_hits == other.max_facet_hits && max_values_per_facet == other.max_values_per_facet && sort_facet_values_by == other.sort_facet_values_by && attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity && @@ -946,7 +933,6 @@ def hash replace_synonyms_in_highlight, min_proximity, response_fields, - max_facet_hits, max_values_per_facet, sort_facet_values_by, attribute_criteria_computed_by_min_proximity, diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/search/delete_by_params.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/search/delete_by_params.rb index 876fa5b624..9aa30cde5d 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/search/delete_by_params.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/search/delete_by_params.rb @@ -20,7 +20,6 @@ class DeleteByParams attr_accessor :around_radius - # 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). attr_accessor :inside_bounding_box # 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`. @@ -54,7 +53,7 @@ def self.types_mapping :tag_filters => :"TagFilters", :around_lat_lng => :"String", :around_radius => :"AroundRadius", - :inside_bounding_box => :"Array>", + :inside_bounding_box => :"InsideBoundingBox", :inside_polygon => :"Array>" } end @@ -62,7 +61,9 @@ def self.types_mapping # List of attributes with nullable: true def self.openapi_nullable Set.new( - [] + [ + :inside_bounding_box + ] ) end @@ -114,9 +115,7 @@ def initialize(attributes = {}) end if attributes.key?(:inside_bounding_box) - if (value = attributes[:inside_bounding_box]).is_a?(Array) - self.inside_bounding_box = value - end + self.inside_bounding_box = attributes[:inside_bounding_box] end if attributes.key?(:inside_polygon) diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/search/index_settings.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/search/index_settings.rb index 7600a57162..58e916291f 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/search/index_settings.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/search/index_settings.rb @@ -58,6 +58,9 @@ class IndexSettings # Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. attr_accessor :attribute_for_distinct + # 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). + attr_accessor :max_facet_hits + # 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. attr_accessor :attributes_to_retrieve @@ -135,7 +138,6 @@ class IndexSettings # Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. attr_accessor :advanced_syntax - # 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). attr_accessor :optional_words # 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. @@ -160,9 +162,6 @@ class IndexSettings # Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. attr_accessor :response_fields - # 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). - attr_accessor :max_facet_hits - # Maximum number of facet values to return for each facet. attr_accessor :max_values_per_facet @@ -199,6 +198,7 @@ def self.attribute_map :user_data => :userData, :custom_normalization => :customNormalization, :attribute_for_distinct => :attributeForDistinct, + :max_facet_hits => :maxFacetHits, :attributes_to_retrieve => :attributesToRetrieve, :ranking => :ranking, :custom_ranking => :customRanking, @@ -236,7 +236,6 @@ def self.attribute_map :replace_synonyms_in_highlight => :replaceSynonymsInHighlight, :min_proximity => :minProximity, :response_fields => :responseFields, - :max_facet_hits => :maxFacetHits, :max_values_per_facet => :maxValuesPerFacet, :sort_facet_values_by => :sortFacetValuesBy, :attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity, @@ -271,6 +270,7 @@ def self.types_mapping :user_data => :"Object", :custom_normalization => :"Hash>", :attribute_for_distinct => :"String", + :max_facet_hits => :"Integer", :attributes_to_retrieve => :"Array", :ranking => :"Array", :custom_ranking => :"Array", @@ -299,7 +299,7 @@ def self.types_mapping :mode => :"Mode", :semantic_search => :"SemanticSearch", :advanced_syntax => :"Boolean", - :optional_words => :"Array", + :optional_words => :"OptionalWords", :disable_exact_on_attributes => :"Array", :exact_on_single_word_query => :"ExactOnSingleWordQuery", :alternatives_as_exact => :"Array", @@ -308,7 +308,6 @@ def self.types_mapping :replace_synonyms_in_highlight => :"Boolean", :min_proximity => :"Integer", :response_fields => :"Array", - :max_facet_hits => :"Integer", :max_values_per_facet => :"Integer", :sort_facet_values_by => :"String", :attribute_criteria_computed_by_min_proximity => :"Boolean", @@ -321,7 +320,9 @@ def self.types_mapping # List of attributes with nullable: true def self.openapi_nullable Set.new( - [] + [ + :optional_words + ] ) end @@ -446,6 +447,10 @@ def initialize(attributes = {}) self.attribute_for_distinct = attributes[:attribute_for_distinct] end + if attributes.key?(:max_facet_hits) + self.max_facet_hits = attributes[:max_facet_hits] + end + if attributes.key?(:attributes_to_retrieve) if (value = attributes[:attributes_to_retrieve]).is_a?(Array) self.attributes_to_retrieve = value @@ -573,9 +578,7 @@ def initialize(attributes = {}) end if attributes.key?(:optional_words) - if (value = attributes[:optional_words]).is_a?(Array) - self.optional_words = value - end + self.optional_words = attributes[:optional_words] end if attributes.key?(:disable_exact_on_attributes) @@ -618,10 +621,6 @@ def initialize(attributes = {}) end end - if attributes.key?(:max_facet_hits) - self.max_facet_hits = attributes[:max_facet_hits] - end - if attributes.key?(:max_values_per_facet) self.max_values_per_facet = attributes[:max_values_per_facet] end @@ -669,6 +668,7 @@ def ==(other) user_data == other.user_data && custom_normalization == other.custom_normalization && attribute_for_distinct == other.attribute_for_distinct && + max_facet_hits == other.max_facet_hits && attributes_to_retrieve == other.attributes_to_retrieve && ranking == other.ranking && custom_ranking == other.custom_ranking && @@ -706,7 +706,6 @@ def ==(other) replace_synonyms_in_highlight == other.replace_synonyms_in_highlight && min_proximity == other.min_proximity && response_fields == other.response_fields && - max_facet_hits == other.max_facet_hits && max_values_per_facet == other.max_values_per_facet && sort_facet_values_by == other.sort_facet_values_by && attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity && @@ -742,6 +741,7 @@ def hash user_data, custom_normalization, attribute_for_distinct, + max_facet_hits, attributes_to_retrieve, ranking, custom_ranking, @@ -779,7 +779,6 @@ def hash replace_synonyms_in_highlight, min_proximity, response_fields, - max_facet_hits, max_values_per_facet, sort_facet_values_by, attribute_criteria_computed_by_min_proximity, diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/search/inside_bounding_box.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/search/inside_bounding_box.rb new file mode 100644 index 0000000000..87b7b52cc3 --- /dev/null +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/search/inside_bounding_box.rb @@ -0,0 +1,108 @@ +# 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. + +require "date" +require "time" + +module Algolia + module Search + module InsideBoundingBox + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :"Array>", + :"String" + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + # "nullable: true" + next if klass == :AnyType + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + # rescue all errors so we keep iterating even if the current item lookup raises + rescue + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when "Boolean" + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when "Float" + return data if data.instance_of?(Float) + when "Integer" + return data if data.instance_of?(Integer) + when "Time" + return Time.parse(data) + when "Date" + return Date.parse(data) + when "String" + return data if data.instance_of?(String) + # "type: object" + when "Object" + return data if data.instance_of?(Hash) + # "type: array" + when /\AArray<(?.+)>\z/ + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + # "type: object" with "additionalProperties: { ... }" + when /\AHash.+)>\z/ + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + # model + else + const = Algolia::Search.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) + # nested oneOf model + model = const.build(data) + elsif const.respond_to?(:acceptable_attributes) + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + else + # maybe it's an enum + model = const.build_from_hash(data) + end + + return model if model + end + end + + # if no match by now, raise + raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + + end +end diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/search/optional_words.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/search/optional_words.rb new file mode 100644 index 0000000000..900b19a92b --- /dev/null +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/search/optional_words.rb @@ -0,0 +1,108 @@ +# 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. + +require "date" +require "time" + +module Algolia + module Search + module OptionalWords + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :"Array", + :"String" + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + # "nullable: true" + next if klass == :AnyType + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + # rescue all errors so we keep iterating even if the current item lookup raises + rescue + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when "Boolean" + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when "Float" + return data if data.instance_of?(Float) + when "Integer" + return data if data.instance_of?(Integer) + when "Time" + return Time.parse(data) + when "Date" + return Date.parse(data) + when "String" + return data if data.instance_of?(String) + # "type: object" + when "Object" + return data if data.instance_of?(Hash) + # "type: array" + when /\AArray<(?.+)>\z/ + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + # "type: object" with "additionalProperties: { ... }" + when /\AHash.+)>\z/ + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + # model + else + const = Algolia::Search.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) + # nested oneOf model + model = const.build(data) + elsif const.respond_to?(:acceptable_attributes) + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + else + # maybe it's an enum + model = const.build_from_hash(data) + end + + return model if model + end + end + + # if no match by now, raise + raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + + end +end diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/search/search_for_facets.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/search/search_for_facets.rb index f44a237f91..800c015c9f 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/search/search_for_facets.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/search/search_for_facets.rb @@ -60,7 +60,6 @@ class SearchForFacets # Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. attr_accessor :minimum_around_radius - # 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). attr_accessor :inside_bounding_box # 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`. @@ -176,7 +175,6 @@ class SearchForFacets # Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. attr_accessor :advanced_syntax - # 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). attr_accessor :optional_words # 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. @@ -201,9 +199,6 @@ class SearchForFacets # Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. attr_accessor :response_fields - # 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). - attr_accessor :max_facet_hits - # Maximum number of facet values to return for each facet. attr_accessor :max_values_per_facet @@ -229,6 +224,9 @@ class SearchForFacets # Text to search inside the facet's values. attr_accessor :facet_query + # 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). + attr_accessor :max_facet_hits + attr_accessor :type # Attribute mapping from ruby-style variable name to JSON key. @@ -304,7 +302,6 @@ def self.attribute_map :replace_synonyms_in_highlight => :replaceSynonymsInHighlight, :min_proximity => :minProximity, :response_fields => :responseFields, - :max_facet_hits => :maxFacetHits, :max_values_per_facet => :maxValuesPerFacet, :sort_facet_values_by => :sortFacetValuesBy, :attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity, @@ -314,6 +311,7 @@ def self.attribute_map :facet => :facet, :index_name => :indexName, :facet_query => :facetQuery, + :max_facet_hits => :maxFacetHits, :type => :type } end @@ -346,7 +344,7 @@ def self.types_mapping :around_radius => :"AroundRadius", :around_precision => :"AroundPrecision", :minimum_around_radius => :"Integer", - :inside_bounding_box => :"Array>", + :inside_bounding_box => :"InsideBoundingBox", :inside_polygon => :"Array>", :natural_languages => :"Array", :rule_contexts => :"Array", @@ -387,7 +385,7 @@ def self.types_mapping :mode => :"Mode", :semantic_search => :"SemanticSearch", :advanced_syntax => :"Boolean", - :optional_words => :"Array", + :optional_words => :"OptionalWords", :disable_exact_on_attributes => :"Array", :exact_on_single_word_query => :"ExactOnSingleWordQuery", :alternatives_as_exact => :"Array", @@ -396,7 +394,6 @@ def self.types_mapping :replace_synonyms_in_highlight => :"Boolean", :min_proximity => :"Integer", :response_fields => :"Array", - :max_facet_hits => :"Integer", :max_values_per_facet => :"Integer", :sort_facet_values_by => :"String", :attribute_criteria_computed_by_min_proximity => :"Boolean", @@ -406,6 +403,7 @@ def self.types_mapping :facet => :"String", :index_name => :"String", :facet_query => :"String", + :max_facet_hits => :"Integer", :type => :"SearchTypeFacet" } end @@ -413,7 +411,10 @@ def self.types_mapping # List of attributes with nullable: true def self.openapi_nullable Set.new( - [] + [ + :inside_bounding_box, + :optional_words + ] ) end @@ -533,9 +534,7 @@ def initialize(attributes = {}) end if attributes.key?(:inside_bounding_box) - if (value = attributes[:inside_bounding_box]).is_a?(Array) - self.inside_bounding_box = value - end + self.inside_bounding_box = attributes[:inside_bounding_box] end if attributes.key?(:inside_polygon) @@ -721,9 +720,7 @@ def initialize(attributes = {}) end if attributes.key?(:optional_words) - if (value = attributes[:optional_words]).is_a?(Array) - self.optional_words = value - end + self.optional_words = attributes[:optional_words] end if attributes.key?(:disable_exact_on_attributes) @@ -766,10 +763,6 @@ def initialize(attributes = {}) end end - if attributes.key?(:max_facet_hits) - self.max_facet_hits = attributes[:max_facet_hits] - end - if attributes.key?(:max_values_per_facet) self.max_values_per_facet = attributes[:max_values_per_facet] end @@ -810,6 +803,10 @@ def initialize(attributes = {}) self.facet_query = attributes[:facet_query] end + if attributes.key?(:max_facet_hits) + self.max_facet_hits = attributes[:max_facet_hits] + end + if attributes.key?(:type) self.type = attributes[:type] else @@ -892,7 +889,6 @@ def ==(other) replace_synonyms_in_highlight == other.replace_synonyms_in_highlight && min_proximity == other.min_proximity && response_fields == other.response_fields && - max_facet_hits == other.max_facet_hits && max_values_per_facet == other.max_values_per_facet && sort_facet_values_by == other.sort_facet_values_by && attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity && @@ -902,6 +898,7 @@ def ==(other) facet == other.facet && index_name == other.index_name && facet_query == other.facet_query && + max_facet_hits == other.max_facet_hits && type == other.type end @@ -985,7 +982,6 @@ def hash replace_synonyms_in_highlight, min_proximity, response_fields, - max_facet_hits, max_values_per_facet, sort_facet_values_by, attribute_criteria_computed_by_min_proximity, @@ -995,6 +991,7 @@ def hash facet, index_name, facet_query, + max_facet_hits, type ].hash end diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/search/search_for_hits.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/search/search_for_hits.rb index a1fe5f6eff..2a4b5081a0 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/search/search_for_hits.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/search/search_for_hits.rb @@ -60,7 +60,6 @@ class SearchForHits # Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. attr_accessor :minimum_around_radius - # 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). attr_accessor :inside_bounding_box # 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`. @@ -176,7 +175,6 @@ class SearchForHits # Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. attr_accessor :advanced_syntax - # 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). attr_accessor :optional_words # 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. @@ -201,9 +199,6 @@ class SearchForHits # Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. attr_accessor :response_fields - # 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). - attr_accessor :max_facet_hits - # Maximum number of facet values to return for each facet. attr_accessor :max_values_per_facet @@ -298,7 +293,6 @@ def self.attribute_map :replace_synonyms_in_highlight => :replaceSynonymsInHighlight, :min_proximity => :minProximity, :response_fields => :responseFields, - :max_facet_hits => :maxFacetHits, :max_values_per_facet => :maxValuesPerFacet, :sort_facet_values_by => :sortFacetValuesBy, :attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity, @@ -338,7 +332,7 @@ def self.types_mapping :around_radius => :"AroundRadius", :around_precision => :"AroundPrecision", :minimum_around_radius => :"Integer", - :inside_bounding_box => :"Array>", + :inside_bounding_box => :"InsideBoundingBox", :inside_polygon => :"Array>", :natural_languages => :"Array", :rule_contexts => :"Array", @@ -379,7 +373,7 @@ def self.types_mapping :mode => :"Mode", :semantic_search => :"SemanticSearch", :advanced_syntax => :"Boolean", - :optional_words => :"Array", + :optional_words => :"OptionalWords", :disable_exact_on_attributes => :"Array", :exact_on_single_word_query => :"ExactOnSingleWordQuery", :alternatives_as_exact => :"Array", @@ -388,7 +382,6 @@ def self.types_mapping :replace_synonyms_in_highlight => :"Boolean", :min_proximity => :"Integer", :response_fields => :"Array", - :max_facet_hits => :"Integer", :max_values_per_facet => :"Integer", :sort_facet_values_by => :"String", :attribute_criteria_computed_by_min_proximity => :"Boolean", @@ -403,7 +396,10 @@ def self.types_mapping # List of attributes with nullable: true def self.openapi_nullable Set.new( - [] + [ + :inside_bounding_box, + :optional_words + ] ) end @@ -523,9 +519,7 @@ def initialize(attributes = {}) end if attributes.key?(:inside_bounding_box) - if (value = attributes[:inside_bounding_box]).is_a?(Array) - self.inside_bounding_box = value - end + self.inside_bounding_box = attributes[:inside_bounding_box] end if attributes.key?(:inside_polygon) @@ -711,9 +705,7 @@ def initialize(attributes = {}) end if attributes.key?(:optional_words) - if (value = attributes[:optional_words]).is_a?(Array) - self.optional_words = value - end + self.optional_words = attributes[:optional_words] end if attributes.key?(:disable_exact_on_attributes) @@ -756,10 +748,6 @@ def initialize(attributes = {}) end end - if attributes.key?(:max_facet_hits) - self.max_facet_hits = attributes[:max_facet_hits] - end - if attributes.key?(:max_values_per_facet) self.max_values_per_facet = attributes[:max_values_per_facet] end @@ -870,7 +858,6 @@ def ==(other) replace_synonyms_in_highlight == other.replace_synonyms_in_highlight && min_proximity == other.min_proximity && response_fields == other.response_fields && - max_facet_hits == other.max_facet_hits && max_values_per_facet == other.max_values_per_facet && sort_facet_values_by == other.sort_facet_values_by && attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity && @@ -961,7 +948,6 @@ def hash replace_synonyms_in_highlight, min_proximity, response_fields, - max_facet_hits, max_values_per_facet, sort_facet_values_by, attribute_criteria_computed_by_min_proximity, diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/search/search_params_object.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/search/search_params_object.rb index 7c5618cc5c..6dcce24db4 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/search/search_params_object.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/search/search_params_object.rb @@ -58,7 +58,6 @@ class SearchParamsObject # Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. attr_accessor :minimum_around_radius - # 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). attr_accessor :inside_bounding_box # 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`. @@ -174,7 +173,6 @@ class SearchParamsObject # Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. attr_accessor :advanced_syntax - # 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). attr_accessor :optional_words # 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. @@ -199,9 +197,6 @@ class SearchParamsObject # Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. attr_accessor :response_fields - # 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). - attr_accessor :max_facet_hits - # Maximum number of facet values to return for each facet. attr_accessor :max_values_per_facet @@ -290,7 +285,6 @@ def self.attribute_map :replace_synonyms_in_highlight => :replaceSynonymsInHighlight, :min_proximity => :minProximity, :response_fields => :responseFields, - :max_facet_hits => :maxFacetHits, :max_values_per_facet => :maxValuesPerFacet, :sort_facet_values_by => :sortFacetValuesBy, :attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity, @@ -327,7 +321,7 @@ def self.types_mapping :around_radius => :"AroundRadius", :around_precision => :"AroundPrecision", :minimum_around_radius => :"Integer", - :inside_bounding_box => :"Array>", + :inside_bounding_box => :"InsideBoundingBox", :inside_polygon => :"Array>", :natural_languages => :"Array", :rule_contexts => :"Array", @@ -368,7 +362,7 @@ def self.types_mapping :mode => :"Mode", :semantic_search => :"SemanticSearch", :advanced_syntax => :"Boolean", - :optional_words => :"Array", + :optional_words => :"OptionalWords", :disable_exact_on_attributes => :"Array", :exact_on_single_word_query => :"ExactOnSingleWordQuery", :alternatives_as_exact => :"Array", @@ -377,7 +371,6 @@ def self.types_mapping :replace_synonyms_in_highlight => :"Boolean", :min_proximity => :"Integer", :response_fields => :"Array", - :max_facet_hits => :"Integer", :max_values_per_facet => :"Integer", :sort_facet_values_by => :"String", :attribute_criteria_computed_by_min_proximity => :"Boolean", @@ -390,7 +383,10 @@ def self.types_mapping # List of attributes with nullable: true def self.openapi_nullable Set.new( - [] + [ + :inside_bounding_box, + :optional_words + ] ) end @@ -506,9 +502,7 @@ def initialize(attributes = {}) end if attributes.key?(:inside_bounding_box) - if (value = attributes[:inside_bounding_box]).is_a?(Array) - self.inside_bounding_box = value - end + self.inside_bounding_box = attributes[:inside_bounding_box] end if attributes.key?(:inside_polygon) @@ -694,9 +688,7 @@ def initialize(attributes = {}) end if attributes.key?(:optional_words) - if (value = attributes[:optional_words]).is_a?(Array) - self.optional_words = value - end + self.optional_words = attributes[:optional_words] end if attributes.key?(:disable_exact_on_attributes) @@ -739,10 +731,6 @@ def initialize(attributes = {}) end end - if attributes.key?(:max_facet_hits) - self.max_facet_hits = attributes[:max_facet_hits] - end - if attributes.key?(:max_values_per_facet) self.max_values_per_facet = attributes[:max_values_per_facet] end @@ -842,7 +830,6 @@ def ==(other) replace_synonyms_in_highlight == other.replace_synonyms_in_highlight && min_proximity == other.min_proximity && response_fields == other.response_fields && - max_facet_hits == other.max_facet_hits && max_values_per_facet == other.max_values_per_facet && sort_facet_values_by == other.sort_facet_values_by && attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity && @@ -930,7 +917,6 @@ def hash replace_synonyms_in_highlight, min_proximity, response_fields, - max_facet_hits, max_values_per_facet, sort_facet_values_by, attribute_criteria_computed_by_min_proximity, diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/search/settings_response.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/search/settings_response.rb index 4387c75f4e..de735c5cea 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/search/settings_response.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/search/settings_response.rb @@ -57,6 +57,9 @@ class SettingsResponse # Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. attr_accessor :attribute_for_distinct + # 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). + attr_accessor :max_facet_hits + # 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. attr_accessor :attributes_to_retrieve @@ -134,7 +137,6 @@ class SettingsResponse # Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. attr_accessor :advanced_syntax - # 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). attr_accessor :optional_words # 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. @@ -159,9 +161,6 @@ class SettingsResponse # Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. attr_accessor :response_fields - # 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). - attr_accessor :max_facet_hits - # Maximum number of facet values to return for each facet. attr_accessor :max_values_per_facet @@ -201,6 +200,7 @@ def self.attribute_map :user_data => :userData, :custom_normalization => :customNormalization, :attribute_for_distinct => :attributeForDistinct, + :max_facet_hits => :maxFacetHits, :attributes_to_retrieve => :attributesToRetrieve, :ranking => :ranking, :custom_ranking => :customRanking, @@ -238,7 +238,6 @@ def self.attribute_map :replace_synonyms_in_highlight => :replaceSynonymsInHighlight, :min_proximity => :minProximity, :response_fields => :responseFields, - :max_facet_hits => :maxFacetHits, :max_values_per_facet => :maxValuesPerFacet, :sort_facet_values_by => :sortFacetValuesBy, :attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity, @@ -274,6 +273,7 @@ def self.types_mapping :user_data => :"Object", :custom_normalization => :"Hash>", :attribute_for_distinct => :"String", + :max_facet_hits => :"Integer", :attributes_to_retrieve => :"Array", :ranking => :"Array", :custom_ranking => :"Array", @@ -302,7 +302,7 @@ def self.types_mapping :mode => :"Mode", :semantic_search => :"SemanticSearch", :advanced_syntax => :"Boolean", - :optional_words => :"Array", + :optional_words => :"OptionalWords", :disable_exact_on_attributes => :"Array", :exact_on_single_word_query => :"ExactOnSingleWordQuery", :alternatives_as_exact => :"Array", @@ -311,7 +311,6 @@ def self.types_mapping :replace_synonyms_in_highlight => :"Boolean", :min_proximity => :"Integer", :response_fields => :"Array", - :max_facet_hits => :"Integer", :max_values_per_facet => :"Integer", :sort_facet_values_by => :"String", :attribute_criteria_computed_by_min_proximity => :"Boolean", @@ -325,7 +324,9 @@ def self.types_mapping # List of attributes with nullable: true def self.openapi_nullable Set.new( - [] + [ + :optional_words + ] ) end @@ -450,6 +451,10 @@ def initialize(attributes = {}) self.attribute_for_distinct = attributes[:attribute_for_distinct] end + if attributes.key?(:max_facet_hits) + self.max_facet_hits = attributes[:max_facet_hits] + end + if attributes.key?(:attributes_to_retrieve) if (value = attributes[:attributes_to_retrieve]).is_a?(Array) self.attributes_to_retrieve = value @@ -577,9 +582,7 @@ def initialize(attributes = {}) end if attributes.key?(:optional_words) - if (value = attributes[:optional_words]).is_a?(Array) - self.optional_words = value - end + self.optional_words = attributes[:optional_words] end if attributes.key?(:disable_exact_on_attributes) @@ -622,10 +625,6 @@ def initialize(attributes = {}) end end - if attributes.key?(:max_facet_hits) - self.max_facet_hits = attributes[:max_facet_hits] - end - if attributes.key?(:max_values_per_facet) self.max_values_per_facet = attributes[:max_values_per_facet] end @@ -677,6 +676,7 @@ def ==(other) user_data == other.user_data && custom_normalization == other.custom_normalization && attribute_for_distinct == other.attribute_for_distinct && + max_facet_hits == other.max_facet_hits && attributes_to_retrieve == other.attributes_to_retrieve && ranking == other.ranking && custom_ranking == other.custom_ranking && @@ -714,7 +714,6 @@ def ==(other) replace_synonyms_in_highlight == other.replace_synonyms_in_highlight && min_proximity == other.min_proximity && response_fields == other.response_fields && - max_facet_hits == other.max_facet_hits && max_values_per_facet == other.max_values_per_facet && sort_facet_values_by == other.sort_facet_values_by && attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity && @@ -751,6 +750,7 @@ def hash user_data, custom_normalization, attribute_for_distinct, + max_facet_hits, attributes_to_retrieve, ranking, custom_ranking, @@ -788,7 +788,6 @@ def hash replace_synonyms_in_highlight, min_proximity, response_fields, - max_facet_hits, max_values_per_facet, sort_facet_values_by, attribute_criteria_computed_by_min_proximity, diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BaseIndexSettings.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BaseIndexSettings.scala index a5c8846118..e89b07b400 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BaseIndexSettings.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BaseIndexSettings.scala @@ -135,6 +135,9 @@ import algoliasearch.recommend.SupportedLanguage._ * `distinct` search parameter to control how many items per group are included in the search results. If you want to * use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. * This applies faceting _after_ deduplication, which will result in accurate facet counts. + * @param maxFacetHits + * 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). */ case class BaseIndexSettings( attributesForFaceting: Option[Seq[String]] = scala.None, @@ -153,5 +156,6 @@ case class BaseIndexSettings( searchableAttributes: Option[Seq[String]] = scala.None, userData: Option[Any] = scala.None, customNormalization: Option[Map[String, Map[String, String]]] = scala.None, - attributeForDistinct: Option[String] = scala.None + attributeForDistinct: Option[String] = scala.None, + maxFacetHits: Option[Int] = scala.None ) diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BaseRecommendIndexSettings.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BaseRecommendIndexSettings.scala index c4e428b680..304535c857 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BaseRecommendIndexSettings.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BaseRecommendIndexSettings.scala @@ -122,19 +122,6 @@ import algoliasearch.recommend.SupportedLanguage._ * @param advancedSyntax * Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` * parameter to control which feature is supported. - * @param optionalWords - * 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). * @param disableExactOnAttributes * 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). @@ -174,9 +161,6 @@ import algoliasearch.recommend.SupportedLanguage._ * these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or * any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your * search UI. - * @param maxFacetHits - * 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). * @param maxValuesPerFacet * Maximum number of facet values to return for each facet. * @param sortFacetValuesBy @@ -218,7 +202,7 @@ case class BaseRecommendIndexSettings( queryType: Option[QueryType] = scala.None, removeWordsIfNoResults: Option[RemoveWordsIfNoResults] = scala.None, advancedSyntax: Option[Boolean] = scala.None, - optionalWords: Option[Seq[String]] = scala.None, + optionalWords: Option[OptionalWords] = scala.None, disableExactOnAttributes: Option[Seq[String]] = scala.None, exactOnSingleWordQuery: Option[ExactOnSingleWordQuery] = scala.None, alternativesAsExact: Option[Seq[AlternativesAsExact]] = scala.None, @@ -227,7 +211,6 @@ case class BaseRecommendIndexSettings( replaceSynonymsInHighlight: Option[Boolean] = scala.None, minProximity: Option[Int] = scala.None, responseFields: Option[Seq[String]] = scala.None, - maxFacetHits: Option[Int] = scala.None, maxValuesPerFacet: Option[Int] = scala.None, sortFacetValuesBy: Option[String] = scala.None, attributeCriteriaComputedByMinProximity: Option[Boolean] = scala.None, diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BaseRecommendSearchParams.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BaseRecommendSearchParams.scala index 3e5aba1a05..dfb58d0336 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BaseRecommendSearchParams.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BaseRecommendSearchParams.scala @@ -77,11 +77,6 @@ import algoliasearch.recommend.SupportedLanguage._ * Whether to obtain the coordinates from the request's IP address. * @param minimumAroundRadius * Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox - * 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). * @param insidePolygon * 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 @@ -138,7 +133,7 @@ case class BaseRecommendSearchParams( aroundRadius: Option[AroundRadius] = scala.None, aroundPrecision: Option[AroundPrecision] = scala.None, minimumAroundRadius: Option[Int] = scala.None, - insideBoundingBox: Option[Seq[Seq[Double]]] = scala.None, + insideBoundingBox: Option[InsideBoundingBox] = scala.None, insidePolygon: Option[Seq[Seq[Double]]] = scala.None, naturalLanguages: Option[Seq[SupportedLanguage]] = scala.None, ruleContexts: Option[Seq[String]] = scala.None, diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/FallbackParams.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/FallbackParams.scala index 73fdec39d3..edf18bfedc 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/FallbackParams.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/FallbackParams.scala @@ -82,11 +82,6 @@ import algoliasearch.recommend.SupportedLanguage._ * Whether to obtain the coordinates from the request's IP address. * @param minimumAroundRadius * Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox - * 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). * @param insidePolygon * 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 @@ -230,6 +225,9 @@ import algoliasearch.recommend.SupportedLanguage._ * `distinct` search parameter to control how many items per group are included in the search results. If you want to * use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. * This applies faceting _after_ deduplication, which will result in accurate facet counts. + * @param maxFacetHits + * 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). * @param attributesToRetrieve * 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 @@ -314,19 +312,6 @@ import algoliasearch.recommend.SupportedLanguage._ * @param advancedSyntax * Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` * parameter to control which feature is supported. - * @param optionalWords - * 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). * @param disableExactOnAttributes * 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). @@ -366,9 +351,6 @@ import algoliasearch.recommend.SupportedLanguage._ * these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or * any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your * search UI. - * @param maxFacetHits - * 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). * @param maxValuesPerFacet * Maximum number of facet values to return for each facet. * @param sortFacetValuesBy @@ -402,7 +384,7 @@ case class FallbackParams( aroundRadius: Option[AroundRadius] = scala.None, aroundPrecision: Option[AroundPrecision] = scala.None, minimumAroundRadius: Option[Int] = scala.None, - insideBoundingBox: Option[Seq[Seq[Double]]] = scala.None, + insideBoundingBox: Option[InsideBoundingBox] = scala.None, insidePolygon: Option[Seq[Seq[Double]]] = scala.None, naturalLanguages: Option[Seq[SupportedLanguage]] = scala.None, ruleContexts: Option[Seq[String]] = scala.None, @@ -433,6 +415,7 @@ case class FallbackParams( userData: Option[Any] = scala.None, customNormalization: Option[Map[String, Map[String, String]]] = scala.None, attributeForDistinct: Option[String] = scala.None, + maxFacetHits: Option[Int] = scala.None, attributesToRetrieve: Option[Seq[String]] = scala.None, ranking: Option[Seq[String]] = scala.None, relevancyStrictness: Option[Int] = scala.None, @@ -456,7 +439,7 @@ case class FallbackParams( queryType: Option[QueryType] = scala.None, removeWordsIfNoResults: Option[RemoveWordsIfNoResults] = scala.None, advancedSyntax: Option[Boolean] = scala.None, - optionalWords: Option[Seq[String]] = scala.None, + optionalWords: Option[OptionalWords] = scala.None, disableExactOnAttributes: Option[Seq[String]] = scala.None, exactOnSingleWordQuery: Option[ExactOnSingleWordQuery] = scala.None, alternativesAsExact: Option[Seq[AlternativesAsExact]] = scala.None, @@ -465,7 +448,6 @@ case class FallbackParams( replaceSynonymsInHighlight: Option[Boolean] = scala.None, minProximity: Option[Int] = scala.None, responseFields: Option[Seq[String]] = scala.None, - maxFacetHits: Option[Int] = scala.None, maxValuesPerFacet: Option[Int] = scala.None, sortFacetValuesBy: Option[String] = scala.None, attributeCriteriaComputedByMinProximity: Option[Boolean] = scala.None, diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/InsideBoundingBox.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/InsideBoundingBox.scala new file mode 100644 index 0000000000..5dc852e991 --- /dev/null +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/InsideBoundingBox.scala @@ -0,0 +1,70 @@ +/** Recommend API The Recommend API lets you retrieve recommendations from one of Algolia's AI recommendation models + * that you previously trained on your data. ## Client libraries Use Algolia's API clients and libraries to reliably + * integrate Algolia's APIs with your apps. The official API clients are covered by Algolia's [Service Level + * Agreement](https://www.algolia.com/policies/sla/). See: [Algolia's + * ecosystem](https://www.algolia.com/doc/guides/getting-started/how-algolia-works/in-depth/ecosystem/) ## Base URLs + * The base URLs for requests to the Recommend API are: - `https://{APPLICATION_ID}.algolia.net` - + * `https://{APPLICATION_ID}-dsn.algolia.net`. If your subscription includes a [Distributed Search + * Network](https://dashboard.algolia.com/infra), this ensures that requests are sent to servers closest to users. Both + * URLs provide high availability by distributing requests with load balancing. **All requests must use HTTPS.** ## + * Retry strategy To guarantee a high availability, implement a retry strategy for all API requests using the URLs of + * your servers as fallbacks: - `https://{APPLICATION_ID}-1.algolianet.com` - + * `https://{APPLICATION_ID}-2.algolianet.com` - `https://{APPLICATION_ID}-3.algolianet.com` These URLs use a different + * DNS provider than the primary URLs. You should randomize this list to ensure an even load across the three servers. + * All Algolia API clients implement this retry strategy. ## Authentication To authenticate your API requests, add + * these headers: - `x-algolia-application-id`. Your Algolia application ID. - `x-algolia-api-key`. An API key with the + * necessary permissions to make the request. The required access control list (ACL) to make a request is listed in + * each endpoint's reference. You can find your application ID and API key in the [Algolia + * dashboard](https://dashboard.algolia.com/account). ## Request format Request bodies must be JSON objects. ## + * Response status and errors The Recommend API returns JSON responses. Since JSON doesn't guarantee any specific + * ordering, don't rely on the order of attributes in the API response. Successful responses return a `2xx` status. + * Client errors return a `4xx` status. Server errors are indicated by a `5xx` status. Error responses have a `message` + * property with more information. ## Version The current version of the Recommend API is version 1, as indicated by + * the `/1/` in each endpoint's URL. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech Do not edit the class manually. + */ +package algoliasearch.recommend + +import org.json4s._ + +/** InsideBoundingBox + */ +sealed trait InsideBoundingBox + +object InsideBoundingBox { + + case class StringValue(value: String) extends InsideBoundingBox + case class SeqOfSeqOfDouble(value: Seq[Seq[Double]]) extends InsideBoundingBox + + def apply(value: String): InsideBoundingBox = { + InsideBoundingBox.StringValue(value) + } + def apply(value: Seq[Seq[Double]]): InsideBoundingBox = { + InsideBoundingBox.SeqOfSeqOfDouble(value) + } + +} + +object InsideBoundingBoxSerializer extends Serializer[InsideBoundingBox] { + override def deserialize(implicit format: Formats): PartialFunction[(TypeInfo, JValue), InsideBoundingBox] = { + + case (TypeInfo(clazz, _), json) if clazz == classOf[InsideBoundingBox] => + json match { + case JString(value) => InsideBoundingBox.StringValue(value) + case JArray(value) if value.forall(_.isInstanceOf[JArray]) => + InsideBoundingBox.SeqOfSeqOfDouble(value.map(_.extract)) + case _ => throw new MappingException("Can't convert " + json + " to InsideBoundingBox") + } + } + + override def serialize(implicit format: Formats): PartialFunction[Any, JValue] = { case value: InsideBoundingBox => + value match { + case InsideBoundingBox.StringValue(value) => JString(value) + case InsideBoundingBox.SeqOfSeqOfDouble(value) => JArray(value.map(Extraction.decompose).toList) + } + } +} diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/JsonSupport.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/JsonSupport.scala index 248fe978a6..c747a930b2 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/JsonSupport.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/JsonSupport.scala @@ -60,8 +60,10 @@ object JsonSupport { FacetFiltersSerializer :+ HighlightResultSerializer :+ IgnorePluralsSerializer :+ + InsideBoundingBoxSerializer :+ NumericFiltersSerializer :+ OptionalFiltersSerializer :+ + OptionalWordsSerializer :+ ReRankingApplyFilterSerializer :+ RecommendationsHitSerializer :+ RecommendationsRequestSerializer :+ diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/OptionalWords.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/OptionalWords.scala new file mode 100644 index 0000000000..ba09f86b3f --- /dev/null +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/OptionalWords.scala @@ -0,0 +1,69 @@ +/** Recommend API The Recommend API lets you retrieve recommendations from one of Algolia's AI recommendation models + * that you previously trained on your data. ## Client libraries Use Algolia's API clients and libraries to reliably + * integrate Algolia's APIs with your apps. The official API clients are covered by Algolia's [Service Level + * Agreement](https://www.algolia.com/policies/sla/). See: [Algolia's + * ecosystem](https://www.algolia.com/doc/guides/getting-started/how-algolia-works/in-depth/ecosystem/) ## Base URLs + * The base URLs for requests to the Recommend API are: - `https://{APPLICATION_ID}.algolia.net` - + * `https://{APPLICATION_ID}-dsn.algolia.net`. If your subscription includes a [Distributed Search + * Network](https://dashboard.algolia.com/infra), this ensures that requests are sent to servers closest to users. Both + * URLs provide high availability by distributing requests with load balancing. **All requests must use HTTPS.** ## + * Retry strategy To guarantee a high availability, implement a retry strategy for all API requests using the URLs of + * your servers as fallbacks: - `https://{APPLICATION_ID}-1.algolianet.com` - + * `https://{APPLICATION_ID}-2.algolianet.com` - `https://{APPLICATION_ID}-3.algolianet.com` These URLs use a different + * DNS provider than the primary URLs. You should randomize this list to ensure an even load across the three servers. + * All Algolia API clients implement this retry strategy. ## Authentication To authenticate your API requests, add + * these headers: - `x-algolia-application-id`. Your Algolia application ID. - `x-algolia-api-key`. An API key with the + * necessary permissions to make the request. The required access control list (ACL) to make a request is listed in + * each endpoint's reference. You can find your application ID and API key in the [Algolia + * dashboard](https://dashboard.algolia.com/account). ## Request format Request bodies must be JSON objects. ## + * Response status and errors The Recommend API returns JSON responses. Since JSON doesn't guarantee any specific + * ordering, don't rely on the order of attributes in the API response. Successful responses return a `2xx` status. + * Client errors return a `4xx` status. Server errors are indicated by a `5xx` status. Error responses have a `message` + * property with more information. ## Version The current version of the Recommend API is version 1, as indicated by + * the `/1/` in each endpoint's URL. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech Do not edit the class manually. + */ +package algoliasearch.recommend + +import org.json4s._ + +/** OptionalWords + */ +sealed trait OptionalWords + +object OptionalWords { + + case class StringValue(value: String) extends OptionalWords + case class SeqOfString(value: Seq[String]) extends OptionalWords + + def apply(value: String): OptionalWords = { + OptionalWords.StringValue(value) + } + def apply(value: Seq[String]): OptionalWords = { + OptionalWords.SeqOfString(value) + } + +} + +object OptionalWordsSerializer extends Serializer[OptionalWords] { + override def deserialize(implicit format: Formats): PartialFunction[(TypeInfo, JValue), OptionalWords] = { + + case (TypeInfo(clazz, _), json) if clazz == classOf[OptionalWords] => + json match { + case JString(value) => OptionalWords.StringValue(value) + case JArray(value) if value.forall(_.isInstanceOf[JArray]) => OptionalWords.SeqOfString(value.map(_.extract)) + case _ => throw new MappingException("Can't convert " + json + " to OptionalWords") + } + } + + override def serialize(implicit format: Formats): PartialFunction[Any, JValue] = { case value: OptionalWords => + value match { + case OptionalWords.StringValue(value) => JString(value) + case OptionalWords.SeqOfString(value) => JArray(value.map(Extraction.decompose).toList) + } + } +} diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendIndexSettings.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendIndexSettings.scala index 7836664991..fc05c1c087 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendIndexSettings.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendIndexSettings.scala @@ -140,6 +140,9 @@ import algoliasearch.recommend.SupportedLanguage._ * `distinct` search parameter to control how many items per group are included in the search results. If you want to * use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. * This applies faceting _after_ deduplication, which will result in accurate facet counts. + * @param maxFacetHits + * 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). * @param attributesToRetrieve * 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 @@ -224,19 +227,6 @@ import algoliasearch.recommend.SupportedLanguage._ * @param advancedSyntax * Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` * parameter to control which feature is supported. - * @param optionalWords - * 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). * @param disableExactOnAttributes * 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). @@ -276,9 +266,6 @@ import algoliasearch.recommend.SupportedLanguage._ * these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or * any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your * search UI. - * @param maxFacetHits - * 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). * @param maxValuesPerFacet * Maximum number of facet values to return for each facet. * @param sortFacetValuesBy @@ -314,6 +301,7 @@ case class RecommendIndexSettings( userData: Option[Any] = scala.None, customNormalization: Option[Map[String, Map[String, String]]] = scala.None, attributeForDistinct: Option[String] = scala.None, + maxFacetHits: Option[Int] = scala.None, attributesToRetrieve: Option[Seq[String]] = scala.None, ranking: Option[Seq[String]] = scala.None, relevancyStrictness: Option[Int] = scala.None, @@ -337,7 +325,7 @@ case class RecommendIndexSettings( queryType: Option[QueryType] = scala.None, removeWordsIfNoResults: Option[RemoveWordsIfNoResults] = scala.None, advancedSyntax: Option[Boolean] = scala.None, - optionalWords: Option[Seq[String]] = scala.None, + optionalWords: Option[OptionalWords] = scala.None, disableExactOnAttributes: Option[Seq[String]] = scala.None, exactOnSingleWordQuery: Option[ExactOnSingleWordQuery] = scala.None, alternativesAsExact: Option[Seq[AlternativesAsExact]] = scala.None, @@ -346,7 +334,6 @@ case class RecommendIndexSettings( replaceSynonymsInHighlight: Option[Boolean] = scala.None, minProximity: Option[Int] = scala.None, responseFields: Option[Seq[String]] = scala.None, - maxFacetHits: Option[Int] = scala.None, maxValuesPerFacet: Option[Int] = scala.None, sortFacetValuesBy: Option[String] = scala.None, attributeCriteriaComputedByMinProximity: Option[Boolean] = scala.None, diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendSearchParams.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendSearchParams.scala index dbfe5370ec..98659acd93 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendSearchParams.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendSearchParams.scala @@ -82,11 +82,6 @@ import algoliasearch.recommend.SupportedLanguage._ * Whether to obtain the coordinates from the request's IP address. * @param minimumAroundRadius * Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox - * 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). * @param insidePolygon * 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 @@ -230,6 +225,9 @@ import algoliasearch.recommend.SupportedLanguage._ * `distinct` search parameter to control how many items per group are included in the search results. If you want to * use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. * This applies faceting _after_ deduplication, which will result in accurate facet counts. + * @param maxFacetHits + * 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). * @param attributesToRetrieve * 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 @@ -314,19 +312,6 @@ import algoliasearch.recommend.SupportedLanguage._ * @param advancedSyntax * Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` * parameter to control which feature is supported. - * @param optionalWords - * 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). * @param disableExactOnAttributes * 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). @@ -366,9 +351,6 @@ import algoliasearch.recommend.SupportedLanguage._ * these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or * any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your * search UI. - * @param maxFacetHits - * 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). * @param maxValuesPerFacet * Maximum number of facet values to return for each facet. * @param sortFacetValuesBy @@ -402,7 +384,7 @@ case class RecommendSearchParams( aroundRadius: Option[AroundRadius] = scala.None, aroundPrecision: Option[AroundPrecision] = scala.None, minimumAroundRadius: Option[Int] = scala.None, - insideBoundingBox: Option[Seq[Seq[Double]]] = scala.None, + insideBoundingBox: Option[InsideBoundingBox] = scala.None, insidePolygon: Option[Seq[Seq[Double]]] = scala.None, naturalLanguages: Option[Seq[SupportedLanguage]] = scala.None, ruleContexts: Option[Seq[String]] = scala.None, @@ -433,6 +415,7 @@ case class RecommendSearchParams( userData: Option[Any] = scala.None, customNormalization: Option[Map[String, Map[String, String]]] = scala.None, attributeForDistinct: Option[String] = scala.None, + maxFacetHits: Option[Int] = scala.None, attributesToRetrieve: Option[Seq[String]] = scala.None, ranking: Option[Seq[String]] = scala.None, relevancyStrictness: Option[Int] = scala.None, @@ -456,7 +439,7 @@ case class RecommendSearchParams( queryType: Option[QueryType] = scala.None, removeWordsIfNoResults: Option[RemoveWordsIfNoResults] = scala.None, advancedSyntax: Option[Boolean] = scala.None, - optionalWords: Option[Seq[String]] = scala.None, + optionalWords: Option[OptionalWords] = scala.None, disableExactOnAttributes: Option[Seq[String]] = scala.None, exactOnSingleWordQuery: Option[ExactOnSingleWordQuery] = scala.None, alternativesAsExact: Option[Seq[AlternativesAsExact]] = scala.None, @@ -465,7 +448,6 @@ case class RecommendSearchParams( replaceSynonymsInHighlight: Option[Boolean] = scala.None, minProximity: Option[Int] = scala.None, responseFields: Option[Seq[String]] = scala.None, - maxFacetHits: Option[Int] = scala.None, maxValuesPerFacet: Option[Int] = scala.None, sortFacetValuesBy: Option[String] = scala.None, attributeCriteriaComputedByMinProximity: Option[Boolean] = scala.None, diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BaseIndexSettings.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BaseIndexSettings.scala index 6a8ce8dd9e..9a34e7775d 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BaseIndexSettings.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BaseIndexSettings.scala @@ -139,6 +139,9 @@ import algoliasearch.search.SupportedLanguage._ * `distinct` search parameter to control how many items per group are included in the search results. If you want to * use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. * This applies faceting _after_ deduplication, which will result in accurate facet counts. + * @param maxFacetHits + * 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). */ case class BaseIndexSettings( attributesForFaceting: Option[Seq[String]] = scala.None, @@ -157,5 +160,6 @@ case class BaseIndexSettings( searchableAttributes: Option[Seq[String]] = scala.None, userData: Option[Any] = scala.None, customNormalization: Option[Map[String, Map[String, String]]] = scala.None, - attributeForDistinct: Option[String] = scala.None + attributeForDistinct: Option[String] = scala.None, + maxFacetHits: Option[Int] = scala.None ) diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BaseSearchParams.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BaseSearchParams.scala index 12830d3838..2fb1fb1f72 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BaseSearchParams.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BaseSearchParams.scala @@ -89,11 +89,6 @@ import algoliasearch.search.SupportedLanguage._ * Whether to obtain the coordinates from the request's IP address. * @param minimumAroundRadius * Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox - * 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). * @param insidePolygon * 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 @@ -154,7 +149,7 @@ case class BaseSearchParams( aroundRadius: Option[AroundRadius] = scala.None, aroundPrecision: Option[AroundPrecision] = scala.None, minimumAroundRadius: Option[Int] = scala.None, - insideBoundingBox: Option[Seq[Seq[Double]]] = scala.None, + insideBoundingBox: Option[InsideBoundingBox] = scala.None, insidePolygon: Option[Seq[Seq[Double]]] = scala.None, naturalLanguages: Option[Seq[SupportedLanguage]] = scala.None, ruleContexts: Option[Seq[String]] = scala.None, diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BaseSearchParamsWithoutQuery.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BaseSearchParamsWithoutQuery.scala index 703ff84582..6e7735fc54 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BaseSearchParamsWithoutQuery.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BaseSearchParamsWithoutQuery.scala @@ -87,11 +87,6 @@ import algoliasearch.search.SupportedLanguage._ * Whether to obtain the coordinates from the request's IP address. * @param minimumAroundRadius * Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox - * 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). * @param insidePolygon * 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 @@ -151,7 +146,7 @@ case class BaseSearchParamsWithoutQuery( aroundRadius: Option[AroundRadius] = scala.None, aroundPrecision: Option[AroundPrecision] = scala.None, minimumAroundRadius: Option[Int] = scala.None, - insideBoundingBox: Option[Seq[Seq[Double]]] = scala.None, + insideBoundingBox: Option[InsideBoundingBox] = scala.None, insidePolygon: Option[Seq[Seq[Double]]] = scala.None, naturalLanguages: Option[Seq[SupportedLanguage]] = scala.None, ruleContexts: Option[Seq[String]] = scala.None, diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BrowseParamsObject.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BrowseParamsObject.scala index 1745c58b3f..88cf02d83e 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BrowseParamsObject.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BrowseParamsObject.scala @@ -95,11 +95,6 @@ import algoliasearch.search.SupportedLanguage._ * Whether to obtain the coordinates from the request's IP address. * @param minimumAroundRadius * Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox - * 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). * @param insidePolygon * 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 @@ -239,19 +234,6 @@ import algoliasearch.search.SupportedLanguage._ * @param advancedSyntax * Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` * parameter to control which feature is supported. - * @param optionalWords - * 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). * @param disableExactOnAttributes * 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). @@ -291,9 +273,6 @@ import algoliasearch.search.SupportedLanguage._ * these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or * any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your * search UI. - * @param maxFacetHits - * 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). * @param maxValuesPerFacet * Maximum number of facet values to return for each facet. * @param sortFacetValuesBy @@ -334,7 +313,7 @@ case class BrowseParamsObject( aroundRadius: Option[AroundRadius] = scala.None, aroundPrecision: Option[AroundPrecision] = scala.None, minimumAroundRadius: Option[Int] = scala.None, - insideBoundingBox: Option[Seq[Seq[Double]]] = scala.None, + insideBoundingBox: Option[InsideBoundingBox] = scala.None, insidePolygon: Option[Seq[Seq[Double]]] = scala.None, naturalLanguages: Option[Seq[SupportedLanguage]] = scala.None, ruleContexts: Option[Seq[String]] = scala.None, @@ -375,7 +354,7 @@ case class BrowseParamsObject( mode: Option[Mode] = scala.None, semanticSearch: Option[SemanticSearch] = scala.None, advancedSyntax: Option[Boolean] = scala.None, - optionalWords: Option[Seq[String]] = scala.None, + optionalWords: Option[OptionalWords] = scala.None, disableExactOnAttributes: Option[Seq[String]] = scala.None, exactOnSingleWordQuery: Option[ExactOnSingleWordQuery] = scala.None, alternativesAsExact: Option[Seq[AlternativesAsExact]] = scala.None, @@ -384,7 +363,6 @@ case class BrowseParamsObject( replaceSynonymsInHighlight: Option[Boolean] = scala.None, minProximity: Option[Int] = scala.None, responseFields: Option[Seq[String]] = scala.None, - maxFacetHits: Option[Int] = scala.None, maxValuesPerFacet: Option[Int] = scala.None, sortFacetValuesBy: Option[String] = scala.None, attributeCriteriaComputedByMinProximity: Option[Boolean] = scala.None, diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/ConsequenceParams.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/ConsequenceParams.scala index 55d99a0d11..5146e004d0 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/ConsequenceParams.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/ConsequenceParams.scala @@ -93,11 +93,6 @@ import algoliasearch.search.SupportedLanguage._ * Whether to obtain the coordinates from the request's IP address. * @param minimumAroundRadius * Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox - * 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). * @param insidePolygon * 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 @@ -237,19 +232,6 @@ import algoliasearch.search.SupportedLanguage._ * @param advancedSyntax * Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` * parameter to control which feature is supported. - * @param optionalWords - * 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). * @param disableExactOnAttributes * 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). @@ -289,9 +271,6 @@ import algoliasearch.search.SupportedLanguage._ * these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or * any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your * search UI. - * @param maxFacetHits - * 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). * @param maxValuesPerFacet * Maximum number of facet values to return for each facet. * @param sortFacetValuesBy @@ -328,7 +307,7 @@ case class ConsequenceParams( aroundRadius: Option[AroundRadius] = scala.None, aroundPrecision: Option[AroundPrecision] = scala.None, minimumAroundRadius: Option[Int] = scala.None, - insideBoundingBox: Option[Seq[Seq[Double]]] = scala.None, + insideBoundingBox: Option[InsideBoundingBox] = scala.None, insidePolygon: Option[Seq[Seq[Double]]] = scala.None, naturalLanguages: Option[Seq[SupportedLanguage]] = scala.None, ruleContexts: Option[Seq[String]] = scala.None, @@ -369,7 +348,7 @@ case class ConsequenceParams( mode: Option[Mode] = scala.None, semanticSearch: Option[SemanticSearch] = scala.None, advancedSyntax: Option[Boolean] = scala.None, - optionalWords: Option[Seq[String]] = scala.None, + optionalWords: Option[OptionalWords] = scala.None, disableExactOnAttributes: Option[Seq[String]] = scala.None, exactOnSingleWordQuery: Option[ExactOnSingleWordQuery] = scala.None, alternativesAsExact: Option[Seq[AlternativesAsExact]] = scala.None, @@ -378,7 +357,6 @@ case class ConsequenceParams( replaceSynonymsInHighlight: Option[Boolean] = scala.None, minProximity: Option[Int] = scala.None, responseFields: Option[Seq[String]] = scala.None, - maxFacetHits: Option[Int] = scala.None, maxValuesPerFacet: Option[Int] = scala.None, sortFacetValuesBy: Option[String] = scala.None, attributeCriteriaComputedByMinProximity: Option[Boolean] = scala.None, diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/DeleteByParams.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/DeleteByParams.scala index b9ce76cd26..657373a309 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/DeleteByParams.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/DeleteByParams.scala @@ -54,11 +54,6 @@ package algoliasearch.search * records included within a circle around this central location are included in the results. The radius of the * circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you * also specify `insidePolygon` or `insideBoundingBox`. - * @param insideBoundingBox - * 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). * @param insidePolygon * 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 @@ -73,6 +68,6 @@ case class DeleteByParams( tagFilters: Option[TagFilters] = scala.None, aroundLatLng: Option[String] = scala.None, aroundRadius: Option[AroundRadius] = scala.None, - insideBoundingBox: Option[Seq[Seq[Double]]] = scala.None, + insideBoundingBox: Option[InsideBoundingBox] = scala.None, insidePolygon: Option[Seq[Seq[Double]]] = scala.None ) diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/IndexSettings.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/IndexSettings.scala index 834e36a415..ab8805399f 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/IndexSettings.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/IndexSettings.scala @@ -145,6 +145,9 @@ import algoliasearch.search.SupportedLanguage._ * `distinct` search parameter to control how many items per group are included in the search results. If you want to * use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. * This applies faceting _after_ deduplication, which will result in accurate facet counts. + * @param maxFacetHits + * 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). * @param attributesToRetrieve * 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 @@ -245,19 +248,6 @@ import algoliasearch.search.SupportedLanguage._ * @param advancedSyntax * Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` * parameter to control which feature is supported. - * @param optionalWords - * 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). * @param disableExactOnAttributes * 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). @@ -297,9 +287,6 @@ import algoliasearch.search.SupportedLanguage._ * these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or * any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your * search UI. - * @param maxFacetHits - * 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). * @param maxValuesPerFacet * Maximum number of facet values to return for each facet. * @param sortFacetValuesBy @@ -335,6 +322,7 @@ case class IndexSettings( userData: Option[Any] = scala.None, customNormalization: Option[Map[String, Map[String, String]]] = scala.None, attributeForDistinct: Option[String] = scala.None, + maxFacetHits: Option[Int] = scala.None, attributesToRetrieve: Option[Seq[String]] = scala.None, ranking: Option[Seq[String]] = scala.None, customRanking: Option[Seq[String]] = scala.None, @@ -363,7 +351,7 @@ case class IndexSettings( mode: Option[Mode] = scala.None, semanticSearch: Option[SemanticSearch] = scala.None, advancedSyntax: Option[Boolean] = scala.None, - optionalWords: Option[Seq[String]] = scala.None, + optionalWords: Option[OptionalWords] = scala.None, disableExactOnAttributes: Option[Seq[String]] = scala.None, exactOnSingleWordQuery: Option[ExactOnSingleWordQuery] = scala.None, alternativesAsExact: Option[Seq[AlternativesAsExact]] = scala.None, @@ -372,7 +360,6 @@ case class IndexSettings( replaceSynonymsInHighlight: Option[Boolean] = scala.None, minProximity: Option[Int] = scala.None, responseFields: Option[Seq[String]] = scala.None, - maxFacetHits: Option[Int] = scala.None, maxValuesPerFacet: Option[Int] = scala.None, sortFacetValuesBy: Option[String] = scala.None, attributeCriteriaComputedByMinProximity: Option[Boolean] = scala.None, diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/IndexSettingsAsSearchParams.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/IndexSettingsAsSearchParams.scala index 1f280ff41a..37e5dce5d5 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/IndexSettingsAsSearchParams.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/IndexSettingsAsSearchParams.scala @@ -143,19 +143,6 @@ import algoliasearch.search.SupportedLanguage._ * @param advancedSyntax * Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` * parameter to control which feature is supported. - * @param optionalWords - * 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). * @param disableExactOnAttributes * 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). @@ -195,9 +182,6 @@ import algoliasearch.search.SupportedLanguage._ * these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or * any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your * search UI. - * @param maxFacetHits - * 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). * @param maxValuesPerFacet * Maximum number of facet values to return for each facet. * @param sortFacetValuesBy @@ -244,7 +228,7 @@ case class IndexSettingsAsSearchParams( mode: Option[Mode] = scala.None, semanticSearch: Option[SemanticSearch] = scala.None, advancedSyntax: Option[Boolean] = scala.None, - optionalWords: Option[Seq[String]] = scala.None, + optionalWords: Option[OptionalWords] = scala.None, disableExactOnAttributes: Option[Seq[String]] = scala.None, exactOnSingleWordQuery: Option[ExactOnSingleWordQuery] = scala.None, alternativesAsExact: Option[Seq[AlternativesAsExact]] = scala.None, @@ -253,7 +237,6 @@ case class IndexSettingsAsSearchParams( replaceSynonymsInHighlight: Option[Boolean] = scala.None, minProximity: Option[Int] = scala.None, responseFields: Option[Seq[String]] = scala.None, - maxFacetHits: Option[Int] = scala.None, maxValuesPerFacet: Option[Int] = scala.None, sortFacetValuesBy: Option[String] = scala.None, attributeCriteriaComputedByMinProximity: Option[Boolean] = scala.None, diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/InsideBoundingBox.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/InsideBoundingBox.scala new file mode 100644 index 0000000000..69eb76826e --- /dev/null +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/InsideBoundingBox.scala @@ -0,0 +1,74 @@ +/** Search API The Algolia Search API lets you search, configure, and manage your indices and records. ## Client + * libraries Use Algolia's API clients and libraries to reliably integrate Algolia's APIs with your apps. The official + * API clients are covered by Algolia's [Service Level Agreement](https://www.algolia.com/policies/sla/). See: + * [Algolia's ecosystem](https://www.algolia.com/doc/guides/getting-started/how-algolia-works/in-depth/ecosystem/) ## + * Base URLs The base URLs for requests to the Search API are: - `https://{APPLICATION_ID}.algolia.net` - + * `https://{APPLICATION_ID}-dsn.algolia.net`. If your subscription includes a [Distributed Search + * Network](https://dashboard.algolia.com/infra), this ensures that requests are sent to servers closest to users. Both + * URLs provide high availability by distributing requests with load balancing. **All requests must use HTTPS.** ## + * Retry strategy To guarantee high availability, implement a retry strategy for all API requests using the URLs of + * your servers as fallbacks: - `https://{APPLICATION_ID}-1.algolianet.com` - + * `https://{APPLICATION_ID}-2.algolianet.com` - `https://{APPLICATION_ID}-3.algolianet.com` These URLs use a different + * DNS provider than the primary URLs. You should randomize this list to ensure an even load across the three servers. + * All Algolia API clients implement this retry strategy. ## Authentication To authenticate your API requests, add + * these headers: - `x-algolia-application-id`. Your Algolia application ID. - `x-algolia-api-key`. An API key with the + * necessary permissions to make the request. The required access control list (ACL) to make a request is listed in + * each endpoint's reference. You can find your application ID and API key in the [Algolia + * dashboard](https://dashboard.algolia.com/account). ## Request format Depending on the endpoint, request bodies are + * either JSON objects or arrays of JSON objects, ## Parameters Parameters are passed as query parameters for GET and + * DELETE requests, and in the request body for POST and PUT requests. Query parameters must be + * [URL-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). Non-ASCII characters must be + * UTF-8 encoded. Plus characters (`+`) are interpreted as spaces. Arrays as query parameters must be one of: - A + * comma-separated string: `attributesToRetrieve=title,description` - A URL-encoded JSON array: + * `attributesToRetrieve=%5B%22title%22,%22description%22%D` ## Response status and errors The Search API returns JSON + * responses. Since JSON doesn't guarantee any specific ordering, don't rely on the order of attributes in the API + * response. Successful responses return a `2xx` status. Client errors return a `4xx` status. Server errors are + * indicated by a `5xx` status. Error responses have a `message` property with more information. ## Version The current + * version of the Search API is version 1, as indicated by the `/1/` in each endpoint's URL. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech Do not edit the class manually. + */ +package algoliasearch.search + +import org.json4s._ + +/** InsideBoundingBox + */ +sealed trait InsideBoundingBox + +object InsideBoundingBox { + + case class StringValue(value: String) extends InsideBoundingBox + case class SeqOfSeqOfDouble(value: Seq[Seq[Double]]) extends InsideBoundingBox + + def apply(value: String): InsideBoundingBox = { + InsideBoundingBox.StringValue(value) + } + def apply(value: Seq[Seq[Double]]): InsideBoundingBox = { + InsideBoundingBox.SeqOfSeqOfDouble(value) + } + +} + +object InsideBoundingBoxSerializer extends Serializer[InsideBoundingBox] { + override def deserialize(implicit format: Formats): PartialFunction[(TypeInfo, JValue), InsideBoundingBox] = { + + case (TypeInfo(clazz, _), json) if clazz == classOf[InsideBoundingBox] => + json match { + case JString(value) => InsideBoundingBox.StringValue(value) + case JArray(value) if value.forall(_.isInstanceOf[JArray]) => + InsideBoundingBox.SeqOfSeqOfDouble(value.map(_.extract)) + case _ => throw new MappingException("Can't convert " + json + " to InsideBoundingBox") + } + } + + override def serialize(implicit format: Formats): PartialFunction[Any, JValue] = { case value: InsideBoundingBox => + value match { + case InsideBoundingBox.StringValue(value) => JString(value) + case InsideBoundingBox.SeqOfSeqOfDouble(value) => JArray(value.map(Extraction.decompose).toList) + } + } +} diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/JsonSupport.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/JsonSupport.scala index 898127cbfc..9a6cd3632d 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/JsonSupport.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/JsonSupport.scala @@ -80,8 +80,10 @@ object JsonSupport { FacetFiltersSerializer :+ HighlightResultSerializer :+ IgnorePluralsSerializer :+ + InsideBoundingBoxSerializer :+ NumericFiltersSerializer :+ OptionalFiltersSerializer :+ + OptionalWordsSerializer :+ PromoteSerializer :+ ReRankingApplyFilterSerializer :+ RemoveStopWordsSerializer :+ diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/OptionalWords.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/OptionalWords.scala new file mode 100644 index 0000000000..ead19cd898 --- /dev/null +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/OptionalWords.scala @@ -0,0 +1,73 @@ +/** Search API The Algolia Search API lets you search, configure, and manage your indices and records. ## Client + * libraries Use Algolia's API clients and libraries to reliably integrate Algolia's APIs with your apps. The official + * API clients are covered by Algolia's [Service Level Agreement](https://www.algolia.com/policies/sla/). See: + * [Algolia's ecosystem](https://www.algolia.com/doc/guides/getting-started/how-algolia-works/in-depth/ecosystem/) ## + * Base URLs The base URLs for requests to the Search API are: - `https://{APPLICATION_ID}.algolia.net` - + * `https://{APPLICATION_ID}-dsn.algolia.net`. If your subscription includes a [Distributed Search + * Network](https://dashboard.algolia.com/infra), this ensures that requests are sent to servers closest to users. Both + * URLs provide high availability by distributing requests with load balancing. **All requests must use HTTPS.** ## + * Retry strategy To guarantee high availability, implement a retry strategy for all API requests using the URLs of + * your servers as fallbacks: - `https://{APPLICATION_ID}-1.algolianet.com` - + * `https://{APPLICATION_ID}-2.algolianet.com` - `https://{APPLICATION_ID}-3.algolianet.com` These URLs use a different + * DNS provider than the primary URLs. You should randomize this list to ensure an even load across the three servers. + * All Algolia API clients implement this retry strategy. ## Authentication To authenticate your API requests, add + * these headers: - `x-algolia-application-id`. Your Algolia application ID. - `x-algolia-api-key`. An API key with the + * necessary permissions to make the request. The required access control list (ACL) to make a request is listed in + * each endpoint's reference. You can find your application ID and API key in the [Algolia + * dashboard](https://dashboard.algolia.com/account). ## Request format Depending on the endpoint, request bodies are + * either JSON objects or arrays of JSON objects, ## Parameters Parameters are passed as query parameters for GET and + * DELETE requests, and in the request body for POST and PUT requests. Query parameters must be + * [URL-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). Non-ASCII characters must be + * UTF-8 encoded. Plus characters (`+`) are interpreted as spaces. Arrays as query parameters must be one of: - A + * comma-separated string: `attributesToRetrieve=title,description` - A URL-encoded JSON array: + * `attributesToRetrieve=%5B%22title%22,%22description%22%D` ## Response status and errors The Search API returns JSON + * responses. Since JSON doesn't guarantee any specific ordering, don't rely on the order of attributes in the API + * response. Successful responses return a `2xx` status. Client errors return a `4xx` status. Server errors are + * indicated by a `5xx` status. Error responses have a `message` property with more information. ## Version The current + * version of the Search API is version 1, as indicated by the `/1/` in each endpoint's URL. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech Do not edit the class manually. + */ +package algoliasearch.search + +import org.json4s._ + +/** OptionalWords + */ +sealed trait OptionalWords + +object OptionalWords { + + case class StringValue(value: String) extends OptionalWords + case class SeqOfString(value: Seq[String]) extends OptionalWords + + def apply(value: String): OptionalWords = { + OptionalWords.StringValue(value) + } + def apply(value: Seq[String]): OptionalWords = { + OptionalWords.SeqOfString(value) + } + +} + +object OptionalWordsSerializer extends Serializer[OptionalWords] { + override def deserialize(implicit format: Formats): PartialFunction[(TypeInfo, JValue), OptionalWords] = { + + case (TypeInfo(clazz, _), json) if clazz == classOf[OptionalWords] => + json match { + case JString(value) => OptionalWords.StringValue(value) + case JArray(value) if value.forall(_.isInstanceOf[JArray]) => OptionalWords.SeqOfString(value.map(_.extract)) + case _ => throw new MappingException("Can't convert " + json + " to OptionalWords") + } + } + + override def serialize(implicit format: Formats): PartialFunction[Any, JValue] = { case value: OptionalWords => + value match { + case OptionalWords.StringValue(value) => JString(value) + case OptionalWords.SeqOfString(value) => JArray(value.map(Extraction.decompose).toList) + } + } +} diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SearchForFacets.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SearchForFacets.scala index 750f7cdf90..027e4523d6 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SearchForFacets.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SearchForFacets.scala @@ -98,11 +98,6 @@ import algoliasearch.search.SupportedLanguage._ * Whether to obtain the coordinates from the request's IP address. * @param minimumAroundRadius * Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox - * 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). * @param insidePolygon * 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 @@ -242,19 +237,6 @@ import algoliasearch.search.SupportedLanguage._ * @param advancedSyntax * Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` * parameter to control which feature is supported. - * @param optionalWords - * 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). * @param disableExactOnAttributes * 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). @@ -294,9 +276,6 @@ import algoliasearch.search.SupportedLanguage._ * these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or * any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your * search UI. - * @param maxFacetHits - * 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). * @param maxValuesPerFacet * Maximum number of facet values to return for each facet. * @param sortFacetValuesBy @@ -319,6 +298,9 @@ import algoliasearch.search.SupportedLanguage._ * Index name (case-sensitive). * @param facetQuery * Text to search inside the facet's values. + * @param maxFacetHits + * 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). */ case class SearchForFacets( params: Option[String] = scala.None, @@ -341,7 +323,7 @@ case class SearchForFacets( aroundRadius: Option[AroundRadius] = scala.None, aroundPrecision: Option[AroundPrecision] = scala.None, minimumAroundRadius: Option[Int] = scala.None, - insideBoundingBox: Option[Seq[Seq[Double]]] = scala.None, + insideBoundingBox: Option[InsideBoundingBox] = scala.None, insidePolygon: Option[Seq[Seq[Double]]] = scala.None, naturalLanguages: Option[Seq[SupportedLanguage]] = scala.None, ruleContexts: Option[Seq[String]] = scala.None, @@ -382,7 +364,7 @@ case class SearchForFacets( mode: Option[Mode] = scala.None, semanticSearch: Option[SemanticSearch] = scala.None, advancedSyntax: Option[Boolean] = scala.None, - optionalWords: Option[Seq[String]] = scala.None, + optionalWords: Option[OptionalWords] = scala.None, disableExactOnAttributes: Option[Seq[String]] = scala.None, exactOnSingleWordQuery: Option[ExactOnSingleWordQuery] = scala.None, alternativesAsExact: Option[Seq[AlternativesAsExact]] = scala.None, @@ -391,7 +373,6 @@ case class SearchForFacets( replaceSynonymsInHighlight: Option[Boolean] = scala.None, minProximity: Option[Int] = scala.None, responseFields: Option[Seq[String]] = scala.None, - maxFacetHits: Option[Int] = scala.None, maxValuesPerFacet: Option[Int] = scala.None, sortFacetValuesBy: Option[String] = scala.None, attributeCriteriaComputedByMinProximity: Option[Boolean] = scala.None, @@ -401,5 +382,6 @@ case class SearchForFacets( facet: String, indexName: String, facetQuery: Option[String] = scala.None, + maxFacetHits: Option[Int] = scala.None, `type`: SearchTypeFacet ) extends SearchQueryTrait diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SearchForHits.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SearchForHits.scala index da56b51c8e..d6ce31350c 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SearchForHits.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SearchForHits.scala @@ -98,11 +98,6 @@ import algoliasearch.search.SupportedLanguage._ * Whether to obtain the coordinates from the request's IP address. * @param minimumAroundRadius * Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox - * 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). * @param insidePolygon * 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 @@ -242,19 +237,6 @@ import algoliasearch.search.SupportedLanguage._ * @param advancedSyntax * Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` * parameter to control which feature is supported. - * @param optionalWords - * 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). * @param disableExactOnAttributes * 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). @@ -294,9 +276,6 @@ import algoliasearch.search.SupportedLanguage._ * these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or * any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your * search UI. - * @param maxFacetHits - * 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). * @param maxValuesPerFacet * Maximum number of facet values to return for each facet. * @param sortFacetValuesBy @@ -337,7 +316,7 @@ case class SearchForHits( aroundRadius: Option[AroundRadius] = scala.None, aroundPrecision: Option[AroundPrecision] = scala.None, minimumAroundRadius: Option[Int] = scala.None, - insideBoundingBox: Option[Seq[Seq[Double]]] = scala.None, + insideBoundingBox: Option[InsideBoundingBox] = scala.None, insidePolygon: Option[Seq[Seq[Double]]] = scala.None, naturalLanguages: Option[Seq[SupportedLanguage]] = scala.None, ruleContexts: Option[Seq[String]] = scala.None, @@ -378,7 +357,7 @@ case class SearchForHits( mode: Option[Mode] = scala.None, semanticSearch: Option[SemanticSearch] = scala.None, advancedSyntax: Option[Boolean] = scala.None, - optionalWords: Option[Seq[String]] = scala.None, + optionalWords: Option[OptionalWords] = scala.None, disableExactOnAttributes: Option[Seq[String]] = scala.None, exactOnSingleWordQuery: Option[ExactOnSingleWordQuery] = scala.None, alternativesAsExact: Option[Seq[AlternativesAsExact]] = scala.None, @@ -387,7 +366,6 @@ case class SearchForHits( replaceSynonymsInHighlight: Option[Boolean] = scala.None, minProximity: Option[Int] = scala.None, responseFields: Option[Seq[String]] = scala.None, - maxFacetHits: Option[Int] = scala.None, maxValuesPerFacet: Option[Int] = scala.None, sortFacetValuesBy: Option[String] = scala.None, attributeCriteriaComputedByMinProximity: Option[Boolean] = scala.None, diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SearchParamsObject.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SearchParamsObject.scala index 8058d92aa9..5b39457395 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SearchParamsObject.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SearchParamsObject.scala @@ -95,11 +95,6 @@ import algoliasearch.search.SupportedLanguage._ * Whether to obtain the coordinates from the request's IP address. * @param minimumAroundRadius * Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox - * 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). * @param insidePolygon * 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 @@ -239,19 +234,6 @@ import algoliasearch.search.SupportedLanguage._ * @param advancedSyntax * Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` * parameter to control which feature is supported. - * @param optionalWords - * 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). * @param disableExactOnAttributes * 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). @@ -291,9 +273,6 @@ import algoliasearch.search.SupportedLanguage._ * these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or * any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your * search UI. - * @param maxFacetHits - * 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). * @param maxValuesPerFacet * Maximum number of facet values to return for each facet. * @param sortFacetValuesBy @@ -331,7 +310,7 @@ case class SearchParamsObject( aroundRadius: Option[AroundRadius] = scala.None, aroundPrecision: Option[AroundPrecision] = scala.None, minimumAroundRadius: Option[Int] = scala.None, - insideBoundingBox: Option[Seq[Seq[Double]]] = scala.None, + insideBoundingBox: Option[InsideBoundingBox] = scala.None, insidePolygon: Option[Seq[Seq[Double]]] = scala.None, naturalLanguages: Option[Seq[SupportedLanguage]] = scala.None, ruleContexts: Option[Seq[String]] = scala.None, @@ -372,7 +351,7 @@ case class SearchParamsObject( mode: Option[Mode] = scala.None, semanticSearch: Option[SemanticSearch] = scala.None, advancedSyntax: Option[Boolean] = scala.None, - optionalWords: Option[Seq[String]] = scala.None, + optionalWords: Option[OptionalWords] = scala.None, disableExactOnAttributes: Option[Seq[String]] = scala.None, exactOnSingleWordQuery: Option[ExactOnSingleWordQuery] = scala.None, alternativesAsExact: Option[Seq[AlternativesAsExact]] = scala.None, @@ -381,7 +360,6 @@ case class SearchParamsObject( replaceSynonymsInHighlight: Option[Boolean] = scala.None, minProximity: Option[Int] = scala.None, responseFields: Option[Seq[String]] = scala.None, - maxFacetHits: Option[Int] = scala.None, maxValuesPerFacet: Option[Int] = scala.None, sortFacetValuesBy: Option[String] = scala.None, attributeCriteriaComputedByMinProximity: Option[Boolean] = scala.None, diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SettingsResponse.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SettingsResponse.scala index 1be035b6a9..807e57732b 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SettingsResponse.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/SettingsResponse.scala @@ -145,6 +145,9 @@ import algoliasearch.search.SupportedLanguage._ * `distinct` search parameter to control how many items per group are included in the search results. If you want to * use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. * This applies faceting _after_ deduplication, which will result in accurate facet counts. + * @param maxFacetHits + * 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). * @param attributesToRetrieve * 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 @@ -245,19 +248,6 @@ import algoliasearch.search.SupportedLanguage._ * @param advancedSyntax * Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` * parameter to control which feature is supported. - * @param optionalWords - * 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). * @param disableExactOnAttributes * 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). @@ -297,9 +287,6 @@ import algoliasearch.search.SupportedLanguage._ * these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or * any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your * search UI. - * @param maxFacetHits - * 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). * @param maxValuesPerFacet * Maximum number of facet values to return for each facet. * @param sortFacetValuesBy @@ -337,6 +324,7 @@ case class SettingsResponse( userData: Option[Any] = scala.None, customNormalization: Option[Map[String, Map[String, String]]] = scala.None, attributeForDistinct: Option[String] = scala.None, + maxFacetHits: Option[Int] = scala.None, attributesToRetrieve: Option[Seq[String]] = scala.None, ranking: Option[Seq[String]] = scala.None, customRanking: Option[Seq[String]] = scala.None, @@ -365,7 +353,7 @@ case class SettingsResponse( mode: Option[Mode] = scala.None, semanticSearch: Option[SemanticSearch] = scala.None, advancedSyntax: Option[Boolean] = scala.None, - optionalWords: Option[Seq[String]] = scala.None, + optionalWords: Option[OptionalWords] = scala.None, disableExactOnAttributes: Option[Seq[String]] = scala.None, exactOnSingleWordQuery: Option[ExactOnSingleWordQuery] = scala.None, alternativesAsExact: Option[Seq[AlternativesAsExact]] = scala.None, @@ -374,7 +362,6 @@ case class SettingsResponse( replaceSynonymsInHighlight: Option[Boolean] = scala.None, minProximity: Option[Int] = scala.None, responseFields: Option[Seq[String]] = scala.None, - maxFacetHits: Option[Int] = scala.None, maxValuesPerFacet: Option[Int] = scala.None, sortFacetValuesBy: Option[String] = scala.None, attributeCriteriaComputedByMinProximity: Option[Boolean] = scala.None, diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendIndexSettings.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendIndexSettings.swift index e366c7e2b9..7ca6065abe 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendIndexSettings.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendIndexSettings.swift @@ -86,19 +86,7 @@ public struct BaseRecommendIndexSettings: Codable, JSONEncodable { /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? - /// 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). - public var optionalWords: [String]? + public var optionalWords: RecommendOptionalWords? /// 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 @@ -138,9 +126,6 @@ public struct BaseRecommendIndexSettings: Codable, JSONEncodable { /// `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you /// might need in your search UI. public var responseFields: [String]? - /// 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). - public var maxFacetHits: Int? /// Maximum number of facet values to return for each facet. public var maxValuesPerFacet: Int? /// Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The @@ -184,7 +169,7 @@ public struct BaseRecommendIndexSettings: Codable, JSONEncodable { queryType: RecommendQueryType? = nil, removeWordsIfNoResults: RecommendRemoveWordsIfNoResults? = nil, advancedSyntax: Bool? = nil, - optionalWords: [String]? = nil, + optionalWords: RecommendOptionalWords? = nil, disableExactOnAttributes: [String]? = nil, exactOnSingleWordQuery: RecommendExactOnSingleWordQuery? = nil, alternativesAsExact: [RecommendAlternativesAsExact]? = nil, @@ -193,7 +178,6 @@ public struct BaseRecommendIndexSettings: Codable, JSONEncodable { replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, - maxFacetHits: Int? = nil, maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, @@ -233,7 +217,6 @@ public struct BaseRecommendIndexSettings: Codable, JSONEncodable { self.replaceSynonymsInHighlight = replaceSynonymsInHighlight self.minProximity = minProximity self.responseFields = responseFields - self.maxFacetHits = maxFacetHits self.maxValuesPerFacet = maxValuesPerFacet self.sortFacetValuesBy = sortFacetValuesBy self.attributeCriteriaComputedByMinProximity = attributeCriteriaComputedByMinProximity @@ -275,7 +258,6 @@ public struct BaseRecommendIndexSettings: Codable, JSONEncodable { case replaceSynonymsInHighlight case minProximity case responseFields - case maxFacetHits case maxValuesPerFacet case sortFacetValuesBy case attributeCriteriaComputedByMinProximity @@ -323,7 +305,6 @@ public struct BaseRecommendIndexSettings: Codable, JSONEncodable { try container.encodeIfPresent(self.replaceSynonymsInHighlight, forKey: .replaceSynonymsInHighlight) try container.encodeIfPresent(self.minProximity, forKey: .minProximity) try container.encodeIfPresent(self.responseFields, forKey: .responseFields) - try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.maxValuesPerFacet, forKey: .maxValuesPerFacet) try container.encodeIfPresent(self.sortFacetValuesBy, forKey: .sortFacetValuesBy) try container.encodeIfPresent( @@ -370,7 +351,6 @@ extension BaseRecommendIndexSettings: Equatable { lhs.replaceSynonymsInHighlight == rhs.replaceSynonymsInHighlight && lhs.minProximity == rhs.minProximity && lhs.responseFields == rhs.responseFields && - lhs.maxFacetHits == rhs.maxFacetHits && lhs.maxValuesPerFacet == rhs.maxValuesPerFacet && lhs.sortFacetValuesBy == rhs.sortFacetValuesBy && lhs.attributeCriteriaComputedByMinProximity == rhs.attributeCriteriaComputedByMinProximity && @@ -414,7 +394,6 @@ extension BaseRecommendIndexSettings: Hashable { hasher.combine(self.replaceSynonymsInHighlight?.hashValue) hasher.combine(self.minProximity?.hashValue) hasher.combine(self.responseFields?.hashValue) - hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.maxValuesPerFacet?.hashValue) hasher.combine(self.sortFacetValuesBy?.hashValue) hasher.combine(self.attributeCriteriaComputedByMinProximity?.hashValue) diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendSearchParams.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendSearchParams.swift index faadcb269c..7fc9ec936d 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendSearchParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendSearchParams.swift @@ -55,10 +55,7 @@ public struct BaseRecommendSearchParams: Codable, JSONEncodable { public var aroundPrecision: RecommendAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? - /// 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). - public var insideBoundingBox: [[Double]]? + public var insideBoundingBox: RecommendInsideBoundingBox? /// 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). @@ -112,7 +109,7 @@ public struct BaseRecommendSearchParams: Codable, JSONEncodable { aroundRadius: RecommendAroundRadius? = nil, aroundPrecision: RecommendAroundPrecision? = nil, minimumAroundRadius: Int? = nil, - insideBoundingBox: [[Double]]? = nil, + insideBoundingBox: RecommendInsideBoundingBox? = nil, insidePolygon: [[Double]]? = nil, naturalLanguages: [RecommendSupportedLanguage]? = nil, ruleContexts: [String]? = nil, diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/FallbackParams.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/FallbackParams.swift index df0d3ccb99..2e03f82494 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/FallbackParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/FallbackParams.swift @@ -55,10 +55,7 @@ public struct FallbackParams: Codable, JSONEncodable { public var aroundPrecision: RecommendAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? - /// 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). - public var insideBoundingBox: [[Double]]? + public var insideBoundingBox: RecommendInsideBoundingBox? /// 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). @@ -189,6 +186,9 @@ public struct FallbackParams: Codable, JSONEncodable { /// to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` /// setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. public var attributeForDistinct: String? + /// 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). + public var maxFacetHits: Int? /// 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 @@ -268,19 +268,7 @@ public struct FallbackParams: Codable, JSONEncodable { /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? - /// 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). - public var optionalWords: [String]? + public var optionalWords: RecommendOptionalWords? /// 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 @@ -320,9 +308,6 @@ public struct FallbackParams: Codable, JSONEncodable { /// `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you /// might need in your search UI. public var responseFields: [String]? - /// 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). - public var maxFacetHits: Int? /// Maximum number of facet values to return for each facet. public var maxValuesPerFacet: Int? /// Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The @@ -358,7 +343,7 @@ public struct FallbackParams: Codable, JSONEncodable { aroundRadius: RecommendAroundRadius? = nil, aroundPrecision: RecommendAroundPrecision? = nil, minimumAroundRadius: Int? = nil, - insideBoundingBox: [[Double]]? = nil, + insideBoundingBox: RecommendInsideBoundingBox? = nil, insidePolygon: [[Double]]? = nil, naturalLanguages: [RecommendSupportedLanguage]? = nil, ruleContexts: [String]? = nil, @@ -389,6 +374,7 @@ public struct FallbackParams: Codable, JSONEncodable { userData: AnyCodable? = nil, customNormalization: [String: [String: String]]? = nil, attributeForDistinct: String? = nil, + maxFacetHits: Int? = nil, attributesToRetrieve: [String]? = nil, ranking: [String]? = nil, relevancyStrictness: Int? = nil, @@ -412,7 +398,7 @@ public struct FallbackParams: Codable, JSONEncodable { queryType: RecommendQueryType? = nil, removeWordsIfNoResults: RecommendRemoveWordsIfNoResults? = nil, advancedSyntax: Bool? = nil, - optionalWords: [String]? = nil, + optionalWords: RecommendOptionalWords? = nil, disableExactOnAttributes: [String]? = nil, exactOnSingleWordQuery: RecommendExactOnSingleWordQuery? = nil, alternativesAsExact: [RecommendAlternativesAsExact]? = nil, @@ -421,7 +407,6 @@ public struct FallbackParams: Codable, JSONEncodable { replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, - maxFacetHits: Int? = nil, maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, @@ -475,6 +460,7 @@ public struct FallbackParams: Codable, JSONEncodable { self.userData = userData self.customNormalization = customNormalization self.attributeForDistinct = attributeForDistinct + self.maxFacetHits = maxFacetHits self.attributesToRetrieve = attributesToRetrieve self.ranking = ranking self.relevancyStrictness = relevancyStrictness @@ -507,7 +493,6 @@ public struct FallbackParams: Codable, JSONEncodable { self.replaceSynonymsInHighlight = replaceSynonymsInHighlight self.minProximity = minProximity self.responseFields = responseFields - self.maxFacetHits = maxFacetHits self.maxValuesPerFacet = maxValuesPerFacet self.sortFacetValuesBy = sortFacetValuesBy self.attributeCriteriaComputedByMinProximity = attributeCriteriaComputedByMinProximity @@ -563,6 +548,7 @@ public struct FallbackParams: Codable, JSONEncodable { case userData case customNormalization case attributeForDistinct + case maxFacetHits case attributesToRetrieve case ranking case relevancyStrictness @@ -595,7 +581,6 @@ public struct FallbackParams: Codable, JSONEncodable { case replaceSynonymsInHighlight case minProximity case responseFields - case maxFacetHits case maxValuesPerFacet case sortFacetValuesBy case attributeCriteriaComputedByMinProximity @@ -654,6 +639,7 @@ public struct FallbackParams: Codable, JSONEncodable { try container.encodeIfPresent(self.userData, forKey: .userData) try container.encodeIfPresent(self.customNormalization, forKey: .customNormalization) try container.encodeIfPresent(self.attributeForDistinct, forKey: .attributeForDistinct) + try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.attributesToRetrieve, forKey: .attributesToRetrieve) try container.encodeIfPresent(self.ranking, forKey: .ranking) try container.encodeIfPresent(self.relevancyStrictness, forKey: .relevancyStrictness) @@ -689,7 +675,6 @@ public struct FallbackParams: Codable, JSONEncodable { try container.encodeIfPresent(self.replaceSynonymsInHighlight, forKey: .replaceSynonymsInHighlight) try container.encodeIfPresent(self.minProximity, forKey: .minProximity) try container.encodeIfPresent(self.responseFields, forKey: .responseFields) - try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.maxValuesPerFacet, forKey: .maxValuesPerFacet) try container.encodeIfPresent(self.sortFacetValuesBy, forKey: .sortFacetValuesBy) try container.encodeIfPresent( @@ -750,6 +735,7 @@ extension FallbackParams: Equatable { lhs.userData == rhs.userData && lhs.customNormalization == rhs.customNormalization && lhs.attributeForDistinct == rhs.attributeForDistinct && + lhs.maxFacetHits == rhs.maxFacetHits && lhs.attributesToRetrieve == rhs.attributesToRetrieve && lhs.ranking == rhs.ranking && lhs.relevancyStrictness == rhs.relevancyStrictness && @@ -782,7 +768,6 @@ extension FallbackParams: Equatable { lhs.replaceSynonymsInHighlight == rhs.replaceSynonymsInHighlight && lhs.minProximity == rhs.minProximity && lhs.responseFields == rhs.responseFields && - lhs.maxFacetHits == rhs.maxFacetHits && lhs.maxValuesPerFacet == rhs.maxValuesPerFacet && lhs.sortFacetValuesBy == rhs.sortFacetValuesBy && lhs.attributeCriteriaComputedByMinProximity == rhs.attributeCriteriaComputedByMinProximity && @@ -840,6 +825,7 @@ extension FallbackParams: Hashable { hasher.combine(self.userData?.hashValue) hasher.combine(self.customNormalization?.hashValue) hasher.combine(self.attributeForDistinct?.hashValue) + hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.attributesToRetrieve?.hashValue) hasher.combine(self.ranking?.hashValue) hasher.combine(self.relevancyStrictness?.hashValue) @@ -872,7 +858,6 @@ extension FallbackParams: Hashable { hasher.combine(self.replaceSynonymsInHighlight?.hashValue) hasher.combine(self.minProximity?.hashValue) hasher.combine(self.responseFields?.hashValue) - hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.maxValuesPerFacet?.hashValue) hasher.combine(self.sortFacetValuesBy?.hashValue) hasher.combine(self.attributeCriteriaComputedByMinProximity?.hashValue) diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBaseIndexSettings.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBaseIndexSettings.swift index afd026af49..ddfbca558c 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBaseIndexSettings.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBaseIndexSettings.swift @@ -99,6 +99,9 @@ public struct RecommendBaseIndexSettings: Codable, JSONEncodable { /// to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` /// setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. public var attributeForDistinct: String? + /// 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). + public var maxFacetHits: Int? public init( attributesForFaceting: [String]? = nil, @@ -117,7 +120,8 @@ public struct RecommendBaseIndexSettings: Codable, JSONEncodable { searchableAttributes: [String]? = nil, userData: AnyCodable? = nil, customNormalization: [String: [String: String]]? = nil, - attributeForDistinct: String? = nil + attributeForDistinct: String? = nil, + maxFacetHits: Int? = nil ) { self.attributesForFaceting = attributesForFaceting self.replicas = replicas @@ -136,6 +140,7 @@ public struct RecommendBaseIndexSettings: Codable, JSONEncodable { self.userData = userData self.customNormalization = customNormalization self.attributeForDistinct = attributeForDistinct + self.maxFacetHits = maxFacetHits } public enum CodingKeys: String, CodingKey, CaseIterable { @@ -156,6 +161,7 @@ public struct RecommendBaseIndexSettings: Codable, JSONEncodable { case userData case customNormalization case attributeForDistinct + case maxFacetHits } // Encodable protocol methods @@ -179,6 +185,7 @@ public struct RecommendBaseIndexSettings: Codable, JSONEncodable { try container.encodeIfPresent(self.userData, forKey: .userData) try container.encodeIfPresent(self.customNormalization, forKey: .customNormalization) try container.encodeIfPresent(self.attributeForDistinct, forKey: .attributeForDistinct) + try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) } } @@ -200,7 +207,8 @@ extension RecommendBaseIndexSettings: Equatable { lhs.searchableAttributes == rhs.searchableAttributes && lhs.userData == rhs.userData && lhs.customNormalization == rhs.customNormalization && - lhs.attributeForDistinct == rhs.attributeForDistinct + lhs.attributeForDistinct == rhs.attributeForDistinct && + lhs.maxFacetHits == rhs.maxFacetHits } } @@ -223,5 +231,6 @@ extension RecommendBaseIndexSettings: Hashable { hasher.combine(self.userData?.hashValue) hasher.combine(self.customNormalization?.hashValue) hasher.combine(self.attributeForDistinct?.hashValue) + hasher.combine(self.maxFacetHits?.hashValue) } } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendIndexSettings.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendIndexSettings.swift index 6003913bc5..da261b6387 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendIndexSettings.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendIndexSettings.swift @@ -100,6 +100,9 @@ public struct RecommendIndexSettings: Codable, JSONEncodable { /// to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` /// setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. public var attributeForDistinct: String? + /// 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). + public var maxFacetHits: Int? /// 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 @@ -179,19 +182,7 @@ public struct RecommendIndexSettings: Codable, JSONEncodable { /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? - /// 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). - public var optionalWords: [String]? + public var optionalWords: RecommendOptionalWords? /// 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 @@ -231,9 +222,6 @@ public struct RecommendIndexSettings: Codable, JSONEncodable { /// `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you /// might need in your search UI. public var responseFields: [String]? - /// 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). - public var maxFacetHits: Int? /// Maximum number of facet values to return for each facet. public var maxValuesPerFacet: Int? /// Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The @@ -271,6 +259,7 @@ public struct RecommendIndexSettings: Codable, JSONEncodable { userData: AnyCodable? = nil, customNormalization: [String: [String: String]]? = nil, attributeForDistinct: String? = nil, + maxFacetHits: Int? = nil, attributesToRetrieve: [String]? = nil, ranking: [String]? = nil, relevancyStrictness: Int? = nil, @@ -294,7 +283,7 @@ public struct RecommendIndexSettings: Codable, JSONEncodable { queryType: RecommendQueryType? = nil, removeWordsIfNoResults: RecommendRemoveWordsIfNoResults? = nil, advancedSyntax: Bool? = nil, - optionalWords: [String]? = nil, + optionalWords: RecommendOptionalWords? = nil, disableExactOnAttributes: [String]? = nil, exactOnSingleWordQuery: RecommendExactOnSingleWordQuery? = nil, alternativesAsExact: [RecommendAlternativesAsExact]? = nil, @@ -303,7 +292,6 @@ public struct RecommendIndexSettings: Codable, JSONEncodable { replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, - maxFacetHits: Int? = nil, maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, @@ -328,6 +316,7 @@ public struct RecommendIndexSettings: Codable, JSONEncodable { self.userData = userData self.customNormalization = customNormalization self.attributeForDistinct = attributeForDistinct + self.maxFacetHits = maxFacetHits self.attributesToRetrieve = attributesToRetrieve self.ranking = ranking self.relevancyStrictness = relevancyStrictness @@ -360,7 +349,6 @@ public struct RecommendIndexSettings: Codable, JSONEncodable { self.replaceSynonymsInHighlight = replaceSynonymsInHighlight self.minProximity = minProximity self.responseFields = responseFields - self.maxFacetHits = maxFacetHits self.maxValuesPerFacet = maxValuesPerFacet self.sortFacetValuesBy = sortFacetValuesBy self.attributeCriteriaComputedByMinProximity = attributeCriteriaComputedByMinProximity @@ -387,6 +375,7 @@ public struct RecommendIndexSettings: Codable, JSONEncodable { case userData case customNormalization case attributeForDistinct + case maxFacetHits case attributesToRetrieve case ranking case relevancyStrictness @@ -419,7 +408,6 @@ public struct RecommendIndexSettings: Codable, JSONEncodable { case replaceSynonymsInHighlight case minProximity case responseFields - case maxFacetHits case maxValuesPerFacet case sortFacetValuesBy case attributeCriteriaComputedByMinProximity @@ -449,6 +437,7 @@ public struct RecommendIndexSettings: Codable, JSONEncodable { try container.encodeIfPresent(self.userData, forKey: .userData) try container.encodeIfPresent(self.customNormalization, forKey: .customNormalization) try container.encodeIfPresent(self.attributeForDistinct, forKey: .attributeForDistinct) + try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.attributesToRetrieve, forKey: .attributesToRetrieve) try container.encodeIfPresent(self.ranking, forKey: .ranking) try container.encodeIfPresent(self.relevancyStrictness, forKey: .relevancyStrictness) @@ -484,7 +473,6 @@ public struct RecommendIndexSettings: Codable, JSONEncodable { try container.encodeIfPresent(self.replaceSynonymsInHighlight, forKey: .replaceSynonymsInHighlight) try container.encodeIfPresent(self.minProximity, forKey: .minProximity) try container.encodeIfPresent(self.responseFields, forKey: .responseFields) - try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.maxValuesPerFacet, forKey: .maxValuesPerFacet) try container.encodeIfPresent(self.sortFacetValuesBy, forKey: .sortFacetValuesBy) try container.encodeIfPresent( @@ -516,6 +504,7 @@ extension RecommendIndexSettings: Equatable { lhs.userData == rhs.userData && lhs.customNormalization == rhs.customNormalization && lhs.attributeForDistinct == rhs.attributeForDistinct && + lhs.maxFacetHits == rhs.maxFacetHits && lhs.attributesToRetrieve == rhs.attributesToRetrieve && lhs.ranking == rhs.ranking && lhs.relevancyStrictness == rhs.relevancyStrictness && @@ -548,7 +537,6 @@ extension RecommendIndexSettings: Equatable { lhs.replaceSynonymsInHighlight == rhs.replaceSynonymsInHighlight && lhs.minProximity == rhs.minProximity && lhs.responseFields == rhs.responseFields && - lhs.maxFacetHits == rhs.maxFacetHits && lhs.maxValuesPerFacet == rhs.maxValuesPerFacet && lhs.sortFacetValuesBy == rhs.sortFacetValuesBy && lhs.attributeCriteriaComputedByMinProximity == rhs.attributeCriteriaComputedByMinProximity && @@ -577,6 +565,7 @@ extension RecommendIndexSettings: Hashable { hasher.combine(self.userData?.hashValue) hasher.combine(self.customNormalization?.hashValue) hasher.combine(self.attributeForDistinct?.hashValue) + hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.attributesToRetrieve?.hashValue) hasher.combine(self.ranking?.hashValue) hasher.combine(self.relevancyStrictness?.hashValue) @@ -609,7 +598,6 @@ extension RecommendIndexSettings: Hashable { hasher.combine(self.replaceSynonymsInHighlight?.hashValue) hasher.combine(self.minProximity?.hashValue) hasher.combine(self.responseFields?.hashValue) - hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.maxValuesPerFacet?.hashValue) hasher.combine(self.sortFacetValuesBy?.hashValue) hasher.combine(self.attributeCriteriaComputedByMinProximity?.hashValue) diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendInsideBoundingBox.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendInsideBoundingBox.swift new file mode 100644 index 0000000000..8a9f56afd0 --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendInsideBoundingBox.swift @@ -0,0 +1,51 @@ +// 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. + +import Foundation +#if canImport(Core) + import Core +#endif + +public enum RecommendInsideBoundingBox: Codable, JSONEncodable, AbstractEncodable { + case string(String) + case arrayOfArrayOfDouble([[Double]]) + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case let .string(value): + try container.encode(value) + case let .arrayOfArrayOfDouble(value): + try container.encode(value) + } + } + + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(String.self) { + self = .string(value) + } else if let value = try? container.decode([[Double]].self) { + self = .arrayOfArrayOfDouble(value) + } else { + throw DecodingError.typeMismatch( + Self.Type.self, + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of RecommendInsideBoundingBox" + ) + ) + } + } + + public func GetActualInstance() -> Encodable { + switch self { + case let .string(value): + value as String + case let .arrayOfArrayOfDouble(value): + value as [[Double]] + } + } +} + +extension RecommendInsideBoundingBox: Equatable {} +extension RecommendInsideBoundingBox: Hashable {} diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendOptionalWords.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendOptionalWords.swift new file mode 100644 index 0000000000..2f42341cd1 --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendOptionalWords.swift @@ -0,0 +1,51 @@ +// 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. + +import Foundation +#if canImport(Core) + import Core +#endif + +public enum RecommendOptionalWords: Codable, JSONEncodable, AbstractEncodable { + case string(String) + case arrayOfString([String]) + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case let .string(value): + try container.encode(value) + case let .arrayOfString(value): + try container.encode(value) + } + } + + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(String.self) { + self = .string(value) + } else if let value = try? container.decode([String].self) { + self = .arrayOfString(value) + } else { + throw DecodingError.typeMismatch( + Self.Type.self, + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of RecommendOptionalWords" + ) + ) + } + } + + public func GetActualInstance() -> Encodable { + switch self { + case let .string(value): + value as String + case let .arrayOfString(value): + value as [String] + } + } +} + +extension RecommendOptionalWords: Equatable {} +extension RecommendOptionalWords: Hashable {} diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSearchParams.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSearchParams.swift index 26e244bbaa..418e42a91e 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSearchParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSearchParams.swift @@ -56,10 +56,7 @@ public struct RecommendSearchParams: Codable, JSONEncodable { public var aroundPrecision: RecommendAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? - /// 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). - public var insideBoundingBox: [[Double]]? + public var insideBoundingBox: RecommendInsideBoundingBox? /// 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). @@ -190,6 +187,9 @@ public struct RecommendSearchParams: Codable, JSONEncodable { /// to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` /// setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. public var attributeForDistinct: String? + /// 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). + public var maxFacetHits: Int? /// 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 @@ -269,19 +269,7 @@ public struct RecommendSearchParams: Codable, JSONEncodable { /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? - /// 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). - public var optionalWords: [String]? + public var optionalWords: RecommendOptionalWords? /// 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 @@ -321,9 +309,6 @@ public struct RecommendSearchParams: Codable, JSONEncodable { /// `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you /// might need in your search UI. public var responseFields: [String]? - /// 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). - public var maxFacetHits: Int? /// Maximum number of facet values to return for each facet. public var maxValuesPerFacet: Int? /// Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The @@ -359,7 +344,7 @@ public struct RecommendSearchParams: Codable, JSONEncodable { aroundRadius: RecommendAroundRadius? = nil, aroundPrecision: RecommendAroundPrecision? = nil, minimumAroundRadius: Int? = nil, - insideBoundingBox: [[Double]]? = nil, + insideBoundingBox: RecommendInsideBoundingBox? = nil, insidePolygon: [[Double]]? = nil, naturalLanguages: [RecommendSupportedLanguage]? = nil, ruleContexts: [String]? = nil, @@ -390,6 +375,7 @@ public struct RecommendSearchParams: Codable, JSONEncodable { userData: AnyCodable? = nil, customNormalization: [String: [String: String]]? = nil, attributeForDistinct: String? = nil, + maxFacetHits: Int? = nil, attributesToRetrieve: [String]? = nil, ranking: [String]? = nil, relevancyStrictness: Int? = nil, @@ -413,7 +399,7 @@ public struct RecommendSearchParams: Codable, JSONEncodable { queryType: RecommendQueryType? = nil, removeWordsIfNoResults: RecommendRemoveWordsIfNoResults? = nil, advancedSyntax: Bool? = nil, - optionalWords: [String]? = nil, + optionalWords: RecommendOptionalWords? = nil, disableExactOnAttributes: [String]? = nil, exactOnSingleWordQuery: RecommendExactOnSingleWordQuery? = nil, alternativesAsExact: [RecommendAlternativesAsExact]? = nil, @@ -422,7 +408,6 @@ public struct RecommendSearchParams: Codable, JSONEncodable { replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, - maxFacetHits: Int? = nil, maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, @@ -476,6 +461,7 @@ public struct RecommendSearchParams: Codable, JSONEncodable { self.userData = userData self.customNormalization = customNormalization self.attributeForDistinct = attributeForDistinct + self.maxFacetHits = maxFacetHits self.attributesToRetrieve = attributesToRetrieve self.ranking = ranking self.relevancyStrictness = relevancyStrictness @@ -508,7 +494,6 @@ public struct RecommendSearchParams: Codable, JSONEncodable { self.replaceSynonymsInHighlight = replaceSynonymsInHighlight self.minProximity = minProximity self.responseFields = responseFields - self.maxFacetHits = maxFacetHits self.maxValuesPerFacet = maxValuesPerFacet self.sortFacetValuesBy = sortFacetValuesBy self.attributeCriteriaComputedByMinProximity = attributeCriteriaComputedByMinProximity @@ -564,6 +549,7 @@ public struct RecommendSearchParams: Codable, JSONEncodable { case userData case customNormalization case attributeForDistinct + case maxFacetHits case attributesToRetrieve case ranking case relevancyStrictness @@ -596,7 +582,6 @@ public struct RecommendSearchParams: Codable, JSONEncodable { case replaceSynonymsInHighlight case minProximity case responseFields - case maxFacetHits case maxValuesPerFacet case sortFacetValuesBy case attributeCriteriaComputedByMinProximity @@ -655,6 +640,7 @@ public struct RecommendSearchParams: Codable, JSONEncodable { try container.encodeIfPresent(self.userData, forKey: .userData) try container.encodeIfPresent(self.customNormalization, forKey: .customNormalization) try container.encodeIfPresent(self.attributeForDistinct, forKey: .attributeForDistinct) + try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.attributesToRetrieve, forKey: .attributesToRetrieve) try container.encodeIfPresent(self.ranking, forKey: .ranking) try container.encodeIfPresent(self.relevancyStrictness, forKey: .relevancyStrictness) @@ -690,7 +676,6 @@ public struct RecommendSearchParams: Codable, JSONEncodable { try container.encodeIfPresent(self.replaceSynonymsInHighlight, forKey: .replaceSynonymsInHighlight) try container.encodeIfPresent(self.minProximity, forKey: .minProximity) try container.encodeIfPresent(self.responseFields, forKey: .responseFields) - try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.maxValuesPerFacet, forKey: .maxValuesPerFacet) try container.encodeIfPresent(self.sortFacetValuesBy, forKey: .sortFacetValuesBy) try container.encodeIfPresent( @@ -751,6 +736,7 @@ extension RecommendSearchParams: Equatable { lhs.userData == rhs.userData && lhs.customNormalization == rhs.customNormalization && lhs.attributeForDistinct == rhs.attributeForDistinct && + lhs.maxFacetHits == rhs.maxFacetHits && lhs.attributesToRetrieve == rhs.attributesToRetrieve && lhs.ranking == rhs.ranking && lhs.relevancyStrictness == rhs.relevancyStrictness && @@ -783,7 +769,6 @@ extension RecommendSearchParams: Equatable { lhs.replaceSynonymsInHighlight == rhs.replaceSynonymsInHighlight && lhs.minProximity == rhs.minProximity && lhs.responseFields == rhs.responseFields && - lhs.maxFacetHits == rhs.maxFacetHits && lhs.maxValuesPerFacet == rhs.maxValuesPerFacet && lhs.sortFacetValuesBy == rhs.sortFacetValuesBy && lhs.attributeCriteriaComputedByMinProximity == rhs.attributeCriteriaComputedByMinProximity && @@ -841,6 +826,7 @@ extension RecommendSearchParams: Hashable { hasher.combine(self.userData?.hashValue) hasher.combine(self.customNormalization?.hashValue) hasher.combine(self.attributeForDistinct?.hashValue) + hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.attributesToRetrieve?.hashValue) hasher.combine(self.ranking?.hashValue) hasher.combine(self.relevancyStrictness?.hashValue) @@ -873,7 +859,6 @@ extension RecommendSearchParams: Hashable { hasher.combine(self.replaceSynonymsInHighlight?.hashValue) hasher.combine(self.minProximity?.hashValue) hasher.combine(self.responseFields?.hashValue) - hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.maxValuesPerFacet?.hashValue) hasher.combine(self.sortFacetValuesBy?.hashValue) hasher.combine(self.attributeCriteriaComputedByMinProximity?.hashValue) diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseParamsObject.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseParamsObject.swift index d4b7356c85..f88a96f176 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseParamsObject.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseParamsObject.swift @@ -63,10 +63,7 @@ public struct BrowseParamsObject: Codable, JSONEncodable { public var aroundPrecision: SearchAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? - /// 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). - public var insideBoundingBox: [[Double]]? + public var insideBoundingBox: SearchInsideBoundingBox? /// 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). @@ -199,19 +196,7 @@ public struct BrowseParamsObject: Codable, JSONEncodable { /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? - /// 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). - public var optionalWords: [String]? + public var optionalWords: SearchOptionalWords? /// 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 @@ -251,9 +236,6 @@ public struct BrowseParamsObject: Codable, JSONEncodable { /// `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you /// might need in your search UI. public var responseFields: [String]? - /// 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). - public var maxFacetHits: Int? /// Maximum number of facet values to return for each facet. public var maxValuesPerFacet: Int? /// Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The @@ -296,7 +278,7 @@ public struct BrowseParamsObject: Codable, JSONEncodable { aroundRadius: SearchAroundRadius? = nil, aroundPrecision: SearchAroundPrecision? = nil, minimumAroundRadius: Int? = nil, - insideBoundingBox: [[Double]]? = nil, + insideBoundingBox: SearchInsideBoundingBox? = nil, insidePolygon: [[Double]]? = nil, naturalLanguages: [SearchSupportedLanguage]? = nil, ruleContexts: [String]? = nil, @@ -337,7 +319,7 @@ public struct BrowseParamsObject: Codable, JSONEncodable { mode: SearchMode? = nil, semanticSearch: SearchSemanticSearch? = nil, advancedSyntax: Bool? = nil, - optionalWords: [String]? = nil, + optionalWords: SearchOptionalWords? = nil, disableExactOnAttributes: [String]? = nil, exactOnSingleWordQuery: SearchExactOnSingleWordQuery? = nil, alternativesAsExact: [SearchAlternativesAsExact]? = nil, @@ -346,7 +328,6 @@ public struct BrowseParamsObject: Codable, JSONEncodable { replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, - maxFacetHits: Int? = nil, maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, @@ -424,7 +405,6 @@ public struct BrowseParamsObject: Codable, JSONEncodable { self.replaceSynonymsInHighlight = replaceSynonymsInHighlight self.minProximity = minProximity self.responseFields = responseFields - self.maxFacetHits = maxFacetHits self.maxValuesPerFacet = maxValuesPerFacet self.sortFacetValuesBy = sortFacetValuesBy self.attributeCriteriaComputedByMinProximity = attributeCriteriaComputedByMinProximity @@ -504,7 +484,6 @@ public struct BrowseParamsObject: Codable, JSONEncodable { case replaceSynonymsInHighlight case minProximity case responseFields - case maxFacetHits case maxValuesPerFacet case sortFacetValuesBy case attributeCriteriaComputedByMinProximity @@ -590,7 +569,6 @@ public struct BrowseParamsObject: Codable, JSONEncodable { try container.encodeIfPresent(self.replaceSynonymsInHighlight, forKey: .replaceSynonymsInHighlight) try container.encodeIfPresent(self.minProximity, forKey: .minProximity) try container.encodeIfPresent(self.responseFields, forKey: .responseFields) - try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.maxValuesPerFacet, forKey: .maxValuesPerFacet) try container.encodeIfPresent(self.sortFacetValuesBy, forKey: .sortFacetValuesBy) try container.encodeIfPresent( @@ -675,7 +653,6 @@ extension BrowseParamsObject: Equatable { lhs.replaceSynonymsInHighlight == rhs.replaceSynonymsInHighlight && lhs.minProximity == rhs.minProximity && lhs.responseFields == rhs.responseFields && - lhs.maxFacetHits == rhs.maxFacetHits && lhs.maxValuesPerFacet == rhs.maxValuesPerFacet && lhs.sortFacetValuesBy == rhs.sortFacetValuesBy && lhs.attributeCriteriaComputedByMinProximity == rhs.attributeCriteriaComputedByMinProximity && @@ -757,7 +734,6 @@ extension BrowseParamsObject: Hashable { hasher.combine(self.replaceSynonymsInHighlight?.hashValue) hasher.combine(self.minProximity?.hashValue) hasher.combine(self.responseFields?.hashValue) - hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.maxValuesPerFacet?.hashValue) hasher.combine(self.sortFacetValuesBy?.hashValue) hasher.combine(self.attributeCriteriaComputedByMinProximity?.hashValue) diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteByParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteByParams.swift index 5fe1eabd95..cc47f50793 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteByParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteByParams.swift @@ -30,10 +30,7 @@ public struct DeleteByParams: Codable, JSONEncodable { /// also specify `insidePolygon` or `insideBoundingBox`. public var aroundLatLng: String? public var aroundRadius: SearchAroundRadius? - /// 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). - public var insideBoundingBox: [[Double]]? + public var insideBoundingBox: SearchInsideBoundingBox? /// 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). @@ -47,7 +44,7 @@ public struct DeleteByParams: Codable, JSONEncodable { tagFilters: SearchTagFilters? = nil, aroundLatLng: String? = nil, aroundRadius: SearchAroundRadius? = nil, - insideBoundingBox: [[Double]]? = nil, + insideBoundingBox: SearchInsideBoundingBox? = nil, insidePolygon: [[Double]]? = nil ) { self.facetFilters = facetFilters diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/IndexSettings.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/IndexSettings.swift index 1b89d358d9..bf47185d0c 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/IndexSettings.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/IndexSettings.swift @@ -100,6 +100,9 @@ public struct IndexSettings: Codable, JSONEncodable { /// to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` /// setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. public var attributeForDistinct: String? + /// 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). + public var maxFacetHits: Int? /// 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 @@ -196,19 +199,7 @@ public struct IndexSettings: Codable, JSONEncodable { /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? - /// 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). - public var optionalWords: [String]? + public var optionalWords: SearchOptionalWords? /// 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 @@ -248,9 +239,6 @@ public struct IndexSettings: Codable, JSONEncodable { /// `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you /// might need in your search UI. public var responseFields: [String]? - /// 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). - public var maxFacetHits: Int? /// Maximum number of facet values to return for each facet. public var maxValuesPerFacet: Int? /// Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The @@ -288,6 +276,7 @@ public struct IndexSettings: Codable, JSONEncodable { userData: AnyCodable? = nil, customNormalization: [String: [String: String]]? = nil, attributeForDistinct: String? = nil, + maxFacetHits: Int? = nil, attributesToRetrieve: [String]? = nil, ranking: [String]? = nil, customRanking: [String]? = nil, @@ -316,7 +305,7 @@ public struct IndexSettings: Codable, JSONEncodable { mode: SearchMode? = nil, semanticSearch: SearchSemanticSearch? = nil, advancedSyntax: Bool? = nil, - optionalWords: [String]? = nil, + optionalWords: SearchOptionalWords? = nil, disableExactOnAttributes: [String]? = nil, exactOnSingleWordQuery: SearchExactOnSingleWordQuery? = nil, alternativesAsExact: [SearchAlternativesAsExact]? = nil, @@ -325,7 +314,6 @@ public struct IndexSettings: Codable, JSONEncodable { replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, - maxFacetHits: Int? = nil, maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, @@ -350,6 +338,7 @@ public struct IndexSettings: Codable, JSONEncodable { self.userData = userData self.customNormalization = customNormalization self.attributeForDistinct = attributeForDistinct + self.maxFacetHits = maxFacetHits self.attributesToRetrieve = attributesToRetrieve self.ranking = ranking self.customRanking = customRanking @@ -387,7 +376,6 @@ public struct IndexSettings: Codable, JSONEncodable { self.replaceSynonymsInHighlight = replaceSynonymsInHighlight self.minProximity = minProximity self.responseFields = responseFields - self.maxFacetHits = maxFacetHits self.maxValuesPerFacet = maxValuesPerFacet self.sortFacetValuesBy = sortFacetValuesBy self.attributeCriteriaComputedByMinProximity = attributeCriteriaComputedByMinProximity @@ -414,6 +402,7 @@ public struct IndexSettings: Codable, JSONEncodable { case userData case customNormalization case attributeForDistinct + case maxFacetHits case attributesToRetrieve case ranking case customRanking @@ -451,7 +440,6 @@ public struct IndexSettings: Codable, JSONEncodable { case replaceSynonymsInHighlight case minProximity case responseFields - case maxFacetHits case maxValuesPerFacet case sortFacetValuesBy case attributeCriteriaComputedByMinProximity @@ -481,6 +469,7 @@ public struct IndexSettings: Codable, JSONEncodable { try container.encodeIfPresent(self.userData, forKey: .userData) try container.encodeIfPresent(self.customNormalization, forKey: .customNormalization) try container.encodeIfPresent(self.attributeForDistinct, forKey: .attributeForDistinct) + try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.attributesToRetrieve, forKey: .attributesToRetrieve) try container.encodeIfPresent(self.ranking, forKey: .ranking) try container.encodeIfPresent(self.customRanking, forKey: .customRanking) @@ -521,7 +510,6 @@ public struct IndexSettings: Codable, JSONEncodable { try container.encodeIfPresent(self.replaceSynonymsInHighlight, forKey: .replaceSynonymsInHighlight) try container.encodeIfPresent(self.minProximity, forKey: .minProximity) try container.encodeIfPresent(self.responseFields, forKey: .responseFields) - try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.maxValuesPerFacet, forKey: .maxValuesPerFacet) try container.encodeIfPresent(self.sortFacetValuesBy, forKey: .sortFacetValuesBy) try container.encodeIfPresent( @@ -553,6 +541,7 @@ extension IndexSettings: Equatable { lhs.userData == rhs.userData && lhs.customNormalization == rhs.customNormalization && lhs.attributeForDistinct == rhs.attributeForDistinct && + lhs.maxFacetHits == rhs.maxFacetHits && lhs.attributesToRetrieve == rhs.attributesToRetrieve && lhs.ranking == rhs.ranking && lhs.customRanking == rhs.customRanking && @@ -590,7 +579,6 @@ extension IndexSettings: Equatable { lhs.replaceSynonymsInHighlight == rhs.replaceSynonymsInHighlight && lhs.minProximity == rhs.minProximity && lhs.responseFields == rhs.responseFields && - lhs.maxFacetHits == rhs.maxFacetHits && lhs.maxValuesPerFacet == rhs.maxValuesPerFacet && lhs.sortFacetValuesBy == rhs.sortFacetValuesBy && lhs.attributeCriteriaComputedByMinProximity == rhs.attributeCriteriaComputedByMinProximity && @@ -619,6 +607,7 @@ extension IndexSettings: Hashable { hasher.combine(self.userData?.hashValue) hasher.combine(self.customNormalization?.hashValue) hasher.combine(self.attributeForDistinct?.hashValue) + hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.attributesToRetrieve?.hashValue) hasher.combine(self.ranking?.hashValue) hasher.combine(self.customRanking?.hashValue) @@ -656,7 +645,6 @@ extension IndexSettings: Hashable { hasher.combine(self.replaceSynonymsInHighlight?.hashValue) hasher.combine(self.minProximity?.hashValue) hasher.combine(self.responseFields?.hashValue) - hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.maxValuesPerFacet?.hashValue) hasher.combine(self.sortFacetValuesBy?.hashValue) hasher.combine(self.attributeCriteriaComputedByMinProximity?.hashValue) diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseIndexSettings.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseIndexSettings.swift index d8247d3723..0756547f20 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseIndexSettings.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseIndexSettings.swift @@ -99,6 +99,9 @@ public struct SearchBaseIndexSettings: Codable, JSONEncodable { /// to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` /// setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. public var attributeForDistinct: String? + /// 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). + public var maxFacetHits: Int? public init( attributesForFaceting: [String]? = nil, @@ -117,7 +120,8 @@ public struct SearchBaseIndexSettings: Codable, JSONEncodable { searchableAttributes: [String]? = nil, userData: AnyCodable? = nil, customNormalization: [String: [String: String]]? = nil, - attributeForDistinct: String? = nil + attributeForDistinct: String? = nil, + maxFacetHits: Int? = nil ) { self.attributesForFaceting = attributesForFaceting self.replicas = replicas @@ -136,6 +140,7 @@ public struct SearchBaseIndexSettings: Codable, JSONEncodable { self.userData = userData self.customNormalization = customNormalization self.attributeForDistinct = attributeForDistinct + self.maxFacetHits = maxFacetHits } public enum CodingKeys: String, CodingKey, CaseIterable { @@ -156,6 +161,7 @@ public struct SearchBaseIndexSettings: Codable, JSONEncodable { case userData case customNormalization case attributeForDistinct + case maxFacetHits } // Encodable protocol methods @@ -179,6 +185,7 @@ public struct SearchBaseIndexSettings: Codable, JSONEncodable { try container.encodeIfPresent(self.userData, forKey: .userData) try container.encodeIfPresent(self.customNormalization, forKey: .customNormalization) try container.encodeIfPresent(self.attributeForDistinct, forKey: .attributeForDistinct) + try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) } } @@ -200,7 +207,8 @@ extension SearchBaseIndexSettings: Equatable { lhs.searchableAttributes == rhs.searchableAttributes && lhs.userData == rhs.userData && lhs.customNormalization == rhs.customNormalization && - lhs.attributeForDistinct == rhs.attributeForDistinct + lhs.attributeForDistinct == rhs.attributeForDistinct && + lhs.maxFacetHits == rhs.maxFacetHits } } @@ -223,5 +231,6 @@ extension SearchBaseIndexSettings: Hashable { hasher.combine(self.userData?.hashValue) hasher.combine(self.customNormalization?.hashValue) hasher.combine(self.attributeForDistinct?.hashValue) + hasher.combine(self.maxFacetHits?.hashValue) } } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchParams.swift index 111f8b23e8..b86c742c41 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchParams.swift @@ -63,10 +63,7 @@ public struct SearchBaseSearchParams: Codable, JSONEncodable { public var aroundPrecision: SearchAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? - /// 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). - public var insideBoundingBox: [[Double]]? + public var insideBoundingBox: SearchInsideBoundingBox? /// 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). @@ -124,7 +121,7 @@ public struct SearchBaseSearchParams: Codable, JSONEncodable { aroundRadius: SearchAroundRadius? = nil, aroundPrecision: SearchAroundPrecision? = nil, minimumAroundRadius: Int? = nil, - insideBoundingBox: [[Double]]? = nil, + insideBoundingBox: SearchInsideBoundingBox? = nil, insidePolygon: [[Double]]? = nil, naturalLanguages: [SearchSupportedLanguage]? = nil, ruleContexts: [String]? = nil, diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchParamsWithoutQuery.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchParamsWithoutQuery.swift index dd69dc8246..65792ec5a5 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchParamsWithoutQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchParamsWithoutQuery.swift @@ -61,10 +61,7 @@ public struct SearchBaseSearchParamsWithoutQuery: Codable, JSONEncodable { public var aroundPrecision: SearchAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? - /// 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). - public var insideBoundingBox: [[Double]]? + public var insideBoundingBox: SearchInsideBoundingBox? /// 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). @@ -121,7 +118,7 @@ public struct SearchBaseSearchParamsWithoutQuery: Codable, JSONEncodable { aroundRadius: SearchAroundRadius? = nil, aroundPrecision: SearchAroundPrecision? = nil, minimumAroundRadius: Int? = nil, - insideBoundingBox: [[Double]]? = nil, + insideBoundingBox: SearchInsideBoundingBox? = nil, insidePolygon: [[Double]]? = nil, naturalLanguages: [SearchSupportedLanguage]? = nil, ruleContexts: [String]? = nil, diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceParams.swift index 17374ced1a..8c933b0211 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceParams.swift @@ -61,10 +61,7 @@ public struct SearchConsequenceParams: Codable, JSONEncodable { public var aroundPrecision: SearchAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? - /// 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). - public var insideBoundingBox: [[Double]]? + public var insideBoundingBox: SearchInsideBoundingBox? /// 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). @@ -197,19 +194,7 @@ public struct SearchConsequenceParams: Codable, JSONEncodable { /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? - /// 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). - public var optionalWords: [String]? + public var optionalWords: SearchOptionalWords? /// 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 @@ -249,9 +234,6 @@ public struct SearchConsequenceParams: Codable, JSONEncodable { /// `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you /// might need in your search UI. public var responseFields: [String]? - /// 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). - public var maxFacetHits: Int? /// Maximum number of facet values to return for each facet. public var maxValuesPerFacet: Int? /// Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The @@ -293,7 +275,7 @@ public struct SearchConsequenceParams: Codable, JSONEncodable { aroundRadius: SearchAroundRadius? = nil, aroundPrecision: SearchAroundPrecision? = nil, minimumAroundRadius: Int? = nil, - insideBoundingBox: [[Double]]? = nil, + insideBoundingBox: SearchInsideBoundingBox? = nil, insidePolygon: [[Double]]? = nil, naturalLanguages: [SearchSupportedLanguage]? = nil, ruleContexts: [String]? = nil, @@ -334,7 +316,7 @@ public struct SearchConsequenceParams: Codable, JSONEncodable { mode: SearchMode? = nil, semanticSearch: SearchSemanticSearch? = nil, advancedSyntax: Bool? = nil, - optionalWords: [String]? = nil, + optionalWords: SearchOptionalWords? = nil, disableExactOnAttributes: [String]? = nil, exactOnSingleWordQuery: SearchExactOnSingleWordQuery? = nil, alternativesAsExact: [SearchAlternativesAsExact]? = nil, @@ -343,7 +325,6 @@ public struct SearchConsequenceParams: Codable, JSONEncodable { replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, - maxFacetHits: Int? = nil, maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, @@ -422,7 +403,6 @@ public struct SearchConsequenceParams: Codable, JSONEncodable { self.replaceSynonymsInHighlight = replaceSynonymsInHighlight self.minProximity = minProximity self.responseFields = responseFields - self.maxFacetHits = maxFacetHits self.maxValuesPerFacet = maxValuesPerFacet self.sortFacetValuesBy = sortFacetValuesBy self.attributeCriteriaComputedByMinProximity = attributeCriteriaComputedByMinProximity @@ -503,7 +483,6 @@ public struct SearchConsequenceParams: Codable, JSONEncodable { case replaceSynonymsInHighlight case minProximity case responseFields - case maxFacetHits case maxValuesPerFacet case sortFacetValuesBy case attributeCriteriaComputedByMinProximity @@ -590,7 +569,6 @@ public struct SearchConsequenceParams: Codable, JSONEncodable { try container.encodeIfPresent(self.replaceSynonymsInHighlight, forKey: .replaceSynonymsInHighlight) try container.encodeIfPresent(self.minProximity, forKey: .minProximity) try container.encodeIfPresent(self.responseFields, forKey: .responseFields) - try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.maxValuesPerFacet, forKey: .maxValuesPerFacet) try container.encodeIfPresent(self.sortFacetValuesBy, forKey: .sortFacetValuesBy) try container.encodeIfPresent( @@ -676,7 +654,6 @@ extension SearchConsequenceParams: Equatable { lhs.replaceSynonymsInHighlight == rhs.replaceSynonymsInHighlight && lhs.minProximity == rhs.minProximity && lhs.responseFields == rhs.responseFields && - lhs.maxFacetHits == rhs.maxFacetHits && lhs.maxValuesPerFacet == rhs.maxValuesPerFacet && lhs.sortFacetValuesBy == rhs.sortFacetValuesBy && lhs.attributeCriteriaComputedByMinProximity == rhs.attributeCriteriaComputedByMinProximity && @@ -759,7 +736,6 @@ extension SearchConsequenceParams: Hashable { hasher.combine(self.replaceSynonymsInHighlight?.hashValue) hasher.combine(self.minProximity?.hashValue) hasher.combine(self.responseFields?.hashValue) - hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.maxValuesPerFacet?.hashValue) hasher.combine(self.sortFacetValuesBy?.hashValue) hasher.combine(self.attributeCriteriaComputedByMinProximity?.hashValue) diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacets.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacets.swift index 35c24b5158..b1e7889d84 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacets.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacets.swift @@ -65,10 +65,7 @@ public struct SearchForFacets: Codable, JSONEncodable { public var aroundPrecision: SearchAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? - /// 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). - public var insideBoundingBox: [[Double]]? + public var insideBoundingBox: SearchInsideBoundingBox? /// 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). @@ -201,19 +198,7 @@ public struct SearchForFacets: Codable, JSONEncodable { /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? - /// 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). - public var optionalWords: [String]? + public var optionalWords: SearchOptionalWords? /// 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 @@ -253,9 +238,6 @@ public struct SearchForFacets: Codable, JSONEncodable { /// `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you /// might need in your search UI. public var responseFields: [String]? - /// 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). - public var maxFacetHits: Int? /// Maximum number of facet values to return for each facet. public var maxValuesPerFacet: Int? /// Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The @@ -280,6 +262,9 @@ public struct SearchForFacets: Codable, JSONEncodable { public var indexName: String /// Text to search inside the facet's values. public var facetQuery: String? + /// 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). + public var maxFacetHits: Int? public var type: SearchTypeFacet public init( @@ -303,7 +288,7 @@ public struct SearchForFacets: Codable, JSONEncodable { aroundRadius: SearchAroundRadius? = nil, aroundPrecision: SearchAroundPrecision? = nil, minimumAroundRadius: Int? = nil, - insideBoundingBox: [[Double]]? = nil, + insideBoundingBox: SearchInsideBoundingBox? = nil, insidePolygon: [[Double]]? = nil, naturalLanguages: [SearchSupportedLanguage]? = nil, ruleContexts: [String]? = nil, @@ -344,7 +329,7 @@ public struct SearchForFacets: Codable, JSONEncodable { mode: SearchMode? = nil, semanticSearch: SearchSemanticSearch? = nil, advancedSyntax: Bool? = nil, - optionalWords: [String]? = nil, + optionalWords: SearchOptionalWords? = nil, disableExactOnAttributes: [String]? = nil, exactOnSingleWordQuery: SearchExactOnSingleWordQuery? = nil, alternativesAsExact: [SearchAlternativesAsExact]? = nil, @@ -353,7 +338,6 @@ public struct SearchForFacets: Codable, JSONEncodable { replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, - maxFacetHits: Int? = nil, maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, @@ -363,6 +347,7 @@ public struct SearchForFacets: Codable, JSONEncodable { facet: String, indexName: String, facetQuery: String? = nil, + maxFacetHits: Int? = nil, type: SearchTypeFacet ) { self.params = params @@ -435,7 +420,6 @@ public struct SearchForFacets: Codable, JSONEncodable { self.replaceSynonymsInHighlight = replaceSynonymsInHighlight self.minProximity = minProximity self.responseFields = responseFields - self.maxFacetHits = maxFacetHits self.maxValuesPerFacet = maxValuesPerFacet self.sortFacetValuesBy = sortFacetValuesBy self.attributeCriteriaComputedByMinProximity = attributeCriteriaComputedByMinProximity @@ -445,6 +429,7 @@ public struct SearchForFacets: Codable, JSONEncodable { self.facet = facet self.indexName = indexName self.facetQuery = facetQuery + self.maxFacetHits = maxFacetHits self.type = type } @@ -519,7 +504,6 @@ public struct SearchForFacets: Codable, JSONEncodable { case replaceSynonymsInHighlight case minProximity case responseFields - case maxFacetHits case maxValuesPerFacet case sortFacetValuesBy case attributeCriteriaComputedByMinProximity @@ -529,6 +513,7 @@ public struct SearchForFacets: Codable, JSONEncodable { case facet case indexName case facetQuery + case maxFacetHits case type } @@ -609,7 +594,6 @@ public struct SearchForFacets: Codable, JSONEncodable { try container.encodeIfPresent(self.replaceSynonymsInHighlight, forKey: .replaceSynonymsInHighlight) try container.encodeIfPresent(self.minProximity, forKey: .minProximity) try container.encodeIfPresent(self.responseFields, forKey: .responseFields) - try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.maxValuesPerFacet, forKey: .maxValuesPerFacet) try container.encodeIfPresent(self.sortFacetValuesBy, forKey: .sortFacetValuesBy) try container.encodeIfPresent( @@ -622,6 +606,7 @@ public struct SearchForFacets: Codable, JSONEncodable { try container.encode(self.facet, forKey: .facet) try container.encode(self.indexName, forKey: .indexName) try container.encodeIfPresent(self.facetQuery, forKey: .facetQuery) + try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encode(self.type, forKey: .type) } } @@ -698,7 +683,6 @@ extension SearchForFacets: Equatable { lhs.replaceSynonymsInHighlight == rhs.replaceSynonymsInHighlight && lhs.minProximity == rhs.minProximity && lhs.responseFields == rhs.responseFields && - lhs.maxFacetHits == rhs.maxFacetHits && lhs.maxValuesPerFacet == rhs.maxValuesPerFacet && lhs.sortFacetValuesBy == rhs.sortFacetValuesBy && lhs.attributeCriteriaComputedByMinProximity == rhs.attributeCriteriaComputedByMinProximity && @@ -708,6 +692,7 @@ extension SearchForFacets: Equatable { lhs.facet == rhs.facet && lhs.indexName == rhs.indexName && lhs.facetQuery == rhs.facetQuery && + lhs.maxFacetHits == rhs.maxFacetHits && lhs.type == rhs.type } } @@ -784,7 +769,6 @@ extension SearchForFacets: Hashable { hasher.combine(self.replaceSynonymsInHighlight?.hashValue) hasher.combine(self.minProximity?.hashValue) hasher.combine(self.responseFields?.hashValue) - hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.maxValuesPerFacet?.hashValue) hasher.combine(self.sortFacetValuesBy?.hashValue) hasher.combine(self.attributeCriteriaComputedByMinProximity?.hashValue) @@ -794,6 +778,7 @@ extension SearchForFacets: Hashable { hasher.combine(self.facet.hashValue) hasher.combine(self.indexName.hashValue) hasher.combine(self.facetQuery?.hashValue) + hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.type.hashValue) } } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForHits.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForHits.swift index e61182d902..ddb526c04b 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForHits.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForHits.swift @@ -65,10 +65,7 @@ public struct SearchForHits: Codable, JSONEncodable { public var aroundPrecision: SearchAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? - /// 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). - public var insideBoundingBox: [[Double]]? + public var insideBoundingBox: SearchInsideBoundingBox? /// 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). @@ -201,19 +198,7 @@ public struct SearchForHits: Codable, JSONEncodable { /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? - /// 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). - public var optionalWords: [String]? + public var optionalWords: SearchOptionalWords? /// 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 @@ -253,9 +238,6 @@ public struct SearchForHits: Codable, JSONEncodable { /// `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you /// might need in your search UI. public var responseFields: [String]? - /// 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). - public var maxFacetHits: Int? /// Maximum number of facet values to return for each facet. public var maxValuesPerFacet: Int? /// Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The @@ -299,7 +281,7 @@ public struct SearchForHits: Codable, JSONEncodable { aroundRadius: SearchAroundRadius? = nil, aroundPrecision: SearchAroundPrecision? = nil, minimumAroundRadius: Int? = nil, - insideBoundingBox: [[Double]]? = nil, + insideBoundingBox: SearchInsideBoundingBox? = nil, insidePolygon: [[Double]]? = nil, naturalLanguages: [SearchSupportedLanguage]? = nil, ruleContexts: [String]? = nil, @@ -340,7 +322,7 @@ public struct SearchForHits: Codable, JSONEncodable { mode: SearchMode? = nil, semanticSearch: SearchSemanticSearch? = nil, advancedSyntax: Bool? = nil, - optionalWords: [String]? = nil, + optionalWords: SearchOptionalWords? = nil, disableExactOnAttributes: [String]? = nil, exactOnSingleWordQuery: SearchExactOnSingleWordQuery? = nil, alternativesAsExact: [SearchAlternativesAsExact]? = nil, @@ -349,7 +331,6 @@ public struct SearchForHits: Codable, JSONEncodable { replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, - maxFacetHits: Int? = nil, maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, @@ -429,7 +410,6 @@ public struct SearchForHits: Codable, JSONEncodable { self.replaceSynonymsInHighlight = replaceSynonymsInHighlight self.minProximity = minProximity self.responseFields = responseFields - self.maxFacetHits = maxFacetHits self.maxValuesPerFacet = maxValuesPerFacet self.sortFacetValuesBy = sortFacetValuesBy self.attributeCriteriaComputedByMinProximity = attributeCriteriaComputedByMinProximity @@ -511,7 +491,6 @@ public struct SearchForHits: Codable, JSONEncodable { case replaceSynonymsInHighlight case minProximity case responseFields - case maxFacetHits case maxValuesPerFacet case sortFacetValuesBy case attributeCriteriaComputedByMinProximity @@ -599,7 +578,6 @@ public struct SearchForHits: Codable, JSONEncodable { try container.encodeIfPresent(self.replaceSynonymsInHighlight, forKey: .replaceSynonymsInHighlight) try container.encodeIfPresent(self.minProximity, forKey: .minProximity) try container.encodeIfPresent(self.responseFields, forKey: .responseFields) - try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.maxValuesPerFacet, forKey: .maxValuesPerFacet) try container.encodeIfPresent(self.sortFacetValuesBy, forKey: .sortFacetValuesBy) try container.encodeIfPresent( @@ -686,7 +664,6 @@ extension SearchForHits: Equatable { lhs.replaceSynonymsInHighlight == rhs.replaceSynonymsInHighlight && lhs.minProximity == rhs.minProximity && lhs.responseFields == rhs.responseFields && - lhs.maxFacetHits == rhs.maxFacetHits && lhs.maxValuesPerFacet == rhs.maxValuesPerFacet && lhs.sortFacetValuesBy == rhs.sortFacetValuesBy && lhs.attributeCriteriaComputedByMinProximity == rhs.attributeCriteriaComputedByMinProximity && @@ -770,7 +747,6 @@ extension SearchForHits: Hashable { hasher.combine(self.replaceSynonymsInHighlight?.hashValue) hasher.combine(self.minProximity?.hashValue) hasher.combine(self.responseFields?.hashValue) - hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.maxValuesPerFacet?.hashValue) hasher.combine(self.sortFacetValuesBy?.hashValue) hasher.combine(self.attributeCriteriaComputedByMinProximity?.hashValue) diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchIndexSettingsAsSearchParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchIndexSettingsAsSearchParams.swift index eabbb44a55..712303902d 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchIndexSettingsAsSearchParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchIndexSettingsAsSearchParams.swift @@ -103,19 +103,7 @@ public struct SearchIndexSettingsAsSearchParams: Codable, JSONEncodable { /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? - /// 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). - public var optionalWords: [String]? + public var optionalWords: SearchOptionalWords? /// 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 @@ -155,9 +143,6 @@ public struct SearchIndexSettingsAsSearchParams: Codable, JSONEncodable { /// `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you /// might need in your search UI. public var responseFields: [String]? - /// 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). - public var maxFacetHits: Int? /// Maximum number of facet values to return for each facet. public var maxValuesPerFacet: Int? /// Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The @@ -206,7 +191,7 @@ public struct SearchIndexSettingsAsSearchParams: Codable, JSONEncodable { mode: SearchMode? = nil, semanticSearch: SearchSemanticSearch? = nil, advancedSyntax: Bool? = nil, - optionalWords: [String]? = nil, + optionalWords: SearchOptionalWords? = nil, disableExactOnAttributes: [String]? = nil, exactOnSingleWordQuery: SearchExactOnSingleWordQuery? = nil, alternativesAsExact: [SearchAlternativesAsExact]? = nil, @@ -215,7 +200,6 @@ public struct SearchIndexSettingsAsSearchParams: Codable, JSONEncodable { replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, - maxFacetHits: Int? = nil, maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, @@ -260,7 +244,6 @@ public struct SearchIndexSettingsAsSearchParams: Codable, JSONEncodable { self.replaceSynonymsInHighlight = replaceSynonymsInHighlight self.minProximity = minProximity self.responseFields = responseFields - self.maxFacetHits = maxFacetHits self.maxValuesPerFacet = maxValuesPerFacet self.sortFacetValuesBy = sortFacetValuesBy self.attributeCriteriaComputedByMinProximity = attributeCriteriaComputedByMinProximity @@ -307,7 +290,6 @@ public struct SearchIndexSettingsAsSearchParams: Codable, JSONEncodable { case replaceSynonymsInHighlight case minProximity case responseFields - case maxFacetHits case maxValuesPerFacet case sortFacetValuesBy case attributeCriteriaComputedByMinProximity @@ -360,7 +342,6 @@ public struct SearchIndexSettingsAsSearchParams: Codable, JSONEncodable { try container.encodeIfPresent(self.replaceSynonymsInHighlight, forKey: .replaceSynonymsInHighlight) try container.encodeIfPresent(self.minProximity, forKey: .minProximity) try container.encodeIfPresent(self.responseFields, forKey: .responseFields) - try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.maxValuesPerFacet, forKey: .maxValuesPerFacet) try container.encodeIfPresent(self.sortFacetValuesBy, forKey: .sortFacetValuesBy) try container.encodeIfPresent( @@ -412,7 +393,6 @@ extension SearchIndexSettingsAsSearchParams: Equatable { lhs.replaceSynonymsInHighlight == rhs.replaceSynonymsInHighlight && lhs.minProximity == rhs.minProximity && lhs.responseFields == rhs.responseFields && - lhs.maxFacetHits == rhs.maxFacetHits && lhs.maxValuesPerFacet == rhs.maxValuesPerFacet && lhs.sortFacetValuesBy == rhs.sortFacetValuesBy && lhs.attributeCriteriaComputedByMinProximity == rhs.attributeCriteriaComputedByMinProximity && @@ -461,7 +441,6 @@ extension SearchIndexSettingsAsSearchParams: Hashable { hasher.combine(self.replaceSynonymsInHighlight?.hashValue) hasher.combine(self.minProximity?.hashValue) hasher.combine(self.responseFields?.hashValue) - hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.maxValuesPerFacet?.hashValue) hasher.combine(self.sortFacetValuesBy?.hashValue) hasher.combine(self.attributeCriteriaComputedByMinProximity?.hashValue) diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchInsideBoundingBox.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchInsideBoundingBox.swift new file mode 100644 index 0000000000..144943e2b3 --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchInsideBoundingBox.swift @@ -0,0 +1,51 @@ +// 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. + +import Foundation +#if canImport(Core) + import Core +#endif + +public enum SearchInsideBoundingBox: Codable, JSONEncodable, AbstractEncodable { + case string(String) + case arrayOfArrayOfDouble([[Double]]) + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case let .string(value): + try container.encode(value) + case let .arrayOfArrayOfDouble(value): + try container.encode(value) + } + } + + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(String.self) { + self = .string(value) + } else if let value = try? container.decode([[Double]].self) { + self = .arrayOfArrayOfDouble(value) + } else { + throw DecodingError.typeMismatch( + Self.Type.self, + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of SearchInsideBoundingBox" + ) + ) + } + } + + public func GetActualInstance() -> Encodable { + switch self { + case let .string(value): + value as String + case let .arrayOfArrayOfDouble(value): + value as [[Double]] + } + } +} + +extension SearchInsideBoundingBox: Equatable {} +extension SearchInsideBoundingBox: Hashable {} diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchOptionalWords.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchOptionalWords.swift new file mode 100644 index 0000000000..3bbd1c7dea --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchOptionalWords.swift @@ -0,0 +1,51 @@ +// 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. + +import Foundation +#if canImport(Core) + import Core +#endif + +public enum SearchOptionalWords: Codable, JSONEncodable, AbstractEncodable { + case string(String) + case arrayOfString([String]) + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case let .string(value): + try container.encode(value) + case let .arrayOfString(value): + try container.encode(value) + } + } + + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(String.self) { + self = .string(value) + } else if let value = try? container.decode([String].self) { + self = .arrayOfString(value) + } else { + throw DecodingError.typeMismatch( + Self.Type.self, + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of SearchOptionalWords" + ) + ) + } + } + + public func GetActualInstance() -> Encodable { + switch self { + case let .string(value): + value as String + case let .arrayOfString(value): + value as [String] + } + } +} + +extension SearchOptionalWords: Equatable {} +extension SearchOptionalWords: Hashable {} diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSearchParamsObject.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSearchParamsObject.swift index ea33669acd..508eaead90 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSearchParamsObject.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSearchParamsObject.swift @@ -64,10 +64,7 @@ public struct SearchSearchParamsObject: Codable, JSONEncodable { public var aroundPrecision: SearchAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? - /// 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). - public var insideBoundingBox: [[Double]]? + public var insideBoundingBox: SearchInsideBoundingBox? /// 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). @@ -200,19 +197,7 @@ public struct SearchSearchParamsObject: Codable, JSONEncodable { /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? - /// 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). - public var optionalWords: [String]? + public var optionalWords: SearchOptionalWords? /// 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 @@ -252,9 +237,6 @@ public struct SearchSearchParamsObject: Codable, JSONEncodable { /// `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you /// might need in your search UI. public var responseFields: [String]? - /// 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). - public var maxFacetHits: Int? /// Maximum number of facet values to return for each facet. public var maxValuesPerFacet: Int? /// Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The @@ -294,7 +276,7 @@ public struct SearchSearchParamsObject: Codable, JSONEncodable { aroundRadius: SearchAroundRadius? = nil, aroundPrecision: SearchAroundPrecision? = nil, minimumAroundRadius: Int? = nil, - insideBoundingBox: [[Double]]? = nil, + insideBoundingBox: SearchInsideBoundingBox? = nil, insidePolygon: [[Double]]? = nil, naturalLanguages: [SearchSupportedLanguage]? = nil, ruleContexts: [String]? = nil, @@ -335,7 +317,7 @@ public struct SearchSearchParamsObject: Codable, JSONEncodable { mode: SearchMode? = nil, semanticSearch: SearchSemanticSearch? = nil, advancedSyntax: Bool? = nil, - optionalWords: [String]? = nil, + optionalWords: SearchOptionalWords? = nil, disableExactOnAttributes: [String]? = nil, exactOnSingleWordQuery: SearchExactOnSingleWordQuery? = nil, alternativesAsExact: [SearchAlternativesAsExact]? = nil, @@ -344,7 +326,6 @@ public struct SearchSearchParamsObject: Codable, JSONEncodable { replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, - maxFacetHits: Int? = nil, maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, @@ -421,7 +402,6 @@ public struct SearchSearchParamsObject: Codable, JSONEncodable { self.replaceSynonymsInHighlight = replaceSynonymsInHighlight self.minProximity = minProximity self.responseFields = responseFields - self.maxFacetHits = maxFacetHits self.maxValuesPerFacet = maxValuesPerFacet self.sortFacetValuesBy = sortFacetValuesBy self.attributeCriteriaComputedByMinProximity = attributeCriteriaComputedByMinProximity @@ -500,7 +480,6 @@ public struct SearchSearchParamsObject: Codable, JSONEncodable { case replaceSynonymsInHighlight case minProximity case responseFields - case maxFacetHits case maxValuesPerFacet case sortFacetValuesBy case attributeCriteriaComputedByMinProximity @@ -585,7 +564,6 @@ public struct SearchSearchParamsObject: Codable, JSONEncodable { try container.encodeIfPresent(self.replaceSynonymsInHighlight, forKey: .replaceSynonymsInHighlight) try container.encodeIfPresent(self.minProximity, forKey: .minProximity) try container.encodeIfPresent(self.responseFields, forKey: .responseFields) - try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.maxValuesPerFacet, forKey: .maxValuesPerFacet) try container.encodeIfPresent(self.sortFacetValuesBy, forKey: .sortFacetValuesBy) try container.encodeIfPresent( @@ -669,7 +647,6 @@ extension SearchSearchParamsObject: Equatable { lhs.replaceSynonymsInHighlight == rhs.replaceSynonymsInHighlight && lhs.minProximity == rhs.minProximity && lhs.responseFields == rhs.responseFields && - lhs.maxFacetHits == rhs.maxFacetHits && lhs.maxValuesPerFacet == rhs.maxValuesPerFacet && lhs.sortFacetValuesBy == rhs.sortFacetValuesBy && lhs.attributeCriteriaComputedByMinProximity == rhs.attributeCriteriaComputedByMinProximity && @@ -750,7 +727,6 @@ extension SearchSearchParamsObject: Hashable { hasher.combine(self.replaceSynonymsInHighlight?.hashValue) hasher.combine(self.minProximity?.hashValue) hasher.combine(self.responseFields?.hashValue) - hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.maxValuesPerFacet?.hashValue) hasher.combine(self.sortFacetValuesBy?.hashValue) hasher.combine(self.attributeCriteriaComputedByMinProximity?.hashValue) diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SettingsResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SettingsResponse.swift index e41e8a9603..48cccc2b39 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SettingsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SettingsResponse.swift @@ -99,6 +99,9 @@ public struct SettingsResponse: Codable, JSONEncodable { /// to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` /// setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. public var attributeForDistinct: String? + /// 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). + public var maxFacetHits: Int? /// 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 @@ -195,19 +198,7 @@ public struct SettingsResponse: Codable, JSONEncodable { /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? - /// 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). - public var optionalWords: [String]? + public var optionalWords: SearchOptionalWords? /// 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 @@ -247,9 +238,6 @@ public struct SettingsResponse: Codable, JSONEncodable { /// `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you /// might need in your search UI. public var responseFields: [String]? - /// 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). - public var maxFacetHits: Int? /// Maximum number of facet values to return for each facet. public var maxValuesPerFacet: Int? /// Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The @@ -289,6 +277,7 @@ public struct SettingsResponse: Codable, JSONEncodable { userData: AnyCodable? = nil, customNormalization: [String: [String: String]]? = nil, attributeForDistinct: String? = nil, + maxFacetHits: Int? = nil, attributesToRetrieve: [String]? = nil, ranking: [String]? = nil, customRanking: [String]? = nil, @@ -317,7 +306,7 @@ public struct SettingsResponse: Codable, JSONEncodable { mode: SearchMode? = nil, semanticSearch: SearchSemanticSearch? = nil, advancedSyntax: Bool? = nil, - optionalWords: [String]? = nil, + optionalWords: SearchOptionalWords? = nil, disableExactOnAttributes: [String]? = nil, exactOnSingleWordQuery: SearchExactOnSingleWordQuery? = nil, alternativesAsExact: [SearchAlternativesAsExact]? = nil, @@ -326,7 +315,6 @@ public struct SettingsResponse: Codable, JSONEncodable { replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, - maxFacetHits: Int? = nil, maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, @@ -352,6 +340,7 @@ public struct SettingsResponse: Codable, JSONEncodable { self.userData = userData self.customNormalization = customNormalization self.attributeForDistinct = attributeForDistinct + self.maxFacetHits = maxFacetHits self.attributesToRetrieve = attributesToRetrieve self.ranking = ranking self.customRanking = customRanking @@ -389,7 +378,6 @@ public struct SettingsResponse: Codable, JSONEncodable { self.replaceSynonymsInHighlight = replaceSynonymsInHighlight self.minProximity = minProximity self.responseFields = responseFields - self.maxFacetHits = maxFacetHits self.maxValuesPerFacet = maxValuesPerFacet self.sortFacetValuesBy = sortFacetValuesBy self.attributeCriteriaComputedByMinProximity = attributeCriteriaComputedByMinProximity @@ -417,6 +405,7 @@ public struct SettingsResponse: Codable, JSONEncodable { case userData case customNormalization case attributeForDistinct + case maxFacetHits case attributesToRetrieve case ranking case customRanking @@ -454,7 +443,6 @@ public struct SettingsResponse: Codable, JSONEncodable { case replaceSynonymsInHighlight case minProximity case responseFields - case maxFacetHits case maxValuesPerFacet case sortFacetValuesBy case attributeCriteriaComputedByMinProximity @@ -485,6 +473,7 @@ public struct SettingsResponse: Codable, JSONEncodable { try container.encodeIfPresent(self.userData, forKey: .userData) try container.encodeIfPresent(self.customNormalization, forKey: .customNormalization) try container.encodeIfPresent(self.attributeForDistinct, forKey: .attributeForDistinct) + try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.attributesToRetrieve, forKey: .attributesToRetrieve) try container.encodeIfPresent(self.ranking, forKey: .ranking) try container.encodeIfPresent(self.customRanking, forKey: .customRanking) @@ -525,7 +514,6 @@ public struct SettingsResponse: Codable, JSONEncodable { try container.encodeIfPresent(self.replaceSynonymsInHighlight, forKey: .replaceSynonymsInHighlight) try container.encodeIfPresent(self.minProximity, forKey: .minProximity) try container.encodeIfPresent(self.responseFields, forKey: .responseFields) - try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits) try container.encodeIfPresent(self.maxValuesPerFacet, forKey: .maxValuesPerFacet) try container.encodeIfPresent(self.sortFacetValuesBy, forKey: .sortFacetValuesBy) try container.encodeIfPresent( @@ -558,6 +546,7 @@ extension SettingsResponse: Equatable { lhs.userData == rhs.userData && lhs.customNormalization == rhs.customNormalization && lhs.attributeForDistinct == rhs.attributeForDistinct && + lhs.maxFacetHits == rhs.maxFacetHits && lhs.attributesToRetrieve == rhs.attributesToRetrieve && lhs.ranking == rhs.ranking && lhs.customRanking == rhs.customRanking && @@ -595,7 +584,6 @@ extension SettingsResponse: Equatable { lhs.replaceSynonymsInHighlight == rhs.replaceSynonymsInHighlight && lhs.minProximity == rhs.minProximity && lhs.responseFields == rhs.responseFields && - lhs.maxFacetHits == rhs.maxFacetHits && lhs.maxValuesPerFacet == rhs.maxValuesPerFacet && lhs.sortFacetValuesBy == rhs.sortFacetValuesBy && lhs.attributeCriteriaComputedByMinProximity == rhs.attributeCriteriaComputedByMinProximity && @@ -625,6 +613,7 @@ extension SettingsResponse: Hashable { hasher.combine(self.userData?.hashValue) hasher.combine(self.customNormalization?.hashValue) hasher.combine(self.attributeForDistinct?.hashValue) + hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.attributesToRetrieve?.hashValue) hasher.combine(self.ranking?.hashValue) hasher.combine(self.customRanking?.hashValue) @@ -662,7 +651,6 @@ extension SettingsResponse: Hashable { hasher.combine(self.replaceSynonymsInHighlight?.hashValue) hasher.combine(self.minProximity?.hashValue) hasher.combine(self.responseFields?.hashValue) - hasher.combine(self.maxFacetHits?.hashValue) hasher.combine(self.maxValuesPerFacet?.hashValue) hasher.combine(self.sortFacetValuesBy?.hashValue) hasher.combine(self.attributeCriteriaComputedByMinProximity?.hashValue) diff --git a/docs/bundled/search-snippets.json b/docs/bundled/search-snippets.json index f981fc881a..4ed4568c9d 100644 --- a/docs/bundled/search-snippets.json +++ b/docs/bundled/search-snippets.json @@ -82,7 +82,7 @@ }, "generateSecuredApiKey": { "generate secured api key basic": "var response = client.GenerateSecuredApiKey(\n \"2640659426d5107b6e47d75db9cbaef8\",\n new SecuredApiKeyRestrictions\n {\n ValidUntil = 2524604400L,\n RestrictIndices = new List { \"Movies\" },\n }\n);", - "generate secured api key with searchParams": "var response = client.GenerateSecuredApiKey(\n \"2640659426d5107b6e47d75db9cbaef8\",\n new SecuredApiKeyRestrictions\n {\n ValidUntil = 2524604400L,\n RestrictIndices = new List { \"Movies\", \"cts_e2e_settings\" },\n RestrictSources = \"192.168.1.0/24\",\n Filters = \"category:Book OR category:Ebook AND _tags:published\",\n UserToken = \"user123\",\n SearchParams = new SearchParamsObject\n {\n Query = \"batman\",\n TypoTolerance = new TypoTolerance(Enum.Parse(\"Strict\")),\n AroundRadius = new AroundRadius(Enum.Parse(\"All\")),\n Mode = Enum.Parse(\"NeuralSearch\"),\n HitsPerPage = 10,\n OptionalWords = new List { \"one\", \"two\" },\n },\n }\n);" + "generate secured api key with searchParams": "var response = client.GenerateSecuredApiKey(\n \"2640659426d5107b6e47d75db9cbaef8\",\n new SecuredApiKeyRestrictions\n {\n ValidUntil = 2524604400L,\n RestrictIndices = new List { \"Movies\", \"cts_e2e_settings\" },\n RestrictSources = \"192.168.1.0/24\",\n Filters = \"category:Book OR category:Ebook AND _tags:published\",\n UserToken = \"user123\",\n SearchParams = new SearchParamsObject\n {\n Query = \"batman\",\n TypoTolerance = new TypoTolerance(Enum.Parse(\"Strict\")),\n AroundRadius = new AroundRadius(Enum.Parse(\"All\")),\n Mode = Enum.Parse(\"NeuralSearch\"),\n HitsPerPage = 10,\n OptionalWords = new OptionalWords(new List { \"one\", \"two\" }),\n },\n }\n);" }, "getApiKey": { "default": "var response = await client.GetApiKeyAsync(\"myTestApiKey\");" @@ -574,7 +574,7 @@ }, "generateSecuredApiKey": { "generate secured api key basic": "response, err := client.GenerateSecuredApiKey(\n \"2640659426d5107b6e47d75db9cbaef8\",\n search.NewEmptySecuredApiKeyRestrictions().SetValidUntil(2524604400).SetRestrictIndices(\n []string{\"Movies\"}),\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}", - "generate secured api key with searchParams": "response, err := client.GenerateSecuredApiKey(\n \"2640659426d5107b6e47d75db9cbaef8\",\n search.NewEmptySecuredApiKeyRestrictions().SetValidUntil(2524604400).SetRestrictIndices(\n []string{\"Movies\", \"cts_e2e_settings\"}).SetRestrictSources(\"192.168.1.0/24\").SetFilters(\"category:Book OR category:Ebook AND _tags:published\").SetUserToken(\"user123\").SetSearchParams(\n search.NewEmptySearchParamsObject().SetQuery(\"batman\").SetTypoTolerance(search.TypoToleranceEnumAsTypoTolerance(search.TypoToleranceEnum(\"strict\"))).SetAroundRadius(search.AroundRadiusAllAsAroundRadius(search.AroundRadiusAll(\"all\"))).SetMode(search.Mode(\"neuralSearch\")).SetHitsPerPage(10).SetOptionalWords(\n []string{\"one\", \"two\"})),\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + "generate secured api key with searchParams": "response, err := client.GenerateSecuredApiKey(\n \"2640659426d5107b6e47d75db9cbaef8\",\n search.NewEmptySecuredApiKeyRestrictions().SetValidUntil(2524604400).SetRestrictIndices(\n []string{\"Movies\", \"cts_e2e_settings\"}).SetRestrictSources(\"192.168.1.0/24\").SetFilters(\"category:Book OR category:Ebook AND _tags:published\").SetUserToken(\"user123\").SetSearchParams(\n search.NewEmptySearchParamsObject().SetQuery(\"batman\").SetTypoTolerance(search.TypoToleranceEnumAsTypoTolerance(search.TypoToleranceEnum(\"strict\"))).SetAroundRadius(search.AroundRadiusAllAsAroundRadius(search.AroundRadiusAll(\"all\"))).SetMode(search.Mode(\"neuralSearch\")).SetHitsPerPage(10).SetOptionalWords(search.ArrayOfStringAsOptionalWords(\n []string{\"one\", \"two\"}))),\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getApiKey": { "default": "response, err := client.GetApiKey(client.NewApiGetApiKeyRequest(\n \"myTestApiKey\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" @@ -820,7 +820,7 @@ }, "generateSecuredApiKey": { "generate secured api key basic": "client.generateSecuredApiKey(\n \"2640659426d5107b6e47d75db9cbaef8\",\n new SecuredApiKeyRestrictions().setValidUntil(2524604400L).setRestrictIndices(Arrays.asList(\"Movies\"))\n);", - "generate secured api key with searchParams": "client.generateSecuredApiKey(\n \"2640659426d5107b6e47d75db9cbaef8\",\n new SecuredApiKeyRestrictions()\n .setValidUntil(2524604400L)\n .setRestrictIndices(Arrays.asList(\"Movies\", \"cts_e2e_settings\"))\n .setRestrictSources(\"192.168.1.0/24\")\n .setFilters(\"category:Book OR category:Ebook AND _tags:published\")\n .setUserToken(\"user123\")\n .setSearchParams(\n new SearchParamsObject()\n .setQuery(\"batman\")\n .setTypoTolerance(TypoToleranceEnum.STRICT)\n .setAroundRadius(AroundRadiusAll.ALL)\n .setMode(Mode.NEURAL_SEARCH)\n .setHitsPerPage(10)\n .setOptionalWords(Arrays.asList(\"one\", \"two\"))\n )\n);" + "generate secured api key with searchParams": "client.generateSecuredApiKey(\n \"2640659426d5107b6e47d75db9cbaef8\",\n new SecuredApiKeyRestrictions()\n .setValidUntil(2524604400L)\n .setRestrictIndices(Arrays.asList(\"Movies\", \"cts_e2e_settings\"))\n .setRestrictSources(\"192.168.1.0/24\")\n .setFilters(\"category:Book OR category:Ebook AND _tags:published\")\n .setUserToken(\"user123\")\n .setSearchParams(\n new SearchParamsObject()\n .setQuery(\"batman\")\n .setTypoTolerance(TypoToleranceEnum.STRICT)\n .setAroundRadius(AroundRadiusAll.ALL)\n .setMode(Mode.NEURAL_SEARCH)\n .setHitsPerPage(10)\n .setOptionalWords(OptionalWords.of(Arrays.asList(\"one\", \"two\")))\n )\n);" }, "getApiKey": { "default": "client.getApiKey(\"myTestApiKey\");" @@ -1312,7 +1312,7 @@ }, "generateSecuredApiKey": { "generate secured api key basic": "var response = client.generateSecuredApiKey(\n parentApiKey = \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions = SecuredApiKeyRestrictions(\n validUntil = 2524604400L,\n restrictIndices = listOf(\"Movies\"),\n ),\n)", - "generate secured api key with searchParams": "var response = client.generateSecuredApiKey(\n parentApiKey = \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions = SecuredApiKeyRestrictions(\n validUntil = 2524604400L,\n restrictIndices = listOf(\"Movies\", \"cts_e2e_settings\"),\n restrictSources = \"192.168.1.0/24\",\n filters = \"category:Book OR category:Ebook AND _tags:published\",\n userToken = \"user123\",\n searchParams = SearchParamsObject(\n query = \"batman\",\n typoTolerance = TypoToleranceEnum.entries.first { it.value == \"strict\" },\n aroundRadius = AroundRadiusAll.entries.first { it.value == \"all\" },\n mode = Mode.entries.first { it.value == \"neuralSearch\" },\n hitsPerPage = 10,\n optionalWords = listOf(\"one\", \"two\"),\n ),\n ),\n)" + "generate secured api key with searchParams": "var response = client.generateSecuredApiKey(\n parentApiKey = \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions = SecuredApiKeyRestrictions(\n validUntil = 2524604400L,\n restrictIndices = listOf(\"Movies\", \"cts_e2e_settings\"),\n restrictSources = \"192.168.1.0/24\",\n filters = \"category:Book OR category:Ebook AND _tags:published\",\n userToken = \"user123\",\n searchParams = SearchParamsObject(\n query = \"batman\",\n typoTolerance = TypoToleranceEnum.entries.first { it.value == \"strict\" },\n aroundRadius = AroundRadiusAll.entries.first { it.value == \"all\" },\n mode = Mode.entries.first { it.value == \"neuralSearch\" },\n hitsPerPage = 10,\n optionalWords = OptionalWords.of(listOf(\"one\", \"two\")),\n ),\n ),\n)" }, "getApiKey": { "default": "var response = client.getApiKey(\n key = \"myTestApiKey\",\n)" @@ -2505,7 +2505,7 @@ }, "generateSecuredApiKey": { "generate secured api key basic": "let response = try client.generateSecuredApiKey(\n parentApiKey: \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions: SecuredApiKeyRestrictions(validUntil: Int64(2_524_604_400), restrictIndices: [\"Movies\"])\n)", - "generate secured api key with searchParams": "let response = try client.generateSecuredApiKey(\n parentApiKey: \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions: SecuredApiKeyRestrictions(\n searchParams: SearchSearchParamsObject(\n query: \"batman\",\n aroundRadius: SearchAroundRadius.searchAroundRadiusAll(SearchAroundRadiusAll.all),\n hitsPerPage: 10,\n typoTolerance: SearchTypoTolerance.searchTypoToleranceEnum(SearchTypoToleranceEnum.strict),\n mode: SearchMode.neuralSearch,\n optionalWords: [\"one\", \"two\"]\n ),\n filters: \"category:Book OR category:Ebook AND _tags:published\",\n validUntil: Int64(2_524_604_400),\n restrictIndices: [\"Movies\", \"cts_e2e_settings\"],\n restrictSources: \"192.168.1.0/24\",\n userToken: \"user123\"\n )\n)" + "generate secured api key with searchParams": "let response = try client.generateSecuredApiKey(\n parentApiKey: \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions: SecuredApiKeyRestrictions(\n searchParams: SearchSearchParamsObject(\n query: \"batman\",\n aroundRadius: SearchAroundRadius.searchAroundRadiusAll(SearchAroundRadiusAll.all),\n hitsPerPage: 10,\n typoTolerance: SearchTypoTolerance.searchTypoToleranceEnum(SearchTypoToleranceEnum.strict),\n mode: SearchMode.neuralSearch,\n optionalWords: SearchOptionalWords.arrayOfString([\"one\", \"two\"])\n ),\n filters: \"category:Book OR category:Ebook AND _tags:published\",\n validUntil: Int64(2_524_604_400),\n restrictIndices: [\"Movies\", \"cts_e2e_settings\"],\n restrictSources: \"192.168.1.0/24\",\n userToken: \"user123\"\n )\n)" }, "getApiKey": { "default": "let response = try await client.getApiKey(key: \"myTestApiKey\")" diff --git a/docs/snippets/csharp/src/Search.cs b/docs/snippets/csharp/src/Search.cs index 94a98ba686..2f9d2b0742 100644 --- a/docs/snippets/csharp/src/Search.cs +++ b/docs/snippets/csharp/src/Search.cs @@ -767,7 +767,7 @@ public async Task SnippetForSearchClientGenerateSecuredApiKey1() AroundRadius = new AroundRadius(Enum.Parse("All")), Mode = Enum.Parse("NeuralSearch"), HitsPerPage = 10, - OptionalWords = new List { "one", "two" }, + OptionalWords = new OptionalWords(new List { "one", "two" }), }, } ); diff --git a/docs/snippets/go/src/search.go b/docs/snippets/go/src/search.go index 609eb39d24..936fa323c0 100644 --- a/docs/snippets/go/src/search.go +++ b/docs/snippets/go/src/search.go @@ -989,8 +989,8 @@ func SnippetForGenerateSecuredApiKeyOfSearch1() { "2640659426d5107b6e47d75db9cbaef8", search.NewEmptySecuredApiKeyRestrictions().SetValidUntil(2524604400).SetRestrictIndices( []string{"Movies", "cts_e2e_settings"}).SetRestrictSources("192.168.1.0/24").SetFilters("category:Book OR category:Ebook AND _tags:published").SetUserToken("user123").SetSearchParams( - search.NewEmptySearchParamsObject().SetQuery("batman").SetTypoTolerance(search.TypoToleranceEnumAsTypoTolerance(search.TypoToleranceEnum("strict"))).SetAroundRadius(search.AroundRadiusAllAsAroundRadius(search.AroundRadiusAll("all"))).SetMode(search.Mode("neuralSearch")).SetHitsPerPage(10).SetOptionalWords( - []string{"one", "two"})), + search.NewEmptySearchParamsObject().SetQuery("batman").SetTypoTolerance(search.TypoToleranceEnumAsTypoTolerance(search.TypoToleranceEnum("strict"))).SetAroundRadius(search.AroundRadiusAllAsAroundRadius(search.AroundRadiusAll("all"))).SetMode(search.Mode("neuralSearch")).SetHitsPerPage(10).SetOptionalWords(search.ArrayOfStringAsOptionalWords( + []string{"one", "two"}))), ) if err != nil { // handle the eventual error diff --git a/docs/snippets/java/src/test/java/com/algolia/Search.java b/docs/snippets/java/src/test/java/com/algolia/Search.java index 0b6d5a4a7e..326aa4627c 100644 --- a/docs/snippets/java/src/test/java/com/algolia/Search.java +++ b/docs/snippets/java/src/test/java/com/algolia/Search.java @@ -661,7 +661,7 @@ void snippetForGenerateSecuredApiKey1() throws Exception { .setAroundRadius(AroundRadiusAll.ALL) .setMode(Mode.NEURAL_SEARCH) .setHitsPerPage(10) - .setOptionalWords(Arrays.asList("one", "two")) + .setOptionalWords(OptionalWords.of(Arrays.asList("one", "two"))) ) ); // >LOG diff --git a/docs/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Search.kt b/docs/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Search.kt index 53e44e00d8..f02cc1d784 100644 --- a/docs/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Search.kt +++ b/docs/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Search.kt @@ -790,7 +790,7 @@ class SnippetSearchClient { aroundRadius = AroundRadiusAll.entries.first { it.value == "all" }, mode = Mode.entries.first { it.value == "neuralSearch" }, hitsPerPage = 10, - optionalWords = listOf("one", "two"), + optionalWords = OptionalWords.of(listOf("one", "two")), ), ), ) diff --git a/docs/snippets/swift/Sources/Search.swift b/docs/snippets/swift/Sources/Search.swift index 306d844f96..4480ac4903 100644 --- a/docs/snippets/swift/Sources/Search.swift +++ b/docs/snippets/swift/Sources/Search.swift @@ -575,7 +575,7 @@ final class SearchClientSnippet { hitsPerPage: 10, typoTolerance: SearchTypoTolerance.searchTypoToleranceEnum(SearchTypoToleranceEnum.strict), mode: SearchMode.neuralSearch, - optionalWords: ["one", "two"] + optionalWords: SearchOptionalWords.arrayOfString(["one", "two"]) ), filters: "category:Book OR category:Ebook AND _tags:published", validUntil: Int64(2_524_604_400), diff --git a/specs/bundled/algoliasearch.yml b/specs/bundled/algoliasearch.yml index 97d9221ae0..bcfed1febe 100644 --- a/specs/bundled/algoliasearch.yml +++ b/specs/bundled/algoliasearch.yml @@ -751,7 +751,7 @@ components: - $ref: '#/components/schemas/aroundPrecisionFromValue' x-categories: - Geo-Search - insideBoundingBox: + insideBoundingBoxArray: type: array items: type: array @@ -786,6 +786,11 @@ components: - 1.9916 x-categories: - Geo-Search + insideBoundingBox: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/insideBoundingBoxArray' insidePolygon: type: array items: @@ -1355,6 +1360,58 @@ components: items: type: string - type: 'null' + optionalWordsArray: + type: array + items: + type: string + example: + - blue + - iphone case + description: > + 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). + default: [] + x-categories: + - Query strategy + optionalWords: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/optionalWordsArray' exactOnSingleWordQuery: type: string enum: @@ -1438,15 +1495,6 @@ components: default: 0 x-categories: - Advanced - maxFacetHits: - type: integer - description: >- - 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 - default: 10 - x-categories: - - Advanced order: description: > Explicit order of facets or facet values. @@ -2008,52 +2056,7 @@ components: x-categories: - Query strategy optionalWords: - type: array - items: - type: string - example: - - blue - - iphone case - description: > - 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). - default: [] - x-categories: - - Query strategy + $ref: '#/components/schemas/optionalWords' disableExactOnAttributes: type: array items: @@ -2215,8 +2218,6 @@ components: - '*' x-categories: - Advanced - maxFacetHits: - $ref: '#/components/schemas/maxFacetHits' maxValuesPerFacet: type: integer description: Maximum number of facet values to return for each facet. @@ -2827,6 +2828,15 @@ components: description: Text to search inside the facet's values. example: george default: '' + maxFacetHits: + type: integer + description: >- + 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 + default: 10 + x-categories: + - Advanced searchTypeFacet: type: string enum: @@ -3363,6 +3373,8 @@ components: accurate facet counts. example: url type: string + maxFacetHits: + $ref: '#/components/schemas/maxFacetHits' indexSettings: description: Index settings. allOf: @@ -4233,53 +4245,6 @@ components: default: false x-categories: - Query strategy - optionalWords: - type: array - items: - type: string - example: - - blue - - iphone case - description: > - 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). - default: [] - x-categories: - - Query strategy disableExactOnAttributes: type: array items: @@ -4573,8 +4538,6 @@ components: $ref: '#/components/schemas/minProximity' responseFields: $ref: '#/components/schemas/responseFields' - maxFacetHits: - $ref: '#/components/schemas/maxFacetHits' maxValuesPerFacet: $ref: '#/components/schemas/maxValuesPerFacet' sortFacetValuesBy: diff --git a/specs/bundled/composition.doc.yml b/specs/bundled/composition.doc.yml index 572c4055ab..b440291be6 100644 --- a/specs/bundled/composition.doc.yml +++ b/specs/bundled/composition.doc.yml @@ -534,7 +534,7 @@ paths: --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ - --data '{"requests":[{"action":"upsert","body":{"objectID":"test-record-123","description":"my lovely crafted composition","behavior":{"injection":{"main":{"source":{"search":{"index":"Products","params":{"attributesToRetrieve":["author","title","content"],"restrictSearchableAttributes":["title","author"],"filters":"(category:Book OR category:Ebook) AND _tags:published","facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"optionalFilters":["category:Book","author:John Doe"],"numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"sumOrFiltersScores":false,"facets":["*"],"maxValuesPerFacet":100,"facetingAfterDistinct":false,"sortFacetValuesBy":"count","attributesToHighlight":["author","title","conten","content"],"attributesToSnippet":["content:80","description"],"highlightPreTag":"","highlightPostTag":"","snippetEllipsisText":"…","restrictHighlightAndSnippetArrays":false,"hitsPerPage":20,"length":0,"minWordSizefor1Typo":4,"minWordSizefor2Typos":8,"typoTolerance":true,"allowTyposOnNumericTokens":true,"disableTypoToleranceOnAttributes":["sku"],"ignorePlurals":["ca","es"],"removeStopWords":["ca","es"],"queryLanguages":["es"],"naturalLanguages":[],"decompoundQuery":true,"enableRules":true,"ruleContexts":["mobile"],"enablePersonalization":false,"personalizationImpact":100,"queryType":"prefixLast","removeWordsIfNoResults":"firstWords","advancedSyntax":false,"optionalWords":["blue","iphone case"],"disableExactOnAttributes":["description"],"exactOnSingleWordQuery":"attribute","alternativesAsExact":["ignorePlurals","singleWordSynonym"],"advancedSyntaxFeatures":["exactPhrase","excludeWords"],"distinct":1,"getRankingInfo":true,"clickAnalytics":false,"analytics":true,"analyticsTags":[],"synonyms":true,"replaceSynonymsInHighlight":false,"minProximity":1,"responseFields":["*"],"maxFacetHits":10,"percentileComputation":true,"attributeCriteriaComputedByMinProximity":false,"enableABTest":true,"enableReRanking":true}}}},"insets":[{"name":"lorem","source":{"search":{"index":"Products","params":{"attributesToRetrieve":["author","title","content"],"restrictSearchableAttributes":["title","author"],"filters":"(category:Book OR category:Ebook) AND _tags:published","facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"optionalFilters":["category:Book","author:John Doe"],"numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"attributesToHighlight":["author","title","conten","content"],"attributesToSnippet":["content:80","description"],"highlightPreTag":"","highlightPostTag":"","snippetEllipsisText":"…","restrictHighlightAndSnippetArrays":false,"minWordSizefor1Typo":4,"minWordSizefor2Typos":8,"typoTolerance":true,"allowTyposOnNumericTokens":true,"disableTypoToleranceOnAttributes":["sku"],"ignorePlurals":["ca","es"],"removeStopWords":["ca","es"],"queryLanguages":["es"],"naturalLanguages":[],"decompoundQuery":true,"enableRules":true,"ruleContexts":["mobile"],"enablePersonalization":false,"personalizationImpact":100,"queryType":"prefixLast","removeWordsIfNoResults":"firstWords","advancedSyntax":false,"optionalWords":["blue","iphone case"],"disableExactOnAttributes":["description"],"exactOnSingleWordQuery":"attribute","alternativesAsExact":["ignorePlurals","singleWordSynonym"],"advancedSyntaxFeatures":["exactPhrase","excludeWords"],"distinct":1,"getRankingInfo":true,"clickAnalytics":false,"analytics":true,"analyticsTags":[],"synonyms":true,"replaceSynonymsInHighlight":false,"minProximity":1,"responseFields":["*"],"maxFacetHits":10,"percentileComputation":true,"attributeCriteriaComputedByMinProximity":false,"enableABTest":true,"enableReRanking":true}}},"position":0,"length":0}]}}}}]}' + --data '{"requests":[{"action":"upsert","body":{"objectID":"test-record-123","description":"my lovely crafted composition","behavior":{"injection":{"main":{"source":{"search":{"index":"Products","params":{"attributesToRetrieve":["author","title","content"],"restrictSearchableAttributes":["title","author"],"filters":"(category:Book OR category:Ebook) AND _tags:published","facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"optionalFilters":["category:Book","author:John Doe"],"numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"sumOrFiltersScores":false,"facets":["*"],"maxValuesPerFacet":100,"facetingAfterDistinct":false,"sortFacetValuesBy":"count","attributesToHighlight":["author","title","conten","content"],"attributesToSnippet":["content:80","description"],"highlightPreTag":"","highlightPostTag":"","snippetEllipsisText":"…","restrictHighlightAndSnippetArrays":false,"hitsPerPage":20,"length":0,"minWordSizefor1Typo":4,"minWordSizefor2Typos":8,"typoTolerance":true,"allowTyposOnNumericTokens":true,"disableTypoToleranceOnAttributes":["sku"],"ignorePlurals":["ca","es"],"removeStopWords":["ca","es"],"queryLanguages":["es"],"naturalLanguages":[],"decompoundQuery":true,"enableRules":true,"ruleContexts":["mobile"],"enablePersonalization":false,"personalizationImpact":100,"queryType":"prefixLast","removeWordsIfNoResults":"firstWords","advancedSyntax":false,"optionalWords":["blue","iphone case"],"disableExactOnAttributes":["description"],"exactOnSingleWordQuery":"attribute","alternativesAsExact":["ignorePlurals","singleWordSynonym"],"advancedSyntaxFeatures":["exactPhrase","excludeWords"],"distinct":1,"getRankingInfo":true,"clickAnalytics":false,"analytics":true,"analyticsTags":[],"synonyms":true,"replaceSynonymsInHighlight":false,"minProximity":1,"responseFields":["*"],"maxFacetHits":10,"percentileComputation":true,"attributeCriteriaComputedByMinProximity":false,"enableABTest":true,"enableReRanking":true}}}},"insets":[{"name":"lorem","source":{"search":{"index":"Products","params":{"attributesToRetrieve":["author","title","content"],"restrictSearchableAttributes":["title","author"],"filters":"(category:Book OR category:Ebook) AND _tags:published","facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"optionalFilters":["category:Book","author:John Doe"],"numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"attributesToHighlight":["author","title","conten","content"],"attributesToSnippet":["content:80","description"],"highlightPreTag":"","highlightPostTag":"","snippetEllipsisText":"…","restrictHighlightAndSnippetArrays":false,"minWordSizefor1Typo":4,"minWordSizefor2Typos":8,"typoTolerance":true,"allowTyposOnNumericTokens":true,"disableTypoToleranceOnAttributes":["sku"],"ignorePlurals":["ca","es"],"removeStopWords":["ca","es"],"queryLanguages":["es"],"naturalLanguages":[],"decompoundQuery":true,"enableRules":true,"ruleContexts":["mobile"],"enablePersonalization":false,"personalizationImpact":100,"queryType":"prefixLast","removeWordsIfNoResults":"firstWords","advancedSyntax":false,"optionalWords":"lorem","disableExactOnAttributes":["description"],"exactOnSingleWordQuery":"attribute","alternativesAsExact":["ignorePlurals","singleWordSynonym"],"advancedSyntaxFeatures":["exactPhrase","excludeWords"],"distinct":1,"getRankingInfo":true,"clickAnalytics":false,"analytics":true,"analyticsTags":[],"synonyms":true,"replaceSynonymsInHighlight":false,"minProximity":1,"responseFields":["*"],"maxFacetHits":10,"percentileComputation":true,"attributeCriteriaComputedByMinProximity":false,"enableABTest":true,"enableReRanking":true}}},"position":0,"length":0}]}}}}]}' /1/compositions/{compositionID}/rules/{objectID}: get: tags: @@ -915,7 +915,7 @@ paths: --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ - --data '{"params":{"query":"","filters":"(category:Book OR category:Ebook) AND _tags:published","page":0,"getRankingInfo":true,"relevancyStrictness":42,"facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"optionalFilters":["category:Book","author:John Doe"],"numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"hitsPerPage":20,"aroundLatLng":"40.71,-74.01","aroundLatLngViaIP":false,"aroundRadius":1,"aroundPrecision":10,"minimumAroundRadius":1,"insideBoundingBox":[[47.3165,4.9665,47.3424,5.0201],[40.9234,2.1185,38.643,1.9916]],"insidePolygon":[[47.3165,4.9665,47.3424,5.0201,47.32,4.9],[40.9234,2.1185,38.643,1.9916,39.2587,2.0104]],"queryLanguages":["es"],"naturalLanguages":[],"enableRules":true,"ruleContexts":["mobile"],"userToken":"test-user-123","clickAnalytics":false,"analytics":true,"analyticsTags":[],"enableABTest":true,"enableReRanking":true}}' + --data '{"params":{"query":"","filters":"(category:Book OR category:Ebook) AND _tags:published","page":0,"getRankingInfo":true,"relevancyStrictness":42,"facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"optionalFilters":["category:Book","author:John Doe"],"numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"hitsPerPage":20,"aroundLatLng":"40.71,-74.01","aroundLatLngViaIP":false,"aroundRadius":1,"aroundPrecision":10,"minimumAroundRadius":1,"insideBoundingBox":"lorem","insidePolygon":[[47.3165,4.9665,47.3424,5.0201,47.32,4.9],[40.9234,2.1185,38.643,1.9916,39.2587,2.0104]],"queryLanguages":["es"],"naturalLanguages":[],"enableRules":true,"ruleContexts":["mobile"],"userToken":"test-user-123","clickAnalytics":false,"analytics":true,"analyticsTags":[],"enableABTest":true,"enableReRanking":true}}' components: securitySchemes: appId: @@ -1258,7 +1258,7 @@ components: - $ref: '#/components/schemas/aroundPrecisionFromValue' x-categories: - Geo-Search - insideBoundingBox: + insideBoundingBoxArray: type: array items: type: array @@ -1293,6 +1293,11 @@ components: - 1.9916 x-categories: - Geo-Search + insideBoundingBox: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/insideBoundingBoxArray' insidePolygon: type: array items: @@ -3285,6 +3290,58 @@ components: default: true x-categories: - Filtering + optionalWordsArray: + type: array + items: + type: string + example: + - blue + - iphone case + description: > + 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). + default: [] + x-categories: + - Query strategy + optionalWords: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/optionalWordsArray' InsetsQueryParameters: title: Composition Insets Query parameters as object type: object @@ -3635,52 +3692,7 @@ components: x-categories: - Query strategy optionalWords: - type: array - items: - type: string - example: - - blue - - iphone case - description: > - 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). - default: [] - x-categories: - - Query strategy + $ref: '#/components/schemas/optionalWords' disableExactOnAttributes: type: array items: diff --git a/specs/bundled/composition.yml b/specs/bundled/composition.yml index 62c3e3ba19..efd7b30907 100644 --- a/specs/bundled/composition.yml +++ b/specs/bundled/composition.yml @@ -981,7 +981,7 @@ components: - $ref: '#/components/schemas/aroundPrecisionFromValue' x-categories: - Geo-Search - insideBoundingBox: + insideBoundingBoxArray: type: array items: type: array @@ -1016,6 +1016,11 @@ components: - 1.9916 x-categories: - Geo-Search + insideBoundingBox: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/insideBoundingBoxArray' insidePolygon: type: array items: @@ -3008,6 +3013,58 @@ components: default: true x-categories: - Filtering + optionalWordsArray: + type: array + items: + type: string + example: + - blue + - iphone case + description: > + 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). + default: [] + x-categories: + - Query strategy + optionalWords: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/optionalWordsArray' InsetsQueryParameters: title: Composition Insets Query parameters as object type: object @@ -3358,52 +3415,7 @@ components: x-categories: - Query strategy optionalWords: - type: array - items: - type: string - example: - - blue - - iphone case - description: > - 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). - default: [] - x-categories: - - Query strategy + $ref: '#/components/schemas/optionalWords' disableExactOnAttributes: type: array items: diff --git a/specs/bundled/crawler.doc.yml b/specs/bundled/crawler.doc.yml index 8ac20ef9bc..634ff565e0 100644 --- a/specs/bundled/crawler.doc.yml +++ b/specs/bundled/crawler.doc.yml @@ -1129,6 +1129,15 @@ components: default: {} x-categories: - Advanced + maxFacetHits: + type: integer + description: >- + 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 + default: 10 + x-categories: + - Advanced baseIndexSettings: type: object additionalProperties: false @@ -1531,6 +1540,8 @@ components: accurate facet counts. example: url type: string + maxFacetHits: + $ref: '#/components/schemas/maxFacetHits' hitsPerPage: type: integer description: Number of hits per page. @@ -1723,6 +1734,58 @@ components: items: type: string - type: 'null' + optionalWordsArray: + type: array + items: + type: string + example: + - blue + - iphone case + description: > + 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). + default: [] + x-categories: + - Query strategy + optionalWords: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/optionalWordsArray' exactOnSingleWordQuery: type: string enum: @@ -1806,15 +1869,6 @@ components: default: 0 x-categories: - Advanced - maxFacetHits: - type: integer - description: >- - 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 - default: 10 - x-categories: - - Advanced order: description: > Explicit order of facets or facet values. @@ -2365,52 +2419,7 @@ components: x-categories: - Query strategy optionalWords: - type: array - items: - type: string - example: - - blue - - iphone case - description: > - 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). - default: [] - x-categories: - - Query strategy + $ref: '#/components/schemas/optionalWords' disableExactOnAttributes: type: array items: @@ -2572,8 +2581,6 @@ components: - '*' x-categories: - Advanced - maxFacetHits: - $ref: '#/components/schemas/maxFacetHits' maxValuesPerFacet: type: integer description: Maximum number of facet values to return for each facet. diff --git a/specs/bundled/crawler.yml b/specs/bundled/crawler.yml index 784e897a70..5ea6f3d2c7 100644 --- a/specs/bundled/crawler.yml +++ b/specs/bundled/crawler.yml @@ -1129,6 +1129,15 @@ components: default: {} x-categories: - Advanced + maxFacetHits: + type: integer + description: >- + 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 + default: 10 + x-categories: + - Advanced baseIndexSettings: type: object additionalProperties: false @@ -1531,6 +1540,8 @@ components: accurate facet counts. example: url type: string + maxFacetHits: + $ref: '#/components/schemas/maxFacetHits' hitsPerPage: type: integer description: Number of hits per page. @@ -1723,6 +1734,58 @@ components: items: type: string - type: 'null' + optionalWordsArray: + type: array + items: + type: string + example: + - blue + - iphone case + description: > + 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). + default: [] + x-categories: + - Query strategy + optionalWords: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/optionalWordsArray' exactOnSingleWordQuery: type: string enum: @@ -1806,15 +1869,6 @@ components: default: 0 x-categories: - Advanced - maxFacetHits: - type: integer - description: >- - 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 - default: 10 - x-categories: - - Advanced order: description: > Explicit order of facets or facet values. @@ -2365,52 +2419,7 @@ components: x-categories: - Query strategy optionalWords: - type: array - items: - type: string - example: - - blue - - iphone case - description: > - 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). - default: [] - x-categories: - - Query strategy + $ref: '#/components/schemas/optionalWords' disableExactOnAttributes: type: array items: @@ -2572,8 +2581,6 @@ components: - '*' x-categories: - Advanced - maxFacetHits: - $ref: '#/components/schemas/maxFacetHits' maxValuesPerFacet: type: integer description: Maximum number of facet values to return for each facet. diff --git a/specs/bundled/recommend.doc.yml b/specs/bundled/recommend.doc.yml index 9d962dfa08..f489f365f0 100644 --- a/specs/bundled/recommend.doc.yml +++ b/specs/bundled/recommend.doc.yml @@ -1485,7 +1485,7 @@ paths: --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ - --data '{"requests":[{"indexName":"products","threshold":0,"maxRecommendations":30,"queryParameters":{"similarQuery":"comedy drama crime Macy Buscemi","filters":"(category:Book OR category:Ebook) AND _tags:published","facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"optionalFilters":["category:Book","author:John Doe"],"numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"tagFilters":[["Book","Movie"],"SciFi"],"sumOrFiltersScores":false,"restrictSearchableAttributes":["title","author"],"facets":["*"],"facetingAfterDistinct":false,"aroundLatLng":"40.71,-74.01","aroundLatLngViaIP":false,"aroundRadius":1,"aroundPrecision":10,"minimumAroundRadius":1,"insideBoundingBox":[[47.3165,4.9665,47.3424,5.0201],[40.9234,2.1185,38.643,1.9916]],"insidePolygon":[[47.3165,4.9665,47.3424,5.0201,47.32,4.9],[40.9234,2.1185,38.643,1.9916,39.2587,2.0104]],"naturalLanguages":[],"ruleContexts":["mobile"],"personalizationImpact":100,"userToken":"test-user-123","getRankingInfo":false,"synonyms":true,"clickAnalytics":false,"analytics":true,"analyticsTags":[],"percentileComputation":true,"enableABTest":true,"query":"","attributesForFaceting":["author","filterOnly(isbn)","searchable(edition)","afterDistinct(category)","afterDistinct(searchable(publisher))"],"replicas":["virtual(prod_products_price_asc)","dev_products_replica"],"paginationLimitedTo":100,"unretrievableAttributes":["total_sales"],"disableTypoToleranceOnWords":["wheel","1X2BCD"],"attributesToTransliterate":["name","description"],"camelCaseAttributes":["description"],"decompoundedAttributes":{"de":["name"]},"indexLanguages":["ja"],"disablePrefixOnAttributes":["sku"],"allowCompressionOfIntegerArray":false,"numericAttributesForFiltering":["equalOnly(quantity)","popularity"],"separatorsToIndex":"+#","searchableAttributes":["title,alternative_title","author","unordered(text)","emails.personal"],"userData":{"settingID":"f2a7b51e3503acc6a39b3784ffb84300","pluginVersion":"1.6.0"},"customNormalization":{"default":{"ä":"ae","ü":"ue"}},"attributeForDistinct":"url","attributesToRetrieve":["author","title","content"],"ranking":["typo","geo","words","filters","proximity","attribute","exact","custom"],"relevancyStrictness":90,"attributesToHighlight":["author","title","conten","content"],"attributesToSnippet":["content:80","description"],"highlightPreTag":"","highlightPostTag":"","snippetEllipsisText":"…","restrictHighlightAndSnippetArrays":false,"minWordSizefor1Typo":4,"minWordSizefor2Typos":8,"typoTolerance":true,"allowTyposOnNumericTokens":true,"disableTypoToleranceOnAttributes":["sku"],"ignorePlurals":["ca","es"],"removeStopWords":["ca","es"],"queryLanguages":["es"],"decompoundQuery":true,"enableRules":true,"enablePersonalization":false,"queryType":"prefixLast","removeWordsIfNoResults":"firstWords","advancedSyntax":false,"optionalWords":["blue","iphone case"],"disableExactOnAttributes":["description"],"exactOnSingleWordQuery":"attribute","alternativesAsExact":["ignorePlurals","singleWordSynonym"],"advancedSyntaxFeatures":["exactPhrase","excludeWords"],"distinct":1,"replaceSynonymsInHighlight":false,"minProximity":1,"responseFields":["*"],"maxFacetHits":10,"maxValuesPerFacet":100,"sortFacetValuesBy":"count","attributeCriteriaComputedByMinProximity":false,"renderingContent":{"facetOrdering":{"facets":{"order":["lorem"]},"values":{"property1":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]},"property2":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]}}},"redirect":{"url":"lorem"},"widgets":{"banners":[{"image":{"urls":[{"url":"lorem"}],"title":"lorem"},"link":{"url":"lorem"}}]}},"enableReRanking":true,"reRankingApplyFilter":[[]]},"model":"bought-together","objectID":"test-record-123"}]}' + --data '{"requests":[{"indexName":"products","threshold":0,"maxRecommendations":30,"queryParameters":{"similarQuery":"comedy drama crime Macy Buscemi","filters":"(category:Book OR category:Ebook) AND _tags:published","facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"optionalFilters":["category:Book","author:John Doe"],"numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"tagFilters":[["Book","Movie"],"SciFi"],"sumOrFiltersScores":false,"restrictSearchableAttributes":["title","author"],"facets":["*"],"facetingAfterDistinct":false,"aroundLatLng":"40.71,-74.01","aroundLatLngViaIP":false,"aroundRadius":1,"aroundPrecision":10,"minimumAroundRadius":1,"insideBoundingBox":"lorem","insidePolygon":[[47.3165,4.9665,47.3424,5.0201,47.32,4.9],[40.9234,2.1185,38.643,1.9916,39.2587,2.0104]],"naturalLanguages":[],"ruleContexts":["mobile"],"personalizationImpact":100,"userToken":"test-user-123","getRankingInfo":false,"synonyms":true,"clickAnalytics":false,"analytics":true,"analyticsTags":[],"percentileComputation":true,"enableABTest":true,"query":"","attributesForFaceting":["author","filterOnly(isbn)","searchable(edition)","afterDistinct(category)","afterDistinct(searchable(publisher))"],"replicas":["virtual(prod_products_price_asc)","dev_products_replica"],"paginationLimitedTo":100,"unretrievableAttributes":["total_sales"],"disableTypoToleranceOnWords":["wheel","1X2BCD"],"attributesToTransliterate":["name","description"],"camelCaseAttributes":["description"],"decompoundedAttributes":{"de":["name"]},"indexLanguages":["ja"],"disablePrefixOnAttributes":["sku"],"allowCompressionOfIntegerArray":false,"numericAttributesForFiltering":["equalOnly(quantity)","popularity"],"separatorsToIndex":"+#","searchableAttributes":["title,alternative_title","author","unordered(text)","emails.personal"],"userData":{"settingID":"f2a7b51e3503acc6a39b3784ffb84300","pluginVersion":"1.6.0"},"customNormalization":{"default":{"ä":"ae","ü":"ue"}},"attributeForDistinct":"url","maxFacetHits":10,"attributesToRetrieve":["author","title","content"],"ranking":["typo","geo","words","filters","proximity","attribute","exact","custom"],"relevancyStrictness":90,"attributesToHighlight":["author","title","conten","content"],"attributesToSnippet":["content:80","description"],"highlightPreTag":"","highlightPostTag":"","snippetEllipsisText":"…","restrictHighlightAndSnippetArrays":false,"minWordSizefor1Typo":4,"minWordSizefor2Typos":8,"typoTolerance":true,"allowTyposOnNumericTokens":true,"disableTypoToleranceOnAttributes":["sku"],"ignorePlurals":["ca","es"],"removeStopWords":["ca","es"],"queryLanguages":["es"],"decompoundQuery":true,"enableRules":true,"enablePersonalization":false,"queryType":"prefixLast","removeWordsIfNoResults":"firstWords","advancedSyntax":false,"optionalWords":"lorem","disableExactOnAttributes":["description"],"exactOnSingleWordQuery":"attribute","alternativesAsExact":["ignorePlurals","singleWordSynonym"],"advancedSyntaxFeatures":["exactPhrase","excludeWords"],"distinct":1,"replaceSynonymsInHighlight":false,"minProximity":1,"responseFields":["*"],"maxValuesPerFacet":100,"sortFacetValuesBy":"count","attributeCriteriaComputedByMinProximity":false,"renderingContent":{"facetOrdering":{"facets":{"order":["lorem"]},"values":{"property1":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]},"property2":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]}}},"redirect":{"url":"lorem"},"widgets":{"banners":[{"image":{"urls":[{"url":"lorem"}],"title":"lorem"},"link":{"url":"lorem"}}]}},"enableReRanking":true,"reRankingApplyFilter":[[]]},"model":"bought-together","objectID":"test-record-123"}]}' /1/indexes/{indexName}/{model}/recommend/rules/{objectID}: get: tags: @@ -3119,7 +3119,7 @@ components: minimum: 1 x-categories: - Geo-Search - insideBoundingBox: + insideBoundingBoxArray: type: array items: type: array @@ -3154,6 +3154,11 @@ components: - 1.9916 x-categories: - Geo-Search + insideBoundingBox: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/insideBoundingBoxArray' insidePolygon: type: array items: @@ -3467,6 +3472,15 @@ components: default: {} x-categories: - Advanced + maxFacetHits: + type: integer + description: >- + 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 + default: 10 + x-categories: + - Advanced baseIndexSettings: type: object additionalProperties: false @@ -3869,6 +3883,8 @@ components: accurate facet counts. example: url type: string + maxFacetHits: + $ref: '#/components/schemas/maxFacetHits' attributesToRetrieve: type: array items: @@ -4342,7 +4358,7 @@ components: default: false x-categories: - Query strategy - optionalWords: + optionalWordsArray: type: array items: type: string @@ -4389,6 +4405,11 @@ components: default: [] x-categories: - Query strategy + optionalWords: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/optionalWordsArray' disableExactOnAttributes: type: array items: @@ -4628,15 +4649,6 @@ components: - '*' x-categories: - Advanced - maxFacetHits: - type: integer - description: >- - 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 - default: 10 - x-categories: - - Advanced maxValuesPerFacet: type: integer description: Maximum number of facet values to return for each facet. @@ -4919,8 +4931,6 @@ components: $ref: '#/components/schemas/minProximity' responseFields: $ref: '#/components/schemas/responseFields' - maxFacetHits: - $ref: '#/components/schemas/maxFacetHits' maxValuesPerFacet: $ref: '#/components/schemas/maxValuesPerFacet' sortFacetValuesBy: diff --git a/specs/bundled/recommend.yml b/specs/bundled/recommend.yml index 15395b389d..551a3757e4 100644 --- a/specs/bundled/recommend.yml +++ b/specs/bundled/recommend.yml @@ -1025,7 +1025,7 @@ components: minimum: 1 x-categories: - Geo-Search - insideBoundingBox: + insideBoundingBoxArray: type: array items: type: array @@ -1060,6 +1060,11 @@ components: - 1.9916 x-categories: - Geo-Search + insideBoundingBox: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/insideBoundingBoxArray' insidePolygon: type: array items: @@ -1373,6 +1378,15 @@ components: default: {} x-categories: - Advanced + maxFacetHits: + type: integer + description: >- + 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 + default: 10 + x-categories: + - Advanced baseIndexSettings: type: object additionalProperties: false @@ -1775,6 +1789,8 @@ components: accurate facet counts. example: url type: string + maxFacetHits: + $ref: '#/components/schemas/maxFacetHits' attributesToRetrieve: type: array items: @@ -2248,7 +2264,7 @@ components: default: false x-categories: - Query strategy - optionalWords: + optionalWordsArray: type: array items: type: string @@ -2295,6 +2311,11 @@ components: default: [] x-categories: - Query strategy + optionalWords: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/optionalWordsArray' disableExactOnAttributes: type: array items: @@ -2534,15 +2555,6 @@ components: - '*' x-categories: - Advanced - maxFacetHits: - type: integer - description: >- - 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 - default: 10 - x-categories: - - Advanced maxValuesPerFacet: type: integer description: Maximum number of facet values to return for each facet. @@ -2825,8 +2837,6 @@ components: $ref: '#/components/schemas/minProximity' responseFields: $ref: '#/components/schemas/responseFields' - maxFacetHits: - $ref: '#/components/schemas/maxFacetHits' maxValuesPerFacet: $ref: '#/components/schemas/maxValuesPerFacet' sortFacetValuesBy: diff --git a/specs/bundled/search.doc.yml b/specs/bundled/search.doc.yml index 86a13a93aa..16ab6f89f5 100644 --- a/specs/bundled/search.doc.yml +++ b/specs/bundled/search.doc.yml @@ -3804,7 +3804,7 @@ paths: --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ - --data '{"facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"filters":"(category:Book OR category:Ebook) AND _tags:published","numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"tagFilters":[["Book","Movie"],"SciFi"],"aroundLatLng":"40.71,-74.01","aroundRadius":1,"insideBoundingBox":[[47.3165,4.9665,47.3424,5.0201],[40.9234,2.1185,38.643,1.9916]],"insidePolygon":[[47.3165,4.9665,47.3424,5.0201,47.32,4.9],[40.9234,2.1185,38.643,1.9916,39.2587,2.0104]]}' + --data '{"facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"filters":"(category:Book OR category:Ebook) AND _tags:published","numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"tagFilters":[["Book","Movie"],"SciFi"],"aroundLatLng":"40.71,-74.01","aroundRadius":1,"insideBoundingBox":"lorem","insidePolygon":[[47.3165,4.9665,47.3424,5.0201,47.32,4.9],[40.9234,2.1185,38.643,1.9916,39.2587,2.0104]]}' /1/indexes/{indexName}/clear: post: tags: @@ -9481,7 +9481,7 @@ paths: --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ - --data '[{"objectID":"lorem","conditions":[{"pattern":"{facet:genre}","anchoring":"is","alternatives":false,"context":"mobile","filters":"genre:comedy"}],"consequence":{"params":{"similarQuery":"comedy drama crime Macy Buscemi","filters":"(category:Book OR category:Ebook) AND _tags:published","facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"optionalFilters":["category:Book","author:John Doe"],"numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"tagFilters":[["Book","Movie"],"SciFi"],"sumOrFiltersScores":false,"restrictSearchableAttributes":["title","author"],"facets":["*"],"facetingAfterDistinct":false,"page":0,"offset":42,"length":0,"aroundLatLng":"40.71,-74.01","aroundLatLngViaIP":false,"aroundRadius":1,"aroundPrecision":10,"minimumAroundRadius":1,"insideBoundingBox":[[47.3165,4.9665,47.3424,5.0201],[40.9234,2.1185,38.643,1.9916]],"insidePolygon":[[47.3165,4.9665,47.3424,5.0201,47.32,4.9],[40.9234,2.1185,38.643,1.9916,39.2587,2.0104]],"naturalLanguages":[],"ruleContexts":["mobile"],"personalizationImpact":100,"userToken":"test-user-123","getRankingInfo":false,"synonyms":true,"clickAnalytics":false,"analytics":true,"analyticsTags":[],"percentileComputation":true,"enableABTest":true,"attributesToRetrieve":["author","title","content"],"ranking":["typo","geo","words","filters","proximity","attribute","exact","custom"],"customRanking":["desc(popularity)","asc(price)"],"relevancyStrictness":90,"attributesToHighlight":["author","title","conten","content"],"attributesToSnippet":["content:80","description"],"highlightPreTag":"","highlightPostTag":"","snippetEllipsisText":"…","restrictHighlightAndSnippetArrays":false,"hitsPerPage":20,"minWordSizefor1Typo":4,"minWordSizefor2Typos":8,"typoTolerance":true,"allowTyposOnNumericTokens":true,"disableTypoToleranceOnAttributes":["sku"],"ignorePlurals":["ca","es"],"removeStopWords":["ca","es"],"keepDiacriticsOnCharacters":"øé","queryLanguages":["es"],"decompoundQuery":true,"enableRules":true,"enablePersonalization":false,"queryType":"prefixLast","removeWordsIfNoResults":"firstWords","mode":"keywordSearch","semanticSearch":{"eventSources":["lorem"]},"advancedSyntax":false,"optionalWords":["blue","iphone case"],"disableExactOnAttributes":["description"],"exactOnSingleWordQuery":"attribute","alternativesAsExact":["ignorePlurals","singleWordSynonym"],"advancedSyntaxFeatures":["exactPhrase","excludeWords"],"distinct":1,"replaceSynonymsInHighlight":false,"minProximity":1,"responseFields":["*"],"maxFacetHits":10,"maxValuesPerFacet":100,"sortFacetValuesBy":"count","attributeCriteriaComputedByMinProximity":false,"renderingContent":{"facetOrdering":{"facets":{"order":["lorem"]},"values":{"property1":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]},"property2":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]}}},"redirect":{"url":"lorem"},"widgets":{"banners":[{"image":{"urls":[{"url":"lorem"}],"title":"lorem"},"link":{"url":"lorem"}}]}},"enableReRanking":true,"reRankingApplyFilter":[[]],"query":{"remove":["lorem"],"edits":[{"type":"remove","delete":"lorem","insert":"lorem"}]},"automaticFacetFilters":[{"facet":"lorem","score":1,"disjunctive":false}],"automaticOptionalFacetFilters":[{"facet":"lorem","score":1,"disjunctive":false}]},"promote":[{"objectIDs":["test-record-123"],"position":0}],"filterPromotes":false,"hide":[{"objectID":"test-record-123"}],"userData":{"settingID":"f2a7b51e3503acc6a39b3784ffb84300","pluginVersion":"1.6.0"}},"description":"Display a promotional banner","enabled":true,"validity":[{"from":42,"until":42}]}]' + --data '[{"objectID":"lorem","conditions":[{"pattern":"{facet:genre}","anchoring":"is","alternatives":false,"context":"mobile","filters":"genre:comedy"}],"consequence":{"params":{"similarQuery":"comedy drama crime Macy Buscemi","filters":"(category:Book OR category:Ebook) AND _tags:published","facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"optionalFilters":["category:Book","author:John Doe"],"numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"tagFilters":[["Book","Movie"],"SciFi"],"sumOrFiltersScores":false,"restrictSearchableAttributes":["title","author"],"facets":["*"],"facetingAfterDistinct":false,"page":0,"offset":42,"length":0,"aroundLatLng":"40.71,-74.01","aroundLatLngViaIP":false,"aroundRadius":1,"aroundPrecision":10,"minimumAroundRadius":1,"insideBoundingBox":"lorem","insidePolygon":[[47.3165,4.9665,47.3424,5.0201,47.32,4.9],[40.9234,2.1185,38.643,1.9916,39.2587,2.0104]],"naturalLanguages":[],"ruleContexts":["mobile"],"personalizationImpact":100,"userToken":"test-user-123","getRankingInfo":false,"synonyms":true,"clickAnalytics":false,"analytics":true,"analyticsTags":[],"percentileComputation":true,"enableABTest":true,"attributesToRetrieve":["author","title","content"],"ranking":["typo","geo","words","filters","proximity","attribute","exact","custom"],"customRanking":["desc(popularity)","asc(price)"],"relevancyStrictness":90,"attributesToHighlight":["author","title","conten","content"],"attributesToSnippet":["content:80","description"],"highlightPreTag":"","highlightPostTag":"","snippetEllipsisText":"…","restrictHighlightAndSnippetArrays":false,"hitsPerPage":20,"minWordSizefor1Typo":4,"minWordSizefor2Typos":8,"typoTolerance":true,"allowTyposOnNumericTokens":true,"disableTypoToleranceOnAttributes":["sku"],"ignorePlurals":["ca","es"],"removeStopWords":["ca","es"],"keepDiacriticsOnCharacters":"øé","queryLanguages":["es"],"decompoundQuery":true,"enableRules":true,"enablePersonalization":false,"queryType":"prefixLast","removeWordsIfNoResults":"firstWords","mode":"keywordSearch","semanticSearch":{"eventSources":["lorem"]},"advancedSyntax":false,"optionalWords":"lorem","disableExactOnAttributes":["description"],"exactOnSingleWordQuery":"attribute","alternativesAsExact":["ignorePlurals","singleWordSynonym"],"advancedSyntaxFeatures":["exactPhrase","excludeWords"],"distinct":1,"replaceSynonymsInHighlight":false,"minProximity":1,"responseFields":["*"],"maxValuesPerFacet":100,"sortFacetValuesBy":"count","attributeCriteriaComputedByMinProximity":false,"renderingContent":{"facetOrdering":{"facets":{"order":["lorem"]},"values":{"property1":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]},"property2":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]}}},"redirect":{"url":"lorem"},"widgets":{"banners":[{"image":{"urls":[{"url":"lorem"}],"title":"lorem"},"link":{"url":"lorem"}}]}},"enableReRanking":true,"reRankingApplyFilter":[[]],"query":{"remove":["lorem"],"edits":[{"type":"remove","delete":"lorem","insert":"lorem"}]},"automaticFacetFilters":[{"facet":"lorem","score":1,"disjunctive":false}],"automaticOptionalFacetFilters":[{"facet":"lorem","score":1,"disjunctive":false}]},"promote":[{"objectIDs":["test-record-123"],"position":0}],"filterPromotes":false,"hide":[{"objectID":"test-record-123"}],"userData":{"settingID":"f2a7b51e3503acc6a39b3784ffb84300","pluginVersion":"1.6.0"}},"description":"Display a promotional banner","enabled":true,"validity":[{"from":42,"until":42}]}]' /1/indexes/{indexName}/rules/clear: post: tags: @@ -17022,7 +17022,7 @@ components: - $ref: '#/components/schemas/aroundPrecisionFromValue' x-categories: - Geo-Search - insideBoundingBox: + insideBoundingBoxArray: type: array items: type: array @@ -17057,6 +17057,11 @@ components: - 1.9916 x-categories: - Geo-Search + insideBoundingBox: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/insideBoundingBoxArray' insidePolygon: type: array items: @@ -17626,6 +17631,58 @@ components: items: type: string - type: 'null' + optionalWordsArray: + type: array + items: + type: string + example: + - blue + - iphone case + description: > + 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). + default: [] + x-categories: + - Query strategy + optionalWords: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/optionalWordsArray' exactOnSingleWordQuery: type: string enum: @@ -17709,15 +17766,6 @@ components: default: 0 x-categories: - Advanced - maxFacetHits: - type: integer - description: >- - 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 - default: 10 - x-categories: - - Advanced order: description: > Explicit order of facets or facet values. @@ -18268,52 +18316,7 @@ components: x-categories: - Query strategy optionalWords: - type: array - items: - type: string - example: - - blue - - iphone case - description: > - 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). - default: [] - x-categories: - - Query strategy + $ref: '#/components/schemas/optionalWords' disableExactOnAttributes: type: array items: @@ -18475,8 +18478,6 @@ components: - '*' x-categories: - Advanced - maxFacetHits: - $ref: '#/components/schemas/maxFacetHits' maxValuesPerFacet: type: integer description: Maximum number of facet values to return for each facet. @@ -19087,6 +19088,15 @@ components: description: Text to search inside the facet's values. example: george default: '' + maxFacetHits: + type: integer + description: >- + 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 + default: 10 + x-categories: + - Advanced searchTypeFacet: type: string enum: @@ -19754,6 +19764,8 @@ components: accurate facet counts. example: url type: string + maxFacetHits: + $ref: '#/components/schemas/maxFacetHits' indexSettings: description: Index settings. allOf: diff --git a/specs/bundled/search.yml b/specs/bundled/search.yml index 2672cf8d2d..57e1523013 100644 --- a/specs/bundled/search.yml +++ b/specs/bundled/search.yml @@ -4035,7 +4035,7 @@ components: - $ref: '#/components/schemas/aroundPrecisionFromValue' x-categories: - Geo-Search - insideBoundingBox: + insideBoundingBoxArray: type: array items: type: array @@ -4070,6 +4070,11 @@ components: - 1.9916 x-categories: - Geo-Search + insideBoundingBox: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/insideBoundingBoxArray' insidePolygon: type: array items: @@ -4639,6 +4644,58 @@ components: items: type: string - type: 'null' + optionalWordsArray: + type: array + items: + type: string + example: + - blue + - iphone case + description: > + 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). + default: [] + x-categories: + - Query strategy + optionalWords: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/optionalWordsArray' exactOnSingleWordQuery: type: string enum: @@ -4722,15 +4779,6 @@ components: default: 0 x-categories: - Advanced - maxFacetHits: - type: integer - description: >- - 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 - default: 10 - x-categories: - - Advanced order: description: > Explicit order of facets or facet values. @@ -5281,52 +5329,7 @@ components: x-categories: - Query strategy optionalWords: - type: array - items: - type: string - example: - - blue - - iphone case - description: > - 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). - default: [] - x-categories: - - Query strategy + $ref: '#/components/schemas/optionalWords' disableExactOnAttributes: type: array items: @@ -5488,8 +5491,6 @@ components: - '*' x-categories: - Advanced - maxFacetHits: - $ref: '#/components/schemas/maxFacetHits' maxValuesPerFacet: type: integer description: Maximum number of facet values to return for each facet. @@ -6100,6 +6101,15 @@ components: description: Text to search inside the facet's values. example: george default: '' + maxFacetHits: + type: integer + description: >- + 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 + default: 10 + x-categories: + - Advanced searchTypeFacet: type: string enum: @@ -6767,6 +6777,8 @@ components: accurate facet counts. example: url type: string + maxFacetHits: + $ref: '#/components/schemas/maxFacetHits' indexSettings: description: Index settings. allOf: diff --git a/tests/output/csharp/src/generated/client/Search.test.cs b/tests/output/csharp/src/generated/client/Search.test.cs index 0e28b58230..635586c3d1 100644 --- a/tests/output/csharp/src/generated/client/Search.test.cs +++ b/tests/output/csharp/src/generated/client/Search.test.cs @@ -312,7 +312,7 @@ public async Task GenerateSecuredApiKeyTest1() AroundRadius = new AroundRadius(Enum.Parse("All")), Mode = Enum.Parse("NeuralSearch"), HitsPerPage = 10, - OptionalWords = new List { "one", "two" }, + OptionalWords = new OptionalWords(new List { "one", "two" }), }, } ); diff --git a/tests/output/csharp/src/generated/requests/Search.test.cs b/tests/output/csharp/src/generated/requests/Search.test.cs index 9a06015d03..a0d92d3ba1 100644 --- a/tests/output/csharp/src/generated/requests/Search.test.cs +++ b/tests/output/csharp/src/generated/requests/Search.test.cs @@ -2723,11 +2723,13 @@ await client.SearchAsync( HitsPerPage = 1, IgnorePlurals = new IgnorePlurals(false), IndexName = "theIndexName", - InsideBoundingBox = new List> - { - new List { 47.3165, 4.9665, 47.3424, 5.0201 }, - new List { 40.9234, 2.1185, 38.643, 1.9916 }, - }, + InsideBoundingBox = new InsideBoundingBox( + new List> + { + new List { 47.3165, 4.9665, 47.3424, 5.0201 }, + new List { 40.9234, 2.1185, 38.643, 1.9916 }, + } + ), InsidePolygon = new List> { new List { 47.3165, 4.9665, 47.3424, 5.0201, 47.32, 4.9 }, @@ -2751,7 +2753,7 @@ await client.SearchAsync( OptionalFilters = new OptionalFilters( new List { new OptionalFilters("") } ), - OptionalWords = new List { "" }, + OptionalWords = new OptionalWords(new List { "" }), Page = 0, PercentileComputation = true, PersonalizationImpact = 0, @@ -3463,7 +3465,7 @@ await client.SetSettingsAsync( MinWordSizefor2Typos = 11, Mode = Enum.Parse("NeuralSearch"), NumericAttributesForFiltering = new List { "algolia" }, - OptionalWords = new List { "myspace" }, + OptionalWords = new OptionalWords(new List { "myspace" }), PaginationLimitedTo = 0, QueryLanguages = new List { Enum.Parse("Fr") }, QueryType = Enum.Parse("PrefixLast"), diff --git a/tests/output/go/tests/client/search_test.go b/tests/output/go/tests/client/search_test.go index b117c4cedb..e92093436f 100644 --- a/tests/output/go/tests/client/search_test.go +++ b/tests/output/go/tests/client/search_test.go @@ -310,8 +310,8 @@ func TestSearchgenerateSecuredApiKey1(t *testing.T) { "2640659426d5107b6e47d75db9cbaef8", search.NewEmptySecuredApiKeyRestrictions().SetValidUntil(2524604400).SetRestrictIndices( []string{"Movies", "cts_e2e_settings"}).SetRestrictSources("192.168.1.0/24").SetFilters("category:Book OR category:Ebook AND _tags:published").SetUserToken("user123").SetSearchParams( - search.NewEmptySearchParamsObject().SetQuery("batman").SetTypoTolerance(search.TypoToleranceEnumAsTypoTolerance(search.TypoToleranceEnum("strict"))).SetAroundRadius(search.AroundRadiusAllAsAroundRadius(search.AroundRadiusAll("all"))).SetMode(search.Mode("neuralSearch")).SetHitsPerPage(10).SetOptionalWords( - []string{"one", "two"})), + search.NewEmptySearchParamsObject().SetQuery("batman").SetTypoTolerance(search.TypoToleranceEnumAsTypoTolerance(search.TypoToleranceEnum("strict"))).SetAroundRadius(search.AroundRadiusAllAsAroundRadius(search.AroundRadiusAll("all"))).SetMode(search.Mode("neuralSearch")).SetHitsPerPage(10).SetOptionalWords(search.ArrayOfStringAsOptionalWords( + []string{"one", "two"}))), ) require.NoError(t, err) require.Equal(t, "MzAxMDUwYjYyODMxODQ3ZWM1ZDYzNTkxZmNjNDg2OGZjMjAzYjQyOTZhMGQ1NDJhMDFiNGMzYTYzODRhNmMxZWFyb3VuZFJhZGl1cz1hbGwmZmlsdGVycz1jYXRlZ29yeSUzQUJvb2slMjBPUiUyMGNhdGVnb3J5JTNBRWJvb2slMjBBTkQlMjBfdGFncyUzQXB1Ymxpc2hlZCZoaXRzUGVyUGFnZT0xMCZtb2RlPW5ldXJhbFNlYXJjaCZvcHRpb25hbFdvcmRzPW9uZSUyQ3R3byZxdWVyeT1iYXRtYW4mcmVzdHJpY3RJbmRpY2VzPU1vdmllcyUyQ2N0c19lMmVfc2V0dGluZ3MmcmVzdHJpY3RTb3VyY2VzPTE5Mi4xNjguMS4wJTJGMjQmdHlwb1RvbGVyYW5jZT1zdHJpY3QmdXNlclRva2VuPXVzZXIxMjMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw", res) diff --git a/tests/output/go/tests/requests/search_test.go b/tests/output/go/tests/requests/search_test.go index 3056e3e31c..58f9d5091f 100644 --- a/tests/output/go/tests/requests/search_test.go +++ b/tests/output/go/tests/requests/search_test.go @@ -1923,17 +1923,17 @@ func TestSearch_Search(t *testing.T) { []string{""}).SetDisableTypoToleranceOnAttributes( []string{""}).SetDistinct(search.Int32AsDistinct(0)).SetEnableABTest(true).SetEnablePersonalization(true).SetEnableReRanking(true).SetEnableRules(true).SetExactOnSingleWordQuery(search.ExactOnSingleWordQuery("attribute")).SetFacetFilters(search.ArrayOfFacetFiltersAsFacetFilters( []search.FacetFilters{*search.StringAsFacetFilters("")})).SetFacetingAfterDistinct(true).SetFacets( - []string{""}).SetFilters("").SetGetRankingInfo(true).SetHighlightPostTag("").SetHighlightPreTag("").SetHitsPerPage(1).SetIgnorePlurals(search.BoolAsIgnorePlurals(false)).SetIndexName("theIndexName").SetInsideBoundingBox( + []string{""}).SetFilters("").SetGetRankingInfo(true).SetHighlightPostTag("").SetHighlightPreTag("").SetHitsPerPage(1).SetIgnorePlurals(search.BoolAsIgnorePlurals(false)).SetIndexName("theIndexName").SetInsideBoundingBox(search.ArrayOfArrayOfFloat64AsInsideBoundingBox( [][]float64{ []float64{47.3165, 4.9665, 47.3424, 5.0201}, - []float64{40.9234, 2.1185, 38.643, 1.9916}}).SetInsidePolygon( + []float64{40.9234, 2.1185, 38.643, 1.9916}})).SetInsidePolygon( [][]float64{ []float64{47.3165, 4.9665, 47.3424, 5.0201, 47.32, 4.9}, []float64{40.9234, 2.1185, 38.643, 1.9916, 39.2587, 2.0104}}).SetKeepDiacriticsOnCharacters("").SetLength(1).SetMaxValuesPerFacet(0).SetMinProximity(1).SetMinWordSizefor1Typo(0).SetMinWordSizefor2Typos(0).SetMinimumAroundRadius(1).SetNaturalLanguages( []search.SupportedLanguage{search.SupportedLanguage("fr")}).SetNumericFilters(search.ArrayOfNumericFiltersAsNumericFilters( []search.NumericFilters{*search.StringAsNumericFilters("")})).SetOffset(0).SetOptionalFilters(search.ArrayOfOptionalFiltersAsOptionalFilters( - []search.OptionalFilters{*search.StringAsOptionalFilters("")})).SetOptionalWords( - []string{""}).SetPage(0).SetPercentileComputation(true).SetPersonalizationImpact(0).SetQuery("").SetQueryLanguages( + []search.OptionalFilters{*search.StringAsOptionalFilters("")})).SetOptionalWords(search.ArrayOfStringAsOptionalWords( + []string{""})).SetPage(0).SetPercentileComputation(true).SetPersonalizationImpact(0).SetQuery("").SetQueryLanguages( []search.SupportedLanguage{search.SupportedLanguage("fr")}).SetQueryType(search.QueryType("prefixAll")).SetRanking( []string{""}).SetReRankingApplyFilter(search.ArrayOfReRankingApplyFilterAsReRankingApplyFilter( []search.ReRankingApplyFilter{*search.StringAsReRankingApplyFilter("")})).SetRelevancyStrictness(0).SetRemoveStopWords(search.BoolAsRemoveStopWords(true)).SetRemoveWordsIfNoResults(search.RemoveWordsIfNoResults("allOptional")).SetRenderingContent( @@ -2391,8 +2391,8 @@ func TestSearch_SetSettings(t *testing.T) { []string{"algolia"}).SetDisableTypoToleranceOnWords( []string{"algolia"}).SetDistinct(search.Int32AsDistinct(3)).SetEnablePersonalization(true).SetEnableReRanking(false).SetEnableRules(true).SetExactOnSingleWordQuery(search.ExactOnSingleWordQuery("attribute")).SetHighlightPreTag("").SetHighlightPostTag("").SetHitsPerPage(10).SetIgnorePlurals(search.BoolAsIgnorePlurals(false)).SetIndexLanguages( []search.SupportedLanguage{search.SupportedLanguage("fr")}).SetKeepDiacriticsOnCharacters("abc").SetMaxFacetHits(20).SetMaxValuesPerFacet(30).SetMinProximity(6).SetMinWordSizefor1Typo(5).SetMinWordSizefor2Typos(11).SetMode(search.Mode("neuralSearch")).SetNumericAttributesForFiltering( - []string{"algolia"}).SetOptionalWords( - []string{"myspace"}).SetPaginationLimitedTo(0).SetQueryLanguages( + []string{"algolia"}).SetOptionalWords(search.ArrayOfStringAsOptionalWords( + []string{"myspace"})).SetPaginationLimitedTo(0).SetQueryLanguages( []search.SupportedLanguage{search.SupportedLanguage("fr")}).SetQueryType(search.QueryType("prefixLast")).SetRanking( []string{"geo"}).SetReRankingApplyFilter(search.StringAsReRankingApplyFilter("mySearch:filters")).SetRelevancyStrictness(10).SetRemoveStopWords(search.BoolAsRemoveStopWords(false)).SetRemoveWordsIfNoResults(search.RemoveWordsIfNoResults("lastWords")).SetRenderingContent( search.NewEmptyRenderingContent().SetFacetOrdering( diff --git a/tests/output/java/src/test/java/com/algolia/client/Search.test.java b/tests/output/java/src/test/java/com/algolia/client/Search.test.java index 0f7d705f03..9448dfa53e 100644 --- a/tests/output/java/src/test/java/com/algolia/client/Search.test.java +++ b/tests/output/java/src/test/java/com/algolia/client/Search.test.java @@ -304,7 +304,7 @@ void generateSecuredApiKeyTest1() { .setAroundRadius(AroundRadiusAll.ALL) .setMode(Mode.NEURAL_SEARCH) .setHitsPerPage(10) - .setOptionalWords(Arrays.asList("one", "two")) + .setOptionalWords(OptionalWords.of(Arrays.asList("one", "two"))) ) ); diff --git a/tests/output/java/src/test/java/com/algolia/requests/Search.test.java b/tests/output/java/src/test/java/com/algolia/requests/Search.test.java index 3ccdda64f5..34b870f6e7 100644 --- a/tests/output/java/src/test/java/com/algolia/requests/Search.test.java +++ b/tests/output/java/src/test/java/com/algolia/requests/Search.test.java @@ -2781,7 +2781,9 @@ void searchTest15() { .setIgnorePlurals(IgnorePlurals.of(false)) .setIndexName("theIndexName") .setInsideBoundingBox( - Arrays.asList(Arrays.asList(47.3165, 4.9665, 47.3424, 5.0201), Arrays.asList(40.9234, 2.1185, 38.643, 1.9916)) + InsideBoundingBox.of( + Arrays.asList(Arrays.asList(47.3165, 4.9665, 47.3424, 5.0201), Arrays.asList(40.9234, 2.1185, 38.643, 1.9916)) + ) ) .setInsidePolygon( Arrays.asList( @@ -2800,7 +2802,7 @@ void searchTest15() { .setNumericFilters(NumericFilters.of(Arrays.asList(NumericFilters.of("")))) .setOffset(0) .setOptionalFilters(OptionalFilters.of(Arrays.asList(OptionalFilters.of("")))) - .setOptionalWords(Arrays.asList("")) + .setOptionalWords(OptionalWords.of(Arrays.asList(""))) .setPage(0) .setPercentileComputation(true) .setPersonalizationImpact(0) @@ -3461,7 +3463,7 @@ void setSettingsTest10() { .setMinWordSizefor2Typos(11) .setMode(Mode.NEURAL_SEARCH) .setNumericAttributesForFiltering(Arrays.asList("algolia")) - .setOptionalWords(Arrays.asList("myspace")) + .setOptionalWords(OptionalWords.of(Arrays.asList("myspace"))) .setPaginationLimitedTo(0) .setQueryLanguages(Arrays.asList(SupportedLanguage.FR)) .setQueryType(QueryType.PREFIX_LAST) diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/SearchTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/SearchTest.kt index f2a9c94f7b..f06f608a3c 100644 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/SearchTest.kt +++ b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/SearchTest.kt @@ -238,7 +238,7 @@ class SearchTest { aroundRadius = AroundRadiusAll.entries.first { it.value == "all" }, mode = Mode.entries.first { it.value == "neuralSearch" }, hitsPerPage = 10, - optionalWords = listOf("one", "two"), + optionalWords = OptionalWords.of(listOf("one", "two")), ), ), ) diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/requests/SearchTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/requests/SearchTest.kt index 0c8d059ebd..f28ba50807 100644 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/requests/SearchTest.kt +++ b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/requests/SearchTest.kt @@ -2644,7 +2644,7 @@ class SearchTest { hitsPerPage = 1, ignorePlurals = IgnorePlurals.of(false), indexName = "theIndexName", - insideBoundingBox = listOf(listOf(47.3165, 4.9665, 47.3424, 5.0201), listOf(40.9234, 2.1185, 38.643, 1.9916)), + insideBoundingBox = InsideBoundingBox.of(listOf(listOf(47.3165, 4.9665, 47.3424, 5.0201), listOf(40.9234, 2.1185, 38.643, 1.9916))), insidePolygon = listOf(listOf(47.3165, 4.9665, 47.3424, 5.0201, 47.32, 4.9), listOf(40.9234, 2.1185, 38.643, 1.9916, 39.2587, 2.0104)), keepDiacriticsOnCharacters = "", length = 1, @@ -2657,7 +2657,7 @@ class SearchTest { numericFilters = NumericFilters.of(listOf(NumericFilters.of(""))), offset = 0, optionalFilters = OptionalFilters.of(listOf(OptionalFilters.of(""))), - optionalWords = listOf(""), + optionalWords = OptionalWords.of(listOf("")), page = 0, percentileComputation = true, personalizationImpact = 0, @@ -3257,7 +3257,7 @@ class SearchTest { minWordSizefor2Typos = 11, mode = Mode.entries.first { it.value == "neuralSearch" }, numericAttributesForFiltering = listOf("algolia"), - optionalWords = listOf("myspace"), + optionalWords = OptionalWords.of(listOf("myspace")), paginationLimitedTo = 0, queryLanguages = listOf(SupportedLanguage.entries.first { it.value == "fr" }), queryType = QueryType.entries.first { it.value == "prefixLast" }, diff --git a/tests/output/scala/src/test/scala/algoliasearch/requests/SearchTest.scala b/tests/output/scala/src/test/scala/algoliasearch/requests/SearchTest.scala index 1f7a4a6a96..cb6518c9fc 100644 --- a/tests/output/scala/src/test/scala/algoliasearch/requests/SearchTest.scala +++ b/tests/output/scala/src/test/scala/algoliasearch/requests/SearchTest.scala @@ -2641,7 +2641,8 @@ class SearchTest extends AnyFunSuite { hitsPerPage = Some(1), ignorePlurals = Some(IgnorePlurals(false)), indexName = "theIndexName", - insideBoundingBox = Some(Seq(Seq(47.3165, 4.9665, 47.3424, 5.0201), Seq(40.9234, 2.1185, 38.643, 1.9916))), + insideBoundingBox = + Some(InsideBoundingBox(Seq(Seq(47.3165, 4.9665, 47.3424, 5.0201), Seq(40.9234, 2.1185, 38.643, 1.9916)))), insidePolygon = Some( Seq( Seq(47.3165, 4.9665, 47.3424, 5.0201, 47.32, 4.9), @@ -2659,7 +2660,7 @@ class SearchTest extends AnyFunSuite { numericFilters = Some(NumericFilters(Seq(NumericFilters("")))), offset = Some(0), optionalFilters = Some(OptionalFilters(Seq(OptionalFilters("")))), - optionalWords = Some(Seq("")), + optionalWords = Some(OptionalWords(Seq(""))), page = Some(0), percentileComputation = Some(true), personalizationImpact = Some(0), @@ -3315,7 +3316,7 @@ class SearchTest extends AnyFunSuite { minWordSizefor2Typos = Some(11), mode = Some(Mode.withName("neuralSearch")), numericAttributesForFiltering = Some(Seq("algolia")), - optionalWords = Some(Seq("myspace")), + optionalWords = Some(OptionalWords(Seq("myspace"))), paginationLimitedTo = Some(0), queryLanguages = Some(Seq(SupportedLanguage.withName("fr"))), queryType = Some(QueryType.withName("prefixLast")), diff --git a/tests/output/swift/Tests/client/SearchTests.swift b/tests/output/swift/Tests/client/SearchTests.swift index 955bec3745..d11f50e21c 100644 --- a/tests/output/swift/Tests/client/SearchTests.swift +++ b/tests/output/swift/Tests/client/SearchTests.swift @@ -258,7 +258,7 @@ final class SearchClientClientTests: XCTestCase { hitsPerPage: 10, typoTolerance: SearchTypoTolerance.searchTypoToleranceEnum(SearchTypoToleranceEnum.strict), mode: SearchMode.neuralSearch, - optionalWords: ["one", "two"] + optionalWords: SearchOptionalWords.arrayOfString(["one", "two"]) ), filters: "category:Book OR category:Ebook AND _tags:published", validUntil: Int64(2_524_604_400), diff --git a/tests/output/swift/Tests/requests/SearchTests.swift b/tests/output/swift/Tests/requests/SearchTests.swift index f9d042dd6f..ebb5534966 100644 --- a/tests/output/swift/Tests/requests/SearchTests.swift +++ b/tests/output/swift/Tests/requests/SearchTests.swift @@ -3257,10 +3257,10 @@ final class SearchClientRequestsTests: XCTestCase { .searchWithHTTPInfo(searchMethodParams: SearchMethodParams( requests: [SearchQuery.searchForFacets(SearchForFacets( query: "theQuery", - maxFacetHits: 50, facet: "theFacet", indexName: "theIndexName", facetQuery: "theFacetQuery", + maxFacetHits: 50, type: SearchTypeFacet.facet ))], strategy: SearchStrategy.stopIfEnoughMatches @@ -3341,10 +3341,10 @@ final class SearchClientRequestsTests: XCTestCase { .searchWithHTTPInfo(searchMethodParams: SearchMethodParams( requests: [SearchQuery.searchForFacets(SearchForFacets( query: "theQuery", - maxFacetHits: 50, facet: "theFacet", indexName: "theIndexName", facetQuery: "theFacetQuery", + maxFacetHits: 50, type: SearchTypeFacet.facet )), SearchQuery.searchForHits(SearchForHits( query: "myQuery", @@ -3537,7 +3537,10 @@ final class SearchClientRequestsTests: XCTestCase { aroundRadius: SearchAroundRadius.searchAroundRadiusAll(SearchAroundRadiusAll.all), aroundPrecision: SearchAroundPrecision.int(0), minimumAroundRadius: 1, - insideBoundingBox: [[47.3165, 4.9665, 47.3424, 5.0201], [40.9234, 2.1185, 38.643, 1.9916]], + insideBoundingBox: SearchInsideBoundingBox.arrayOfArrayOfDouble([ + [47.3165, 4.9665, 47.3424, 5.0201], + [40.9234, 2.1185, 38.643, 1.9916], + ]), insidePolygon: [ [47.3165, 4.9665, 47.3424, 5.0201, 47.32, 4.9], [40.9234, 2.1185, 38.643, 1.9916, 39.2587, 2.0104], @@ -3579,7 +3582,7 @@ final class SearchClientRequestsTests: XCTestCase { queryType: SearchQueryType.prefixAll, removeWordsIfNoResults: SearchRemoveWordsIfNoResults.allOptional, advancedSyntax: true, - optionalWords: [""], + optionalWords: SearchOptionalWords.arrayOfString([""]), disableExactOnAttributes: [""], exactOnSingleWordQuery: SearchExactOnSingleWordQuery.attribute, alternativesAsExact: [SearchAlternativesAsExact.multiWordsSynonym], @@ -4480,6 +4483,7 @@ final class SearchClientRequestsTests: XCTestCase { userData: ["user": "data"], customNormalization: ["algolia": ["aloglia": "aglolia"]], attributeForDistinct: "test", + maxFacetHits: 20, attributesToRetrieve: ["algolia"], ranking: ["geo"], customRanking: ["algolia"], @@ -4508,7 +4512,7 @@ final class SearchClientRequestsTests: XCTestCase { mode: SearchMode.neuralSearch, semanticSearch: SearchSemanticSearch(eventSources: ["foo"]), advancedSyntax: true, - optionalWords: ["myspace"], + optionalWords: SearchOptionalWords.arrayOfString(["myspace"]), disableExactOnAttributes: ["algolia"], exactOnSingleWordQuery: SearchExactOnSingleWordQuery.attribute, alternativesAsExact: [SearchAlternativesAsExact.singleWordSynonym], @@ -4517,7 +4521,6 @@ final class SearchClientRequestsTests: XCTestCase { replaceSynonymsInHighlight: true, minProximity: 6, responseFields: ["algolia"], - maxFacetHits: 20, maxValuesPerFacet: 30, sortFacetValuesBy: "date", attributeCriteriaComputedByMinProximity: true,