Skip to content

Commit 1a73994

Browse files
authoredSep 19, 2024··
fix(specs): recommend remove unsupported query parameters [RECO-2345] [skip-bc] (#3692)
1 parent cc190fa commit 1a73994

File tree

14 files changed

+184
-29
lines changed

14 files changed

+184
-29
lines changed
 

‎clients/algoliasearch-client-dart/melos.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,15 @@ scripts:
4343
exec: dart pub upgrade
4444
description: Run `dart pub upgrade` in all packages
4545

46+
outdated:
47+
exec: dart pub outdated
48+
description: Run `dart pub outdated` in all packages
49+
4650
clear:
4751
exec: rm -rf .dart_tool
4852
description: Clear build folders, i.e. `.dart_tool` in all packages
4953

5054
command:
5155
version:
5256
hooks:
53-
post: ./sync.sh
57+
post: ./sync.sh

‎generators/src/main/java/com/algolia/codegen/AlgoliaSwiftGenerator.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class AlgoliaSwiftGenerator extends Swift5ClientCodegen {
3838
"aroundradiusall",
3939
"automaticfacetfilter",
4040
"automaticfacetfilters",
41+
"baseindexsettings",
4142
"basesearchparams",
4243
"basesearchparamswithoutquery",
4344
"basesearchresponse",
@@ -84,8 +85,8 @@ public class AlgoliaSwiftGenerator extends Swift5ClientCodegen {
8485
"range",
8586
"rankinginfo",
8687
"redirect",
87-
"redirectruleindexmetadata",
8888
"redirectruleindexdata",
89+
"redirectruleindexmetadata",
8990
"redirecturl",
9091
"region",
9192
"removestopwords",

‎scripts/cts/runCts.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ export async function runCts(
128128
): Promise<void> {
129129
const withBenchmarkServer =
130130
suites.benchmark && (clients.includes('search') || clients.includes('all') || languages.includes('swift'));
131-
const withClientServer =
132-
suites.client && (clients.includes('search') || clients.includes('all') || process.platform === 'darwin'); // the macos swift CI also runs the clients tests
131+
const withClientServer = suites.client;
133132
const closeTestServer = await startTestServer({
134133
...suites,
135134
benchmark: withBenchmarkServer,
@@ -142,7 +141,8 @@ export async function runCts(
142141

143142
await closeTestServer();
144143

145-
if (withClientServer) {
144+
if (withClientServer && (clients.includes('search') || clients.includes('all') || process.platform === 'darwin')) {
145+
// the macos swift CI also runs the clients tests
146146
const skip = (lang: Language): number => (languages.includes(lang) ? 1 : 0);
147147

148148
assertValidTimeouts(languages.length);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
recommendIndexSettings:
2+
description: Index settings.
3+
allOf:
4+
- $ref: '../../../common/schemas/IndexSettings.yml#/baseIndexSettings'
5+
- $ref: '#/baseRecommendIndexSettings'
6+
7+
baseRecommendIndexSettings:
8+
type: object
9+
additionalProperties: false
10+
properties:
11+
attributesToRetrieve:
12+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/attributesToRetrieve'
13+
ranking:
14+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/ranking'
15+
relevancyStrictness:
16+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/relevancyStrictness'
17+
attributesToHighlight:
18+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/attributesToHighlight'
19+
attributesToSnippet:
20+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/attributesToSnippet'
21+
highlightPreTag:
22+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/highlightPreTag'
23+
highlightPostTag:
24+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/highlightPostTag'
25+
snippetEllipsisText:
26+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/snippetEllipsisText'
27+
restrictHighlightAndSnippetArrays:
28+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/restrictHighlightAndSnippetArrays'
29+
minWordSizefor1Typo:
30+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/minWordSizefor1Typo'
31+
minWordSizefor2Typos:
32+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/minWordSizefor2Typos'
33+
typoTolerance:
34+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/typoTolerance'
35+
allowTyposOnNumericTokens:
36+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/allowTyposOnNumericTokens'
37+
disableTypoToleranceOnAttributes:
38+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/disableTypoToleranceOnAttributes'
39+
ignorePlurals:
40+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/ignorePlurals'
41+
removeStopWords:
42+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/removeStopWords'
43+
queryLanguages:
44+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/queryLanguages'
45+
decompoundQuery:
46+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/decompoundQuery'
47+
enableRules:
48+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/enableRules'
49+
enablePersonalization:
50+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/enablePersonalization'
51+
queryType:
52+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/queryType'
53+
removeWordsIfNoResults:
54+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/removeWordsIfNoResults'
55+
advancedSyntax:
56+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/advancedSyntax'
57+
optionalWords:
58+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/optionalWords'
59+
disableExactOnAttributes:
60+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/disableExactOnAttributes'
61+
exactOnSingleWordQuery:
62+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/exactOnSingleWordQuery'
63+
alternativesAsExact:
64+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/alternativesAsExact'
65+
advancedSyntaxFeatures:
66+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/advancedSyntaxFeatures'
67+
distinct:
68+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/distinct'
69+
replaceSynonymsInHighlight:
70+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/replaceSynonymsInHighlight'
71+
minProximity:
72+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/minProximity'
73+
responseFields:
74+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/responseFields'
75+
maxFacetHits:
76+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/maxFacetHits'
77+
maxValuesPerFacet:
78+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/maxValuesPerFacet'
79+
sortFacetValuesBy:
80+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/sortFacetValuesBy'
81+
attributeCriteriaComputedByMinProximity:
82+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/attributeCriteriaComputedByMinProximity'
83+
renderingContent:
84+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/renderingContent'
85+
enableReRanking:
86+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/enableReRanking'
87+
reRankingApplyFilter:
88+
$ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/reRankingApplyFilter'

‎specs/recommend/common/schemas/LookingSimilarQuery.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ lookingSimilar:
1212
objectID:
1313
$ref: '../../../common/parameters.yml#/objectID'
1414
fallbackParameters:
15-
$ref: './RecommendationsRequest.yml#/fallbackParams'
15+
$ref: './QueryParameters.yml#/fallbackParams'
1616
required:
1717
- model
1818
- objectID
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
recommendSearchParams:
2+
title: Search parameters as object
3+
description: Search parameters for filtering the recommendations.
4+
allOf:
5+
- $ref: '#/baseRecommendSearchParams'
6+
- $ref: '../../../common/schemas/SearchParams.yml#/searchParamsQuery'
7+
- $ref: './IndexSettings.yml#/recommendIndexSettings'
8+
9+
fallbackParams:
10+
title: fallbackParameters
11+
allOf:
12+
- $ref: './QueryParameters.yml#/recommendSearchParams'
13+
- type: object
14+
description: Search parameters to use for a fallback request if there aren't enough recommendations.
15+
16+
baseRecommendSearchParams:
17+
type: object
18+
additionalProperties: false
19+
properties:
20+
similarQuery:
21+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/similarQuery'
22+
filters:
23+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/filters'
24+
facetFilters:
25+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/facetFilters'
26+
optionalFilters:
27+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/optionalFilters'
28+
numericFilters:
29+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/numericFilters'
30+
tagFilters:
31+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/tagFilters'
32+
sumOrFiltersScores:
33+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/sumOrFiltersScores'
34+
restrictSearchableAttributes:
35+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/restrictSearchableAttributes'
36+
facets:
37+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/facets'
38+
facetingAfterDistinct:
39+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/facetingAfterDistinct'
40+
aroundLatLng:
41+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/aroundLatLng'
42+
aroundLatLngViaIP:
43+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/aroundLatLngViaIP'
44+
aroundRadius:
45+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/aroundRadius'
46+
aroundPrecision:
47+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/aroundPrecision'
48+
minimumAroundRadius:
49+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/minimumAroundRadius'
50+
insideBoundingBox:
51+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/insideBoundingBox'
52+
insidePolygon:
53+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/insidePolygon'
54+
naturalLanguages:
55+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/naturalLanguages'
56+
ruleContexts:
57+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/ruleContexts'
58+
personalizationImpact:
59+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/personalizationImpact'
60+
userToken:
61+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/userToken'
62+
getRankingInfo:
63+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/getRankingInfo'
64+
synonyms:
65+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/synonyms'
66+
clickAnalytics:
67+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/clickAnalytics'
68+
analytics:
69+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/analytics'
70+
analyticsTags:
71+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/analyticsTags'
72+
percentileComputation:
73+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/percentileComputation'
74+
enableABTest:
75+
$ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/enableABTest'

‎specs/recommend/common/schemas/RecommendRule.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Condition:
3232
If not specified, the rule is triggered for all recommendations.
3333
properties:
3434
filters:
35-
$ref: '../../../common/schemas/SearchParams.yml#/filters'
35+
$ref: './QueryParameters.yml#/baseRecommendSearchParams/properties/filters'
3636
context:
3737
$ref: '../../../common/schemas/Rule.yml#/context'
3838

@@ -89,7 +89,7 @@ ParamsConsequence:
8989
items:
9090
$ref: '#/AutoFacetFilter'
9191
filters:
92-
$ref: '../../../common/schemas/SearchParams.yml#/filters'
92+
$ref: './QueryParameters.yml#/baseRecommendSearchParams/properties/filters'
9393
optionalFilters:
9494
type: array
9595
description: |

‎specs/recommend/common/schemas/RecommendationsRequest.yml

+1-16
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,7 @@ baseRecommendRequest:
3030
Depending on the available recommendations and the other request parameters,
3131
the actual number of recommendations may be lower than this value.
3232
queryParameters:
33-
$ref: '#/searchParams'
33+
$ref: './QueryParameters.yml#/recommendSearchParams'
3434
required:
3535
- indexName
3636
- threshold
37-
38-
searchParams:
39-
title: queryParameters
40-
allOf:
41-
# TODO: This isn't correct. `page`, `hitsPerPage`, `offset`, and `length` aren't allowed
42-
- $ref: '../../../common/schemas/SearchParams.yml#/searchParamsObject'
43-
- type: object
44-
description: Search parameters for filtering the recommendations.
45-
46-
fallbackParams:
47-
title: fallbackParameters
48-
allOf:
49-
- $ref: '../../../common/schemas/SearchParams.yml#/searchParamsObject'
50-
- type: object
51-
description: Search parameters to use for a fallback request if there aren't enough recommendations.

‎specs/recommend/common/schemas/RecommendedForYouQuery.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ recommendedForYou:
1010
model:
1111
$ref: '#/recommendedForYouModel'
1212
fallbackParameters:
13-
$ref: './RecommendationsRequest.yml#/fallbackParams'
13+
$ref: './QueryParameters.yml#/fallbackParams'
1414
required:
1515
- model
1616

‎specs/recommend/common/schemas/RelatedQuery.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ relatedProducts:
1212
objectID:
1313
$ref: '../../../common/parameters.yml#/objectID'
1414
fallbackParameters:
15-
$ref: './RecommendationsRequest.yml#/fallbackParams'
15+
$ref: './QueryParameters.yml#/fallbackParams'
1616
required:
1717
- model
1818
- objectID

‎specs/recommend/common/schemas/TrendingFacetsQuery.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ trendingFacets:
1212
model:
1313
$ref: '#/trendingFacetsModel'
1414
fallbackParameters:
15-
$ref: './RecommendationsRequest.yml#/fallbackParams'
15+
$ref: './QueryParameters.yml#/fallbackParams'
1616
required:
1717
- facetName
1818
- model

‎specs/recommend/common/schemas/TrendingItemsQuery.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ trendingItems:
1414
model:
1515
$ref: '#/trendingItemsModel'
1616
fallbackParameters:
17-
$ref: '../../../common/schemas/SearchParams.yml#/searchParamsObject'
17+
$ref: './QueryParameters.yml#/fallbackParams'
1818
required:
1919
- model
2020

‎templates/dart/tests/param_object.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{{objectName}}}(
1+
{{#lambda.pascalcase}}{{{objectName}}}{{/lambda.pascalcase}}(
22
{{#value}}
33
{{> tests/request_param}}
44
{{/value}}

‎templates/javascript/clients/algoliasearch/builds/models.mustache

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import type {
1414
AutomaticFacetFilter,
1515
AutomaticFacetFilters,
1616
BaseSearchParams,
17+
BaseIndexSettings,
1718
BaseSearchParamsWithoutQuery,
1819
BaseSearchResponse,
1920
BooleanString,
@@ -99,6 +100,7 @@ export {
99100
AutomaticFacetFilter,
100101
AutomaticFacetFilters,
101102
BaseSearchParams,
103+
BaseIndexSettings,
102104
BaseSearchParamsWithoutQuery,
103105
BaseSearchResponse,
104106
BooleanString,

0 commit comments

Comments
 (0)
Please sign in to comment.