From 5bdc106feea08b61a5f9e8c6aeee9fe538873e21 Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Fri, 15 Nov 2024 14:47:25 +0000 Subject: [PATCH] fix(specs): make the searchParams compatible with v4 [skip-bc] (generated) https://github.com/algolia/api-clients-automation/pull/4108 Co-authored-by: algolia-bot Co-authored-by: Pierre Millot --- .../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 ++---- 24 files changed, 347 insertions(+), 284 deletions(-) create mode 100644 src/main/scala/algoliasearch/recommend/InsideBoundingBox.scala create mode 100644 src/main/scala/algoliasearch/recommend/OptionalWords.scala create mode 100644 src/main/scala/algoliasearch/search/InsideBoundingBox.scala create mode 100644 src/main/scala/algoliasearch/search/OptionalWords.scala diff --git a/src/main/scala/algoliasearch/recommend/BaseIndexSettings.scala b/src/main/scala/algoliasearch/recommend/BaseIndexSettings.scala index a5c88461..e89b07b4 100644 --- a/src/main/scala/algoliasearch/recommend/BaseIndexSettings.scala +++ b/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/src/main/scala/algoliasearch/recommend/BaseRecommendIndexSettings.scala b/src/main/scala/algoliasearch/recommend/BaseRecommendIndexSettings.scala index c4e428b6..304535c8 100644 --- a/src/main/scala/algoliasearch/recommend/BaseRecommendIndexSettings.scala +++ b/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/src/main/scala/algoliasearch/recommend/BaseRecommendSearchParams.scala b/src/main/scala/algoliasearch/recommend/BaseRecommendSearchParams.scala index 3e5aba1a..dfb58d03 100644 --- a/src/main/scala/algoliasearch/recommend/BaseRecommendSearchParams.scala +++ b/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/src/main/scala/algoliasearch/recommend/FallbackParams.scala b/src/main/scala/algoliasearch/recommend/FallbackParams.scala index 73fdec39..edf18bfe 100644 --- a/src/main/scala/algoliasearch/recommend/FallbackParams.scala +++ b/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/src/main/scala/algoliasearch/recommend/InsideBoundingBox.scala b/src/main/scala/algoliasearch/recommend/InsideBoundingBox.scala new file mode 100644 index 00000000..5dc852e9 --- /dev/null +++ b/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/src/main/scala/algoliasearch/recommend/JsonSupport.scala b/src/main/scala/algoliasearch/recommend/JsonSupport.scala index 248fe978..c747a930 100644 --- a/src/main/scala/algoliasearch/recommend/JsonSupport.scala +++ b/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/src/main/scala/algoliasearch/recommend/OptionalWords.scala b/src/main/scala/algoliasearch/recommend/OptionalWords.scala new file mode 100644 index 00000000..ba09f86b --- /dev/null +++ b/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/src/main/scala/algoliasearch/recommend/RecommendIndexSettings.scala b/src/main/scala/algoliasearch/recommend/RecommendIndexSettings.scala index 78366649..fc05c1c0 100644 --- a/src/main/scala/algoliasearch/recommend/RecommendIndexSettings.scala +++ b/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/src/main/scala/algoliasearch/recommend/RecommendSearchParams.scala b/src/main/scala/algoliasearch/recommend/RecommendSearchParams.scala index dbfe5370..98659acd 100644 --- a/src/main/scala/algoliasearch/recommend/RecommendSearchParams.scala +++ b/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/src/main/scala/algoliasearch/search/BaseIndexSettings.scala b/src/main/scala/algoliasearch/search/BaseIndexSettings.scala index 6a8ce8dd..9a34e777 100644 --- a/src/main/scala/algoliasearch/search/BaseIndexSettings.scala +++ b/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/src/main/scala/algoliasearch/search/BaseSearchParams.scala b/src/main/scala/algoliasearch/search/BaseSearchParams.scala index 12830d38..2fb1fb1f 100644 --- a/src/main/scala/algoliasearch/search/BaseSearchParams.scala +++ b/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/src/main/scala/algoliasearch/search/BaseSearchParamsWithoutQuery.scala b/src/main/scala/algoliasearch/search/BaseSearchParamsWithoutQuery.scala index 703ff845..6e7735fc 100644 --- a/src/main/scala/algoliasearch/search/BaseSearchParamsWithoutQuery.scala +++ b/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/src/main/scala/algoliasearch/search/BrowseParamsObject.scala b/src/main/scala/algoliasearch/search/BrowseParamsObject.scala index 1745c58b..88cf02d8 100644 --- a/src/main/scala/algoliasearch/search/BrowseParamsObject.scala +++ b/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/src/main/scala/algoliasearch/search/ConsequenceParams.scala b/src/main/scala/algoliasearch/search/ConsequenceParams.scala index 55d99a0d..5146e004 100644 --- a/src/main/scala/algoliasearch/search/ConsequenceParams.scala +++ b/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/src/main/scala/algoliasearch/search/DeleteByParams.scala b/src/main/scala/algoliasearch/search/DeleteByParams.scala index b9ce76cd..657373a3 100644 --- a/src/main/scala/algoliasearch/search/DeleteByParams.scala +++ b/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/src/main/scala/algoliasearch/search/IndexSettings.scala b/src/main/scala/algoliasearch/search/IndexSettings.scala index 834e36a4..ab880539 100644 --- a/src/main/scala/algoliasearch/search/IndexSettings.scala +++ b/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/src/main/scala/algoliasearch/search/IndexSettingsAsSearchParams.scala b/src/main/scala/algoliasearch/search/IndexSettingsAsSearchParams.scala index 1f280ff4..37e5dce5 100644 --- a/src/main/scala/algoliasearch/search/IndexSettingsAsSearchParams.scala +++ b/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/src/main/scala/algoliasearch/search/InsideBoundingBox.scala b/src/main/scala/algoliasearch/search/InsideBoundingBox.scala new file mode 100644 index 00000000..69eb7682 --- /dev/null +++ b/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/src/main/scala/algoliasearch/search/JsonSupport.scala b/src/main/scala/algoliasearch/search/JsonSupport.scala index 898127cb..9a6cd363 100644 --- a/src/main/scala/algoliasearch/search/JsonSupport.scala +++ b/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/src/main/scala/algoliasearch/search/OptionalWords.scala b/src/main/scala/algoliasearch/search/OptionalWords.scala new file mode 100644 index 00000000..ead19cd8 --- /dev/null +++ b/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/src/main/scala/algoliasearch/search/SearchForFacets.scala b/src/main/scala/algoliasearch/search/SearchForFacets.scala index 750f7cdf..027e4523 100644 --- a/src/main/scala/algoliasearch/search/SearchForFacets.scala +++ b/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/src/main/scala/algoliasearch/search/SearchForHits.scala b/src/main/scala/algoliasearch/search/SearchForHits.scala index da56b51c..d6ce3135 100644 --- a/src/main/scala/algoliasearch/search/SearchForHits.scala +++ b/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/src/main/scala/algoliasearch/search/SearchParamsObject.scala b/src/main/scala/algoliasearch/search/SearchParamsObject.scala index 8058d92a..5b394573 100644 --- a/src/main/scala/algoliasearch/search/SearchParamsObject.scala +++ b/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/src/main/scala/algoliasearch/search/SettingsResponse.scala b/src/main/scala/algoliasearch/search/SettingsResponse.scala index 1be035b6..807e5773 100644 --- a/src/main/scala/algoliasearch/search/SettingsResponse.scala +++ b/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,