From db1b3c7e2f687f3db25f5c08bcd33375b2ebf91a Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Fri, 15 Nov 2024 14:47:15 +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 --- .../client/extensions/SearchForHits.kt | 1 - .../client/model/recommend/FallbackParams.kt | 18 +++---- .../model/recommend/InsideBoundingBox.kt | 49 +++++++++++++++++++ .../client/model/recommend/OptionalWords.kt | 49 +++++++++++++++++++ .../model/recommend/RecommendSearchParams.kt | 18 +++---- .../client/model/search/BrowseParamsObject.kt | 14 ++---- .../client/model/search/ConsequenceParams.kt | 14 ++---- .../client/model/search/DeleteByParams.kt | 5 +- .../client/model/search/IndexSettings.kt | 13 +++-- .../client/model/search/InsideBoundingBox.kt | 49 +++++++++++++++++++ .../client/model/search/OptionalWords.kt | 49 +++++++++++++++++++ .../client/model/search/SearchForFacets.kt | 18 +++---- .../client/model/search/SearchForHits.kt | 14 ++---- .../client/model/search/SearchParamsObject.kt | 14 ++---- .../client/model/search/SettingsResponse.kt | 13 +++-- 15 files changed, 250 insertions(+), 88 deletions(-) create mode 100644 client/src/commonMain/kotlin/com/algolia/client/model/recommend/InsideBoundingBox.kt create mode 100644 client/src/commonMain/kotlin/com/algolia/client/model/recommend/OptionalWords.kt create mode 100644 client/src/commonMain/kotlin/com/algolia/client/model/search/InsideBoundingBox.kt create mode 100644 client/src/commonMain/kotlin/com/algolia/client/model/search/OptionalWords.kt diff --git a/client/src/commonMain/kotlin/com/algolia/client/extensions/SearchForHits.kt b/client/src/commonMain/kotlin/com/algolia/client/extensions/SearchForHits.kt index a5fe6eb6..bf981ef4 100644 --- a/client/src/commonMain/kotlin/com/algolia/client/extensions/SearchForHits.kt +++ b/client/src/commonMain/kotlin/com/algolia/client/extensions/SearchForHits.kt @@ -84,7 +84,6 @@ public fun SearchForHits.Companion.from( replaceSynonymsInHighlight = searchParamsObject.replaceSynonymsInHighlight, minProximity = searchParamsObject.minProximity, responseFields = searchParamsObject.responseFields, - maxFacetHits = searchParamsObject.maxFacetHits, maxValuesPerFacet = searchParamsObject.maxValuesPerFacet, sortFacetValuesBy = searchParamsObject.sortFacetValuesBy, attributeCriteriaComputedByMinProximity = searchParamsObject.attributeCriteriaComputedByMinProximity, diff --git a/client/src/commonMain/kotlin/com/algolia/client/model/recommend/FallbackParams.kt b/client/src/commonMain/kotlin/com/algolia/client/model/recommend/FallbackParams.kt index 38025abc..17ab76ba 100644 --- a/client/src/commonMain/kotlin/com/algolia/client/model/recommend/FallbackParams.kt +++ b/client/src/commonMain/kotlin/com/algolia/client/model/recommend/FallbackParams.kt @@ -22,7 +22,7 @@ import kotlinx.serialization.json.* * @param aroundRadius * @param aroundPrecision * @param minimumAroundRadius Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). + * @param insideBoundingBox * @param insidePolygon Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. * @param naturalLanguages ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. * @param ruleContexts Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. @@ -53,6 +53,7 @@ import kotlinx.serialization.json.* * @param userData An object with custom data. You can store up to 32kB as custom data. * @param customNormalization Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/). * @param attributeForDistinct Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. + * @param maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). * @param attributesToRetrieve Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. * @param ranking Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/). * @param relevancyStrictness Relevancy threshold below which less relevant results aren't included in the results. You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results. @@ -76,7 +77,7 @@ import kotlinx.serialization.json.* * @param queryType * @param removeWordsIfNoResults * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param optionalWords * @param disableExactOnAttributes Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -85,7 +86,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -135,8 +135,7 @@ public data class FallbackParams( /** Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. */ @SerialName(value = "minimumAroundRadius") val minimumAroundRadius: Int? = null, - /** Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, @@ -228,6 +227,9 @@ public data class FallbackParams( /** Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. */ @SerialName(value = "attributeForDistinct") val attributeForDistinct: String? = null, + /** Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). */ + @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, + /** Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. */ @SerialName(value = "attributesToRetrieve") val attributesToRetrieve: List? = null, @@ -292,8 +294,7 @@ public data class FallbackParams( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -317,9 +318,6 @@ public data class FallbackParams( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, diff --git a/client/src/commonMain/kotlin/com/algolia/client/model/recommend/InsideBoundingBox.kt b/client/src/commonMain/kotlin/com/algolia/client/model/recommend/InsideBoundingBox.kt new file mode 100644 index 00000000..3aa562bb --- /dev/null +++ b/client/src/commonMain/kotlin/com/algolia/client/model/recommend/InsideBoundingBox.kt @@ -0,0 +1,49 @@ +/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ +package com.algolia.client.model.recommend + +import com.algolia.client.exception.AlgoliaClientException +import com.algolia.client.extensions.internal.* +import kotlinx.serialization.* +import kotlinx.serialization.builtins.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* +import kotlinx.serialization.json.* +import kotlin.jvm.JvmInline + +/** + * InsideBoundingBox + * + * Implementations: + * - [List>] - *[InsideBoundingBox.of]* + * - [String] - *[InsideBoundingBox.of]* + */ +@Serializable(InsideBoundingBoxSerializer::class) +public sealed interface InsideBoundingBox { + @Serializable + @JvmInline + public value class StringValue(public val value: String) : InsideBoundingBox + + @Serializable + @JvmInline + public value class ListOfListOfDoubleValue(public val value: List>) : InsideBoundingBox + + public companion object { + + public fun of(value: String): InsideBoundingBox { + return StringValue(value) + } + public fun of(value: List>): InsideBoundingBox { + return ListOfListOfDoubleValue(value) + } + } +} + +internal class InsideBoundingBoxSerializer : JsonContentPolymorphicSerializer(InsideBoundingBox::class) { + override fun selectDeserializer(element: JsonElement): DeserializationStrategy { + return when { + element.isString -> InsideBoundingBox.StringValue.serializer() + element is JsonArray -> InsideBoundingBox.ListOfListOfDoubleValue.serializer() + else -> throw AlgoliaClientException("Failed to deserialize json element: $element") + } + } +} diff --git a/client/src/commonMain/kotlin/com/algolia/client/model/recommend/OptionalWords.kt b/client/src/commonMain/kotlin/com/algolia/client/model/recommend/OptionalWords.kt new file mode 100644 index 00000000..5a556707 --- /dev/null +++ b/client/src/commonMain/kotlin/com/algolia/client/model/recommend/OptionalWords.kt @@ -0,0 +1,49 @@ +/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ +package com.algolia.client.model.recommend + +import com.algolia.client.exception.AlgoliaClientException +import com.algolia.client.extensions.internal.* +import kotlinx.serialization.* +import kotlinx.serialization.builtins.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* +import kotlinx.serialization.json.* +import kotlin.jvm.JvmInline + +/** + * OptionalWords + * + * Implementations: + * - [List] - *[OptionalWords.of]* + * - [String] - *[OptionalWords.of]* + */ +@Serializable(OptionalWordsSerializer::class) +public sealed interface OptionalWords { + @Serializable + @JvmInline + public value class StringValue(public val value: String) : OptionalWords + + @Serializable + @JvmInline + public value class ListOfStringValue(public val value: List) : OptionalWords + + public companion object { + + public fun of(value: String): OptionalWords { + return StringValue(value) + } + public fun of(value: List): OptionalWords { + return ListOfStringValue(value) + } + } +} + +internal class OptionalWordsSerializer : JsonContentPolymorphicSerializer(OptionalWords::class) { + override fun selectDeserializer(element: JsonElement): DeserializationStrategy { + return when { + element.isString -> OptionalWords.StringValue.serializer() + element is JsonArray -> OptionalWords.ListOfStringValue.serializer() + else -> throw AlgoliaClientException("Failed to deserialize json element: $element") + } + } +} diff --git a/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendSearchParams.kt b/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendSearchParams.kt index 4bfed718..c455829f 100644 --- a/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendSearchParams.kt +++ b/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendSearchParams.kt @@ -22,7 +22,7 @@ import kotlinx.serialization.json.* * @param aroundRadius * @param aroundPrecision * @param minimumAroundRadius Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). + * @param insideBoundingBox * @param insidePolygon Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. * @param naturalLanguages ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. * @param ruleContexts Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. @@ -53,6 +53,7 @@ import kotlinx.serialization.json.* * @param userData An object with custom data. You can store up to 32kB as custom data. * @param customNormalization Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/). * @param attributeForDistinct Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. + * @param maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). * @param attributesToRetrieve Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. * @param ranking Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/). * @param relevancyStrictness Relevancy threshold below which less relevant results aren't included in the results. You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results. @@ -76,7 +77,7 @@ import kotlinx.serialization.json.* * @param queryType * @param removeWordsIfNoResults * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param optionalWords * @param disableExactOnAttributes Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -85,7 +86,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -135,8 +135,7 @@ public data class RecommendSearchParams( /** Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. */ @SerialName(value = "minimumAroundRadius") val minimumAroundRadius: Int? = null, - /** Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, @@ -228,6 +227,9 @@ public data class RecommendSearchParams( /** Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. */ @SerialName(value = "attributeForDistinct") val attributeForDistinct: String? = null, + /** Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). */ + @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, + /** Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. */ @SerialName(value = "attributesToRetrieve") val attributesToRetrieve: List? = null, @@ -292,8 +294,7 @@ public data class RecommendSearchParams( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -317,9 +318,6 @@ public data class RecommendSearchParams( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, diff --git a/client/src/commonMain/kotlin/com/algolia/client/model/search/BrowseParamsObject.kt b/client/src/commonMain/kotlin/com/algolia/client/model/search/BrowseParamsObject.kt index 5f8a9cdc..2089cc58 100644 --- a/client/src/commonMain/kotlin/com/algolia/client/model/search/BrowseParamsObject.kt +++ b/client/src/commonMain/kotlin/com/algolia/client/model/search/BrowseParamsObject.kt @@ -26,7 +26,7 @@ import kotlinx.serialization.json.* * @param aroundRadius * @param aroundPrecision * @param minimumAroundRadius Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). + * @param insideBoundingBox * @param insidePolygon Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. * @param naturalLanguages ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. * @param ruleContexts Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. @@ -67,7 +67,7 @@ import kotlinx.serialization.json.* * @param mode * @param semanticSearch * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param optionalWords * @param disableExactOnAttributes Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -76,7 +76,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -139,8 +138,7 @@ public data class BrowseParamsObject( /** Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. */ @SerialName(value = "minimumAroundRadius") val minimumAroundRadius: Int? = null, - /** Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, @@ -255,8 +253,7 @@ public data class BrowseParamsObject( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -280,9 +277,6 @@ public data class BrowseParamsObject( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, diff --git a/client/src/commonMain/kotlin/com/algolia/client/model/search/ConsequenceParams.kt b/client/src/commonMain/kotlin/com/algolia/client/model/search/ConsequenceParams.kt index 9b7caeaf..dac17110 100644 --- a/client/src/commonMain/kotlin/com/algolia/client/model/search/ConsequenceParams.kt +++ b/client/src/commonMain/kotlin/com/algolia/client/model/search/ConsequenceParams.kt @@ -25,7 +25,7 @@ import kotlinx.serialization.json.* * @param aroundRadius * @param aroundPrecision * @param minimumAroundRadius Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). + * @param insideBoundingBox * @param insidePolygon Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. * @param naturalLanguages ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. * @param ruleContexts Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. @@ -66,7 +66,7 @@ import kotlinx.serialization.json.* * @param mode * @param semanticSearch * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param optionalWords * @param disableExactOnAttributes Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -75,7 +75,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -137,8 +136,7 @@ public data class ConsequenceParams( /** Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. */ @SerialName(value = "minimumAroundRadius") val minimumAroundRadius: Int? = null, - /** Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, @@ -253,8 +251,7 @@ public data class ConsequenceParams( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -278,9 +275,6 @@ public data class ConsequenceParams( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, diff --git a/client/src/commonMain/kotlin/com/algolia/client/model/search/DeleteByParams.kt b/client/src/commonMain/kotlin/com/algolia/client/model/search/DeleteByParams.kt index 6b2431dc..178de8e8 100644 --- a/client/src/commonMain/kotlin/com/algolia/client/model/search/DeleteByParams.kt +++ b/client/src/commonMain/kotlin/com/algolia/client/model/search/DeleteByParams.kt @@ -13,7 +13,7 @@ import kotlinx.serialization.json.* * @param tagFilters * @param aroundLatLng Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within a circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`. * @param aroundRadius - * @param insideBoundingBox Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). + * @param insideBoundingBox * @param insidePolygon Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. */ @Serializable @@ -33,8 +33,7 @@ public data class DeleteByParams( @SerialName(value = "aroundRadius") val aroundRadius: AroundRadius? = null, - /** Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, diff --git a/client/src/commonMain/kotlin/com/algolia/client/model/search/IndexSettings.kt b/client/src/commonMain/kotlin/com/algolia/client/model/search/IndexSettings.kt index 7a0b1013..6af5f87f 100644 --- a/client/src/commonMain/kotlin/com/algolia/client/model/search/IndexSettings.kt +++ b/client/src/commonMain/kotlin/com/algolia/client/model/search/IndexSettings.kt @@ -24,6 +24,7 @@ import kotlinx.serialization.json.* * @param userData An object with custom data. You can store up to 32kB as custom data. * @param customNormalization Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/). * @param attributeForDistinct Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. + * @param maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). * @param attributesToRetrieve Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. * @param ranking Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/). * @param customRanking Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes, or the other attributes will never be applied. @@ -52,7 +53,7 @@ import kotlinx.serialization.json.* * @param mode * @param semanticSearch * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param optionalWords * @param disableExactOnAttributes Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -61,7 +62,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -123,6 +123,9 @@ public data class IndexSettings( /** Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. */ @SerialName(value = "attributeForDistinct") val attributeForDistinct: String? = null, + /** Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). */ + @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, + /** Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. */ @SerialName(value = "attributesToRetrieve") val attributesToRetrieve: List? = null, @@ -200,8 +203,7 @@ public data class IndexSettings( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -225,9 +227,6 @@ public data class IndexSettings( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, diff --git a/client/src/commonMain/kotlin/com/algolia/client/model/search/InsideBoundingBox.kt b/client/src/commonMain/kotlin/com/algolia/client/model/search/InsideBoundingBox.kt new file mode 100644 index 00000000..176a7187 --- /dev/null +++ b/client/src/commonMain/kotlin/com/algolia/client/model/search/InsideBoundingBox.kt @@ -0,0 +1,49 @@ +/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ +package com.algolia.client.model.search + +import com.algolia.client.exception.AlgoliaClientException +import com.algolia.client.extensions.internal.* +import kotlinx.serialization.* +import kotlinx.serialization.builtins.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* +import kotlinx.serialization.json.* +import kotlin.jvm.JvmInline + +/** + * InsideBoundingBox + * + * Implementations: + * - [List>] - *[InsideBoundingBox.of]* + * - [String] - *[InsideBoundingBox.of]* + */ +@Serializable(InsideBoundingBoxSerializer::class) +public sealed interface InsideBoundingBox { + @Serializable + @JvmInline + public value class StringValue(public val value: String) : InsideBoundingBox + + @Serializable + @JvmInline + public value class ListOfListOfDoubleValue(public val value: List>) : InsideBoundingBox + + public companion object { + + public fun of(value: String): InsideBoundingBox { + return StringValue(value) + } + public fun of(value: List>): InsideBoundingBox { + return ListOfListOfDoubleValue(value) + } + } +} + +internal class InsideBoundingBoxSerializer : JsonContentPolymorphicSerializer(InsideBoundingBox::class) { + override fun selectDeserializer(element: JsonElement): DeserializationStrategy { + return when { + element.isString -> InsideBoundingBox.StringValue.serializer() + element is JsonArray -> InsideBoundingBox.ListOfListOfDoubleValue.serializer() + else -> throw AlgoliaClientException("Failed to deserialize json element: $element") + } + } +} diff --git a/client/src/commonMain/kotlin/com/algolia/client/model/search/OptionalWords.kt b/client/src/commonMain/kotlin/com/algolia/client/model/search/OptionalWords.kt new file mode 100644 index 00000000..ed33ea11 --- /dev/null +++ b/client/src/commonMain/kotlin/com/algolia/client/model/search/OptionalWords.kt @@ -0,0 +1,49 @@ +/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ +package com.algolia.client.model.search + +import com.algolia.client.exception.AlgoliaClientException +import com.algolia.client.extensions.internal.* +import kotlinx.serialization.* +import kotlinx.serialization.builtins.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* +import kotlinx.serialization.json.* +import kotlin.jvm.JvmInline + +/** + * OptionalWords + * + * Implementations: + * - [List] - *[OptionalWords.of]* + * - [String] - *[OptionalWords.of]* + */ +@Serializable(OptionalWordsSerializer::class) +public sealed interface OptionalWords { + @Serializable + @JvmInline + public value class StringValue(public val value: String) : OptionalWords + + @Serializable + @JvmInline + public value class ListOfStringValue(public val value: List) : OptionalWords + + public companion object { + + public fun of(value: String): OptionalWords { + return StringValue(value) + } + public fun of(value: List): OptionalWords { + return ListOfStringValue(value) + } + } +} + +internal class OptionalWordsSerializer : JsonContentPolymorphicSerializer(OptionalWords::class) { + override fun selectDeserializer(element: JsonElement): DeserializationStrategy { + return when { + element.isString -> OptionalWords.StringValue.serializer() + element is JsonArray -> OptionalWords.ListOfStringValue.serializer() + else -> throw AlgoliaClientException("Failed to deserialize json element: $element") + } + } +} diff --git a/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForFacets.kt b/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForFacets.kt index 400f2198..87c44001 100644 --- a/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForFacets.kt +++ b/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForFacets.kt @@ -30,7 +30,7 @@ import kotlinx.serialization.json.* * @param aroundRadius * @param aroundPrecision * @param minimumAroundRadius Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). + * @param insideBoundingBox * @param insidePolygon Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. * @param naturalLanguages ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. * @param ruleContexts Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. @@ -71,7 +71,7 @@ import kotlinx.serialization.json.* * @param mode * @param semanticSearch * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param optionalWords * @param disableExactOnAttributes Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -80,7 +80,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -88,6 +87,7 @@ import kotlinx.serialization.json.* * @param enableReRanking Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. * @param reRankingApplyFilter * @param facetQuery Text to search inside the facet's values. + * @param maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). */ @Serializable public data class SearchForFacets( @@ -154,8 +154,7 @@ public data class SearchForFacets( /** Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. */ @SerialName(value = "minimumAroundRadius") val minimumAroundRadius: Int? = null, - /** Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, @@ -270,8 +269,7 @@ public data class SearchForFacets( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -295,9 +293,6 @@ public data class SearchForFacets( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, @@ -316,4 +311,7 @@ public data class SearchForFacets( /** Text to search inside the facet's values. */ @SerialName(value = "facetQuery") val facetQuery: String? = null, + + /** Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). */ + @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, ) : SearchQuery diff --git a/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForHits.kt b/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForHits.kt index a4c07a24..208d459a 100644 --- a/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForHits.kt +++ b/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchForHits.kt @@ -28,7 +28,7 @@ import kotlinx.serialization.json.* * @param aroundRadius * @param aroundPrecision * @param minimumAroundRadius Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). + * @param insideBoundingBox * @param insidePolygon Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. * @param naturalLanguages ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. * @param ruleContexts Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. @@ -69,7 +69,7 @@ import kotlinx.serialization.json.* * @param mode * @param semanticSearch * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param optionalWords * @param disableExactOnAttributes Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -78,7 +78,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -147,8 +146,7 @@ public data class SearchForHits( /** Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. */ @SerialName(value = "minimumAroundRadius") val minimumAroundRadius: Int? = null, - /** Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, @@ -263,8 +261,7 @@ public data class SearchForHits( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -288,9 +285,6 @@ public data class SearchForHits( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, diff --git a/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchParamsObject.kt b/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchParamsObject.kt index 4d8afa88..05ef8147 100644 --- a/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchParamsObject.kt +++ b/client/src/commonMain/kotlin/com/algolia/client/model/search/SearchParamsObject.kt @@ -26,7 +26,7 @@ import kotlinx.serialization.json.* * @param aroundRadius * @param aroundPrecision * @param minimumAroundRadius Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. - * @param insideBoundingBox Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). + * @param insideBoundingBox * @param insidePolygon Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. * @param naturalLanguages ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. * @param ruleContexts Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. @@ -67,7 +67,7 @@ import kotlinx.serialization.json.* * @param mode * @param semanticSearch * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param optionalWords * @param disableExactOnAttributes Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -76,7 +76,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -138,8 +137,7 @@ public data class SearchParamsObject( /** Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. */ @SerialName(value = "minimumAroundRadius") val minimumAroundRadius: Int? = null, - /** Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). */ - @SerialName(value = "insideBoundingBox") val insideBoundingBox: List>? = null, + @SerialName(value = "insideBoundingBox") val insideBoundingBox: InsideBoundingBox? = null, /** Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. */ @SerialName(value = "insidePolygon") val insidePolygon: List>? = null, @@ -254,8 +252,7 @@ public data class SearchParamsObject( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -279,9 +276,6 @@ public data class SearchParamsObject( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null, diff --git a/client/src/commonMain/kotlin/com/algolia/client/model/search/SettingsResponse.kt b/client/src/commonMain/kotlin/com/algolia/client/model/search/SettingsResponse.kt index 3947dd47..6dbd2bca 100644 --- a/client/src/commonMain/kotlin/com/algolia/client/model/search/SettingsResponse.kt +++ b/client/src/commonMain/kotlin/com/algolia/client/model/search/SettingsResponse.kt @@ -24,6 +24,7 @@ import kotlinx.serialization.json.* * @param userData An object with custom data. You can store up to 32kB as custom data. * @param customNormalization Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/). * @param attributeForDistinct Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. + * @param maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). * @param attributesToRetrieve Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. * @param ranking Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/). * @param customRanking Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes, or the other attributes will never be applied. @@ -52,7 +53,7 @@ import kotlinx.serialization.json.* * @param mode * @param semanticSearch * @param advancedSyntax Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. - * @param optionalWords Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + * @param optionalWords * @param disableExactOnAttributes Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. * @param exactOnSingleWordQuery * @param alternativesAsExact Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches. @@ -61,7 +62,6 @@ import kotlinx.serialization.json.* * @param replaceSynonymsInHighlight Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response. * @param minProximity Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score. * @param responseFields Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. - * @param maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). * @param maxValuesPerFacet Maximum number of facet values to return for each facet. * @param sortFacetValuesBy Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/). * @param attributeCriteriaComputedByMinProximity Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. @@ -124,6 +124,9 @@ public data class SettingsResponse( /** Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. */ @SerialName(value = "attributeForDistinct") val attributeForDistinct: String? = null, + /** Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). */ + @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, + /** Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included. */ @SerialName(value = "attributesToRetrieve") val attributesToRetrieve: List? = null, @@ -201,8 +204,7 @@ public data class SettingsResponse( /** Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported. */ @SerialName(value = "advancedSyntax") val advancedSyntax: Boolean? = null, - /** Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). */ - @SerialName(value = "optionalWords") val optionalWords: List? = null, + @SerialName(value = "optionalWords") val optionalWords: OptionalWords? = null, /** Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. */ @SerialName(value = "disableExactOnAttributes") val disableExactOnAttributes: List? = null, @@ -226,9 +228,6 @@ public data class SettingsResponse( /** Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI. */ @SerialName(value = "responseFields") val responseFields: List? = null, - /** Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). */ - @SerialName(value = "maxFacetHits") val maxFacetHits: Int? = null, - /** Maximum number of facet values to return for each facet. */ @SerialName(value = "maxValuesPerFacet") val maxValuesPerFacet: Int? = null,