Skip to content

Commit

Permalink
fix(specs): make the searchParams compatible with v4 [skip-bc] (gener…
Browse files Browse the repository at this point in the history
…ated)

algolia/api-clients-automation#4108

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Pierre Millot <pierre.millot@algolia.com>
  • Loading branch information
algolia-bot and millotp committed Nov 15, 2024
1 parent 6fb253c commit cbeeb93
Show file tree
Hide file tree
Showing 27 changed files with 110 additions and 99 deletions.
76 changes: 41 additions & 35 deletions packages/algoliasearch/builds/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ import type {
CustomGetProps,
CustomPostProps,
CustomPutProps,
DeleteSourceProps,
DeletedAtResponse,
DeleteSourceProps,
Distinct,
Edit,
EditType,
Expand All @@ -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,
Expand All @@ -77,14 +79,14 @@ import type {
QueryType,
Range,
RankingInfo,
ReRankingApplyFilter,
Redirect,
RedirectRuleIndexData,
RedirectRuleIndexMetadata,
RedirectURL,
RemoveStopWords,
RemoveWordsIfNoResults,
RenderingContent,
ReRankingApplyFilter,
SearchPagination,
SearchParams,
SearchParamsObject,
Expand All @@ -105,39 +107,52 @@ 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
| InsightsRegionOptions
| 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,
Expand All @@ -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,
Expand All @@ -222,7 +228,6 @@ export type {
SnippetResultOption,
SortRemainingBy,
Source,
Status,
SupportedLanguage,
TagFilters,
TaskStatus,
Expand All @@ -231,9 +236,10 @@ export type {
TypoToleranceEnum,
Value,
Widgets,
apiClientVersion,
};

export { apiClientVersion };

/**
* Options forwarded to the client initialized via the `init` method.
*/
Expand Down
5 changes: 5 additions & 0 deletions packages/algoliasearch/lite/model/baseIndexSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
11 changes: 2 additions & 9 deletions packages/algoliasearch/lite/model/baseRecommendIndexSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<string>;
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.
Expand Down Expand Up @@ -153,11 +151,6 @@ export type BaseRecommendIndexSettings = {
*/
responseFields?: Array<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;

/**
* Maximum number of facet values to return for each facet.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<Array<number>>;
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`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<Array<number>>;
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`.
Expand Down
2 changes: 2 additions & 0 deletions packages/algoliasearch/lite/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down
11 changes: 2 additions & 9 deletions packages/algoliasearch/lite/model/indexSettingsAsSearchParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<string>;
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.
Expand Down Expand Up @@ -174,11 +172,6 @@ export type IndexSettingsAsSearchParams = {
*/
responseFields?: Array<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;

/**
* Maximum number of facet values to return for each facet.
*/
Expand Down
3 changes: 3 additions & 0 deletions packages/algoliasearch/lite/model/insideBoundingBox.ts
Original file line number Diff line number Diff line change
@@ -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<Array<number>>;
3 changes: 3 additions & 0 deletions packages/algoliasearch/lite/model/optionalWords.ts
Original file line number Diff line number Diff line change
@@ -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<string>;
2 changes: 2 additions & 0 deletions packages/client-composition/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down
6 changes: 2 additions & 4 deletions packages/client-composition/model/insetsQueryParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<string>;
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.
Expand Down
3 changes: 3 additions & 0 deletions packages/client-composition/model/insideBoundingBox.ts
Original file line number Diff line number Diff line change
@@ -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<Array<number>>;
3 changes: 3 additions & 0 deletions packages/client-composition/model/optionalWords.ts
Original file line number Diff line number Diff line change
@@ -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<string>;
Loading

0 comments on commit cbeeb93

Please sign in to comment.