From cbeeb93c3d44c9087ea65f31a49a17be7a0ca4c3 Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Fri, 15 Nov 2024 14:47:13 +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 --- packages/algoliasearch/builds/models.ts | 76 ++++++++++--------- .../lite/model/baseIndexSettings.ts | 5 ++ .../lite/model/baseRecommendIndexSettings.ts | 11 +-- .../lite/model/baseRecommendSearchParams.ts | 6 +- .../model/baseSearchParamsWithoutQuery.ts | 6 +- packages/algoliasearch/lite/model/index.ts | 2 + .../lite/model/indexSettingsAsSearchParams.ts | 11 +-- .../lite/model/insideBoundingBox.ts | 3 + .../algoliasearch/lite/model/optionalWords.ts | 3 + packages/client-composition/model/index.ts | 2 + .../model/insetsQueryParameters.ts | 6 +- .../model/insideBoundingBox.ts | 3 + .../client-composition/model/optionalWords.ts | 3 + packages/client-composition/model/params.ts | 6 +- .../client-search/model/baseIndexSettings.ts | 5 ++ .../model/baseSearchParamsWithoutQuery.ts | 6 +- .../client-search/model/deleteByParams.ts | 6 +- packages/client-search/model/index.ts | 2 + .../model/indexSettingsAsSearchParams.ts | 11 +-- .../client-search/model/insideBoundingBox.ts | 3 + packages/client-search/model/optionalWords.ts | 3 + packages/recommend/model/baseIndexSettings.ts | 5 ++ .../model/baseRecommendIndexSettings.ts | 11 +-- .../model/baseRecommendSearchParams.ts | 6 +- packages/recommend/model/index.ts | 2 + packages/recommend/model/insideBoundingBox.ts | 3 + packages/recommend/model/optionalWords.ts | 3 + 27 files changed, 110 insertions(+), 99 deletions(-) create mode 100644 packages/algoliasearch/lite/model/insideBoundingBox.ts create mode 100644 packages/algoliasearch/lite/model/optionalWords.ts create mode 100644 packages/client-composition/model/insideBoundingBox.ts create mode 100644 packages/client-composition/model/optionalWords.ts create mode 100644 packages/client-search/model/insideBoundingBox.ts create mode 100644 packages/client-search/model/optionalWords.ts create mode 100644 packages/recommend/model/insideBoundingBox.ts create mode 100644 packages/recommend/model/optionalWords.ts diff --git a/packages/algoliasearch/builds/models.ts b/packages/algoliasearch/builds/models.ts index bd9200778..f58ec0096 100644 --- a/packages/algoliasearch/builds/models.ts +++ b/packages/algoliasearch/builds/models.ts @@ -46,8 +46,8 @@ import type { CustomGetProps, CustomPostProps, CustomPutProps, - DeleteSourceProps, DeletedAtResponse, + DeleteSourceProps, Distinct, Edit, EditType, @@ -56,19 +56,21 @@ import type { Exhaustive, FacetFilters, FacetOrdering, - FacetStats, Facets, + FacetStats, GetTaskProps, HighlightResult, HighlightResultOption, IgnorePlurals, IndexSettingsAsSearchParams, + InsideBoundingBox, Languages, - MatchLevel, MatchedGeoLocation, + MatchLevel, Mode, NumericFilters, OptionalFilters, + OptionalWords, Params, Personalization, Promote, @@ -77,7 +79,6 @@ import type { QueryType, Range, RankingInfo, - ReRankingApplyFilter, Redirect, RedirectRuleIndexData, RedirectRuleIndexMetadata, @@ -85,6 +86,7 @@ import type { RemoveStopWords, RemoveWordsIfNoResults, RenderingContent, + ReRankingApplyFilter, SearchPagination, SearchParams, SearchParamsObject, @@ -105,14 +107,24 @@ import type { } from '@algolia/client-search'; import { apiClientVersion } from '@algolia/client-search'; -type Region = +export * from '@algolia/client-abtesting'; +export * from '@algolia/client-analytics'; +export * from '@algolia/client-insights'; +export * from '@algolia/client-personalization'; +export * from '@algolia/client-query-suggestions'; +export * from '@algolia/client-search'; +export * from '@algolia/ingestion'; +export * from '@algolia/monitoring'; +export * from '@algolia/recommend'; + +export type Region = | AbtestingRegion | AnalyticsRegion | IngestionRegion | InsightsRegion | PersonalizationRegion | QuerySuggestionsRegion; -type RegionOptions = +export type RegionOptions = | AbtestingRegionOptions | AnalyticsRegionOptions | IngestionRegionOptions @@ -120,24 +132,27 @@ type RegionOptions = | PersonalizationRegionOptions | QuerySuggestionsRegionOptions; -export * from '@algolia/client-abtesting'; -export * from '@algolia/client-analytics'; -export * from '@algolia/client-insights'; -export * from '@algolia/client-personalization'; -export * from '@algolia/client-query-suggestions'; -export * from '@algolia/client-search'; -export * from '@algolia/ingestion'; -export * from '@algolia/monitoring'; -export * from '@algolia/recommend'; - export type { AbtestingRegion, AbtestingRegionOptions, + AnalyticsRegion, + AnalyticsRegionOptions, + EventType, + IngestionRegion, + IngestionRegionOptions, + InsightsRegion, + InsightsRegionOptions, + PersonalizationRegion, + PersonalizationRegionOptions, + QuerySuggestionsRegion, + QuerySuggestionsRegionOptions, + Status, +}; + +export type { Action, AdvancedSyntaxFeatures, AlternativesAsExact, - AnalyticsRegion, - AnalyticsRegionOptions, Anchoring, AroundPrecision, AroundRadius, @@ -163,56 +178,47 @@ export type { CustomGetProps, CustomPostProps, CustomPutProps, - DeleteSourceProps, DeletedAtResponse, + DeleteSourceProps, Distinct, Edit, EditType, ErrorBase, - EventType, ExactOnSingleWordQuery, Exhaustive, FacetFilters, FacetOrdering, - FacetStats, Facets, + FacetStats, GetTaskProps, HighlightResult, HighlightResultOption, IgnorePlurals, IndexSettingsAsSearchParams, - IngestionRegion, - IngestionRegionOptions, - InsightsRegion, - InsightsRegionOptions, + InsideBoundingBox, Languages, - MatchLevel, MatchedGeoLocation, + MatchLevel, Mode, NumericFilters, OptionalFilters, + OptionalWords, Params, Personalization, - PersonalizationRegion, - PersonalizationRegionOptions, Promote, PromoteObjectID, PromoteObjectIDs, - QuerySuggestionsRegion, - QuerySuggestionsRegionOptions, QueryType, Range, RankingInfo, - ReRankingApplyFilter, Redirect, RedirectRuleIndexData, RedirectRuleIndexMetadata, RedirectURL, - Region, - RegionOptions, RemoveStopWords, RemoveWordsIfNoResults, RenderingContent, + ReRankingApplyFilter, SearchPagination, SearchParams, SearchParamsObject, @@ -222,7 +228,6 @@ export type { SnippetResultOption, SortRemainingBy, Source, - Status, SupportedLanguage, TagFilters, TaskStatus, @@ -231,9 +236,10 @@ export type { TypoToleranceEnum, Value, Widgets, - apiClientVersion, }; +export { apiClientVersion }; + /** * Options forwarded to the client initialized via the `init` method. */ diff --git a/packages/algoliasearch/lite/model/baseIndexSettings.ts b/packages/algoliasearch/lite/model/baseIndexSettings.ts index 51d450a35..3e69db00b 100644 --- a/packages/algoliasearch/lite/model/baseIndexSettings.ts +++ b/packages/algoliasearch/lite/model/baseIndexSettings.ts @@ -87,4 +87,9 @@ export type BaseIndexSettings = { * Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. */ attributeForDistinct?: string; + + /** + * Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). + */ + maxFacetHits?: number; }; diff --git a/packages/algoliasearch/lite/model/baseRecommendIndexSettings.ts b/packages/algoliasearch/lite/model/baseRecommendIndexSettings.ts index d6f5e5cee..07a53745b 100644 --- a/packages/algoliasearch/lite/model/baseRecommendIndexSettings.ts +++ b/packages/algoliasearch/lite/model/baseRecommendIndexSettings.ts @@ -5,6 +5,7 @@ import type { AlternativesAsExact } from './alternativesAsExact'; import type { Distinct } from './distinct'; import type { ExactOnSingleWordQuery } from './exactOnSingleWordQuery'; import type { IgnorePlurals } from './ignorePlurals'; +import type { OptionalWords } from './optionalWords'; import type { QueryType } from './queryType'; import type { ReRankingApplyFilter } from './reRankingApplyFilter'; import type { RemoveStopWords } from './removeStopWords'; @@ -114,10 +115,7 @@ export type BaseRecommendIndexSettings = { */ advancedSyntax?: boolean; - /** - * Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn\'t include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). - */ - optionalWords?: Array; + optionalWords?: OptionalWords | null; /** * Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. @@ -153,11 +151,6 @@ export type BaseRecommendIndexSettings = { */ responseFields?: Array; - /** - * Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - */ - maxFacetHits?: number; - /** * Maximum number of facet values to return for each facet. */ diff --git a/packages/algoliasearch/lite/model/baseRecommendSearchParams.ts b/packages/algoliasearch/lite/model/baseRecommendSearchParams.ts index 0c9814285..bd10f6bac 100644 --- a/packages/algoliasearch/lite/model/baseRecommendSearchParams.ts +++ b/packages/algoliasearch/lite/model/baseRecommendSearchParams.ts @@ -3,6 +3,7 @@ import type { AroundPrecision } from './aroundPrecision'; import type { AroundRadius } from './aroundRadius'; import type { FacetFilters } from './facetFilters'; +import type { InsideBoundingBox } from './insideBoundingBox'; import type { NumericFilters } from './numericFilters'; import type { OptionalFilters } from './optionalFilters'; import type { SupportedLanguage } from './supportedLanguage'; @@ -66,10 +67,7 @@ export type BaseRecommendSearchParams = { */ minimumAroundRadius?: number; - /** - * Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). - */ - insideBoundingBox?: Array>; + insideBoundingBox?: InsideBoundingBox | null; /** * Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. diff --git a/packages/algoliasearch/lite/model/baseSearchParamsWithoutQuery.ts b/packages/algoliasearch/lite/model/baseSearchParamsWithoutQuery.ts index 577120301..69fcbe82a 100644 --- a/packages/algoliasearch/lite/model/baseSearchParamsWithoutQuery.ts +++ b/packages/algoliasearch/lite/model/baseSearchParamsWithoutQuery.ts @@ -3,6 +3,7 @@ import type { AroundPrecision } from './aroundPrecision'; import type { AroundRadius } from './aroundRadius'; import type { FacetFilters } from './facetFilters'; +import type { InsideBoundingBox } from './insideBoundingBox'; import type { NumericFilters } from './numericFilters'; import type { OptionalFilters } from './optionalFilters'; import type { SupportedLanguage } from './supportedLanguage'; @@ -81,10 +82,7 @@ export type BaseSearchParamsWithoutQuery = { */ minimumAroundRadius?: number; - /** - * Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). - */ - insideBoundingBox?: Array>; + insideBoundingBox?: InsideBoundingBox | null; /** * Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. diff --git a/packages/algoliasearch/lite/model/index.ts b/packages/algoliasearch/lite/model/index.ts index e67ddd63e..f58133a79 100644 --- a/packages/algoliasearch/lite/model/index.ts +++ b/packages/algoliasearch/lite/model/index.ts @@ -54,6 +54,7 @@ export * from './ignorePlurals'; export * from './indexSettings'; export * from './indexSettingsAsSearchParams'; export * from './indexSettingsFacets'; +export * from './insideBoundingBox'; export * from './lookingSimilar'; export * from './lookingSimilarModel'; export * from './lookingSimilarQuery'; @@ -62,6 +63,7 @@ export * from './matchLevel'; export * from './mode'; export * from './numericFilters'; export * from './optionalFilters'; +export * from './optionalWords'; export * from './params'; export * from './personalization'; export * from './queryType'; diff --git a/packages/algoliasearch/lite/model/indexSettingsAsSearchParams.ts b/packages/algoliasearch/lite/model/indexSettingsAsSearchParams.ts index 99d1ddd57..265011d89 100644 --- a/packages/algoliasearch/lite/model/indexSettingsAsSearchParams.ts +++ b/packages/algoliasearch/lite/model/indexSettingsAsSearchParams.ts @@ -6,6 +6,7 @@ import type { Distinct } from './distinct'; import type { ExactOnSingleWordQuery } from './exactOnSingleWordQuery'; import type { IgnorePlurals } from './ignorePlurals'; import type { Mode } from './mode'; +import type { OptionalWords } from './optionalWords'; import type { QueryType } from './queryType'; import type { ReRankingApplyFilter } from './reRankingApplyFilter'; import type { RemoveStopWords } from './removeStopWords'; @@ -135,10 +136,7 @@ export type IndexSettingsAsSearchParams = { */ advancedSyntax?: boolean; - /** - * Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn\'t include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). - */ - optionalWords?: Array; + optionalWords?: OptionalWords | null; /** * Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. @@ -174,11 +172,6 @@ export type IndexSettingsAsSearchParams = { */ responseFields?: Array; - /** - * Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - */ - maxFacetHits?: number; - /** * Maximum number of facet values to return for each facet. */ diff --git a/packages/algoliasearch/lite/model/insideBoundingBox.ts b/packages/algoliasearch/lite/model/insideBoundingBox.ts new file mode 100644 index 000000000..8a498532f --- /dev/null +++ b/packages/algoliasearch/lite/model/insideBoundingBox.ts @@ -0,0 +1,3 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +export type InsideBoundingBox = string | Array>; diff --git a/packages/algoliasearch/lite/model/optionalWords.ts b/packages/algoliasearch/lite/model/optionalWords.ts new file mode 100644 index 000000000..51d42589e --- /dev/null +++ b/packages/algoliasearch/lite/model/optionalWords.ts @@ -0,0 +1,3 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +export type OptionalWords = string | Array; diff --git a/packages/client-composition/model/index.ts b/packages/client-composition/model/index.ts index d04cde911..f940740da 100644 --- a/packages/client-composition/model/index.ts +++ b/packages/client-composition/model/index.ts @@ -48,6 +48,7 @@ export * from './hitRankingInfo'; export * from './ignorePlurals'; export * from './injection'; export * from './insetsQueryParameters'; +export * from './insideBoundingBox'; export * from './listCompositionsResponse'; export * from './main'; export * from './mainInjectionQueryParameters'; @@ -57,6 +58,7 @@ export * from './multipleBatchRequest'; export * from './multipleBatchResponse'; export * from './numericFilters'; export * from './optionalFilters'; +export * from './optionalWords'; export * from './params'; export * from './personalization'; export * from './queryType'; diff --git a/packages/client-composition/model/insetsQueryParameters.ts b/packages/client-composition/model/insetsQueryParameters.ts index 0e8de9666..80b98c6ef 100644 --- a/packages/client-composition/model/insetsQueryParameters.ts +++ b/packages/client-composition/model/insetsQueryParameters.ts @@ -8,6 +8,7 @@ import type { FacetFilters } from './facetFilters'; import type { IgnorePlurals } from './ignorePlurals'; import type { NumericFilters } from './numericFilters'; import type { OptionalFilters } from './optionalFilters'; +import type { OptionalWords } from './optionalWords'; import type { QueryType } from './queryType'; import type { RemoveStopWords } from './removeStopWords'; import type { RemoveWordsIfNoResults } from './removeWordsIfNoResults'; @@ -136,10 +137,7 @@ export type InsetsQueryParameters = { */ advancedSyntax?: boolean; - /** - * Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn\'t include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). - */ - optionalWords?: Array; + optionalWords?: OptionalWords | null; /** * Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. diff --git a/packages/client-composition/model/insideBoundingBox.ts b/packages/client-composition/model/insideBoundingBox.ts new file mode 100644 index 000000000..8a498532f --- /dev/null +++ b/packages/client-composition/model/insideBoundingBox.ts @@ -0,0 +1,3 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +export type InsideBoundingBox = string | Array>; diff --git a/packages/client-composition/model/optionalWords.ts b/packages/client-composition/model/optionalWords.ts new file mode 100644 index 000000000..51d42589e --- /dev/null +++ b/packages/client-composition/model/optionalWords.ts @@ -0,0 +1,3 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +export type OptionalWords = string | Array; diff --git a/packages/client-composition/model/params.ts b/packages/client-composition/model/params.ts index 3b75d5bd3..013907f5c 100644 --- a/packages/client-composition/model/params.ts +++ b/packages/client-composition/model/params.ts @@ -3,6 +3,7 @@ import type { AroundPrecision } from './aroundPrecision'; import type { AroundRadius } from './aroundRadius'; import type { FacetFilters } from './facetFilters'; +import type { InsideBoundingBox } from './insideBoundingBox'; import type { NumericFilters } from './numericFilters'; import type { OptionalFilters } from './optionalFilters'; import type { SupportedLanguage } from './supportedLanguage'; @@ -60,10 +61,7 @@ export type Params = { */ minimumAroundRadius?: number; - /** - * Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). - */ - insideBoundingBox?: Array>; + insideBoundingBox?: InsideBoundingBox | null; /** * Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. diff --git a/packages/client-search/model/baseIndexSettings.ts b/packages/client-search/model/baseIndexSettings.ts index 51d450a35..3e69db00b 100644 --- a/packages/client-search/model/baseIndexSettings.ts +++ b/packages/client-search/model/baseIndexSettings.ts @@ -87,4 +87,9 @@ export type BaseIndexSettings = { * Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. */ attributeForDistinct?: string; + + /** + * Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). + */ + maxFacetHits?: number; }; diff --git a/packages/client-search/model/baseSearchParamsWithoutQuery.ts b/packages/client-search/model/baseSearchParamsWithoutQuery.ts index 577120301..69fcbe82a 100644 --- a/packages/client-search/model/baseSearchParamsWithoutQuery.ts +++ b/packages/client-search/model/baseSearchParamsWithoutQuery.ts @@ -3,6 +3,7 @@ import type { AroundPrecision } from './aroundPrecision'; import type { AroundRadius } from './aroundRadius'; import type { FacetFilters } from './facetFilters'; +import type { InsideBoundingBox } from './insideBoundingBox'; import type { NumericFilters } from './numericFilters'; import type { OptionalFilters } from './optionalFilters'; import type { SupportedLanguage } from './supportedLanguage'; @@ -81,10 +82,7 @@ export type BaseSearchParamsWithoutQuery = { */ minimumAroundRadius?: number; - /** - * Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). - */ - insideBoundingBox?: Array>; + insideBoundingBox?: InsideBoundingBox | null; /** * Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. diff --git a/packages/client-search/model/deleteByParams.ts b/packages/client-search/model/deleteByParams.ts index ad5fda3b7..ac77bb7df 100644 --- a/packages/client-search/model/deleteByParams.ts +++ b/packages/client-search/model/deleteByParams.ts @@ -2,6 +2,7 @@ import type { AroundRadius } from './aroundRadius'; import type { FacetFilters } from './facetFilters'; +import type { InsideBoundingBox } from './insideBoundingBox'; import type { NumericFilters } from './numericFilters'; import type { TagFilters } from './tagFilters'; @@ -24,10 +25,7 @@ export type DeleteByParams = { aroundRadius?: AroundRadius; - /** - * Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). - */ - insideBoundingBox?: Array>; + insideBoundingBox?: InsideBoundingBox | null; /** * Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. diff --git a/packages/client-search/model/index.ts b/packages/client-search/model/index.ts index 13e821cb3..250bff413 100644 --- a/packages/client-search/model/index.ts +++ b/packages/client-search/model/index.ts @@ -86,6 +86,7 @@ export * from './hit'; export * from './ignorePlurals'; export * from './indexSettings'; export * from './indexSettingsAsSearchParams'; +export * from './insideBoundingBox'; export * from './languages'; export * from './listApiKeysResponse'; export * from './listClustersResponse'; @@ -103,6 +104,7 @@ export * from './numericFilters'; export * from './operationIndexParams'; export * from './operationType'; export * from './optionalFilters'; +export * from './optionalWords'; export * from './params'; export * from './personalization'; export * from './promote'; diff --git a/packages/client-search/model/indexSettingsAsSearchParams.ts b/packages/client-search/model/indexSettingsAsSearchParams.ts index 99d1ddd57..265011d89 100644 --- a/packages/client-search/model/indexSettingsAsSearchParams.ts +++ b/packages/client-search/model/indexSettingsAsSearchParams.ts @@ -6,6 +6,7 @@ import type { Distinct } from './distinct'; import type { ExactOnSingleWordQuery } from './exactOnSingleWordQuery'; import type { IgnorePlurals } from './ignorePlurals'; import type { Mode } from './mode'; +import type { OptionalWords } from './optionalWords'; import type { QueryType } from './queryType'; import type { ReRankingApplyFilter } from './reRankingApplyFilter'; import type { RemoveStopWords } from './removeStopWords'; @@ -135,10 +136,7 @@ export type IndexSettingsAsSearchParams = { */ advancedSyntax?: boolean; - /** - * Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn\'t include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). - */ - optionalWords?: Array; + optionalWords?: OptionalWords | null; /** * Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. @@ -174,11 +172,6 @@ export type IndexSettingsAsSearchParams = { */ responseFields?: Array; - /** - * Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - */ - maxFacetHits?: number; - /** * Maximum number of facet values to return for each facet. */ diff --git a/packages/client-search/model/insideBoundingBox.ts b/packages/client-search/model/insideBoundingBox.ts new file mode 100644 index 000000000..8a498532f --- /dev/null +++ b/packages/client-search/model/insideBoundingBox.ts @@ -0,0 +1,3 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +export type InsideBoundingBox = string | Array>; diff --git a/packages/client-search/model/optionalWords.ts b/packages/client-search/model/optionalWords.ts new file mode 100644 index 000000000..51d42589e --- /dev/null +++ b/packages/client-search/model/optionalWords.ts @@ -0,0 +1,3 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +export type OptionalWords = string | Array; diff --git a/packages/recommend/model/baseIndexSettings.ts b/packages/recommend/model/baseIndexSettings.ts index 51d450a35..3e69db00b 100644 --- a/packages/recommend/model/baseIndexSettings.ts +++ b/packages/recommend/model/baseIndexSettings.ts @@ -87,4 +87,9 @@ export type BaseIndexSettings = { * Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts. */ attributeForDistinct?: string; + + /** + * Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). + */ + maxFacetHits?: number; }; diff --git a/packages/recommend/model/baseRecommendIndexSettings.ts b/packages/recommend/model/baseRecommendIndexSettings.ts index d6f5e5cee..07a53745b 100644 --- a/packages/recommend/model/baseRecommendIndexSettings.ts +++ b/packages/recommend/model/baseRecommendIndexSettings.ts @@ -5,6 +5,7 @@ import type { AlternativesAsExact } from './alternativesAsExact'; import type { Distinct } from './distinct'; import type { ExactOnSingleWordQuery } from './exactOnSingleWordQuery'; import type { IgnorePlurals } from './ignorePlurals'; +import type { OptionalWords } from './optionalWords'; import type { QueryType } from './queryType'; import type { ReRankingApplyFilter } from './reRankingApplyFilter'; import type { RemoveStopWords } from './removeStopWords'; @@ -114,10 +115,7 @@ export type BaseRecommendIndexSettings = { */ advancedSyntax?: boolean; - /** - * Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn\'t include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). - */ - optionalWords?: Array; + optionalWords?: OptionalWords | null; /** * Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking. @@ -153,11 +151,6 @@ export type BaseRecommendIndexSettings = { */ responseFields?: Array; - /** - * Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - */ - maxFacetHits?: number; - /** * Maximum number of facet values to return for each facet. */ diff --git a/packages/recommend/model/baseRecommendSearchParams.ts b/packages/recommend/model/baseRecommendSearchParams.ts index 0c9814285..bd10f6bac 100644 --- a/packages/recommend/model/baseRecommendSearchParams.ts +++ b/packages/recommend/model/baseRecommendSearchParams.ts @@ -3,6 +3,7 @@ import type { AroundPrecision } from './aroundPrecision'; import type { AroundRadius } from './aroundRadius'; import type { FacetFilters } from './facetFilters'; +import type { InsideBoundingBox } from './insideBoundingBox'; import type { NumericFilters } from './numericFilters'; import type { OptionalFilters } from './optionalFilters'; import type { SupportedLanguage } from './supportedLanguage'; @@ -66,10 +67,7 @@ export type BaseRecommendSearchParams = { */ minimumAroundRadius?: number; - /** - * Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). - */ - insideBoundingBox?: Array>; + insideBoundingBox?: InsideBoundingBox | null; /** * Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. diff --git a/packages/recommend/model/index.ts b/packages/recommend/model/index.ts index 6dc010ab5..f984c9623 100644 --- a/packages/recommend/model/index.ts +++ b/packages/recommend/model/index.ts @@ -39,6 +39,7 @@ export * from './highlightResult'; export * from './highlightResultOption'; export * from './ignorePlurals'; export * from './indexSettingsFacets'; +export * from './insideBoundingBox'; export * from './lookingSimilar'; export * from './lookingSimilarModel'; export * from './lookingSimilarQuery'; @@ -46,6 +47,7 @@ export * from './matchedGeoLocation'; export * from './matchLevel'; export * from './numericFilters'; export * from './optionalFilters'; +export * from './optionalWords'; export * from './paramsConsequence'; export * from './personalization'; export * from './promoteConsequenceObject'; diff --git a/packages/recommend/model/insideBoundingBox.ts b/packages/recommend/model/insideBoundingBox.ts new file mode 100644 index 000000000..8a498532f --- /dev/null +++ b/packages/recommend/model/insideBoundingBox.ts @@ -0,0 +1,3 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +export type InsideBoundingBox = string | Array>; diff --git a/packages/recommend/model/optionalWords.ts b/packages/recommend/model/optionalWords.ts new file mode 100644 index 000000000..51d42589e --- /dev/null +++ b/packages/recommend/model/optionalWords.ts @@ -0,0 +1,3 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +export type OptionalWords = string | Array;