diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml
index f66d0de6fee..860acc0125f 100644
--- a/.github/actions/cache/action.yml
+++ b/.github/actions/cache/action.yml
@@ -208,7 +208,8 @@ runs:
hashFiles(
'clients/algoliasearch-client-javascript/packages/client-search/**',
'!clients/algoliasearch-client-javascript/packages/client-search/dist',
- 'specs/bundled/search.yml'
+ 'specs/bundled/search.yml',
+ 'templates/javascript/**'
)}}
- name: Restore built JavaScript recommend client
@@ -221,7 +222,8 @@ runs:
hashFiles(
'clients/algoliasearch-client-javascript/packages/recommend/**',
'!clients/algoliasearch-client-javascript/packages/recommend/dist',
- 'specs/bundled/recommend.yml'
+ 'specs/bundled/recommend.yml',
+ 'templates/javascript/**'
)}}
- name: Restore built JavaScript query-suggestions client
@@ -234,7 +236,8 @@ runs:
hashFiles(
'clients/algoliasearch-client-javascript/packages/client-query-suggestions/**',
'!clients/algoliasearch-client-javascript/packages/client-query-suggestions/dist',
- 'specs/bundled/query-suggestions.yml'
+ 'specs/bundled/query-suggestions.yml',
+ 'templates/javascript/**'
)}}
- name: Restore built JavaScript personalization client
@@ -247,7 +250,8 @@ runs:
hashFiles(
'clients/algoliasearch-client-javascript/packages/client-personalization/**',
'!clients/algoliasearch-client-javascript/packages/client-personalization/dist',
- 'specs/bundled/personalization.yml'
+ 'specs/bundled/personalization.yml',
+ 'templates/javascript/**'
)}}
- name: Restore built JavaScript analytics client
@@ -260,7 +264,8 @@ runs:
hashFiles(
'clients/algoliasearch-client-javascript/packages/client-analytics/**',
'!clients/algoliasearch-client-javascript/packages/client-analytics/dist',
- 'specs/bundled/analytics.yml'
+ 'specs/bundled/analytics.yml',
+ 'templates/javascript/**'
)}}
- name: Restore built JavaScript abtesting client
@@ -273,7 +278,8 @@ runs:
hashFiles(
'clients/algoliasearch-client-javascript/packages/client-abtesting/**',
'!clients/algoliasearch-client-javascript/packages/client-abtesting/dist',
- 'specs/bundled/abtesting.yml'
+ 'specs/bundled/abtesting.yml',
+ 'templates/javascript/**'
)}}
- name: Restore built JavaScript insights client
@@ -286,7 +292,8 @@ runs:
hashFiles(
'clients/algoliasearch-client-javascript/packages/client-insights/**',
'!clients/algoliasearch-client-javascript/packages/client-insights/dist',
- 'specs/bundled/insights.yml'
+ 'specs/bundled/insights.yml',
+ 'templates/javascript/**'
)}}
- name: Restore built JavaScript sources client
@@ -299,7 +306,8 @@ runs:
hashFiles(
'clients/algoliasearch-client-javascript/packages/client-sources/**',
'!clients/algoliasearch-client-javascript/packages/client-sources/dist',
- 'specs/bundled/sources.yml'
+ 'specs/bundled/sources.yml',
+ 'templates/javascript/**'
)}}
- name: Restore built JavaScript predict client
@@ -312,7 +320,8 @@ runs:
hashFiles(
'clients/algoliasearch-client-javascript/packages/client-predict/**',
'!clients/algoliasearch-client-javascript/packages/client-predict/dist',
- 'specs/bundled/predict.yml'
+ 'specs/bundled/predict.yml',
+ 'templates/javascript/**'
)}}
# Restore Java clients: used during 'cts' or 'codegen'
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index 410406c43af..58697b551f6 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -159,7 +159,8 @@ jobs:
hashFiles(
format('{0}/**', matrix.client.folder),
format('!{0}/dist', matrix.client.folder),
- format('specs/bundled/{0}.yml', matrix.client.name)
+ format('specs/bundled/{0}.yml', matrix.client.name),
+ 'templates/javascript/**'
)}}
- name: Generate '${{ matrix.client.name }}' client
diff --git a/specs/common/schemas/SearchParams.yml b/specs/common/schemas/SearchParams.yml
index 36adff4d767..a2296f10fd5 100644
--- a/specs/common/schemas/SearchParams.yml
+++ b/specs/common/schemas/SearchParams.yml
@@ -30,31 +30,18 @@ baseSearchParams:
type: string
description: Filter the query with numeric, facet and/or tag filters.
default: ''
- # There could be a pattern for this one (complicated one)
facetFilters:
- type: array
- items:
- type: string
description: Filter hits by facet value.
- default: []
+ $ref: '#/searchFilters'
optionalFilters:
- type: array
- items:
- type: string
description: Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter.
- default: []
+ $ref: '#/searchFilters'
numericFilters:
- type: array
- items:
- type: string
description: Filter on numeric attributes.
- default: []
+ $ref: '#/searchFilters'
tagFilters:
- type: array
- items:
- type: string
description: Filter hits by tags.
- default: []
+ $ref: '#/searchFilters'
sumOrFiltersScores:
type: boolean
description: Determines how to calculate the total score for filtering.
@@ -164,6 +151,9 @@ baseSearchParams:
type: boolean
description: Whether this search should use AI Re-Ranking.
default: true
+ reRankingApplyFilter:
+ description: When Dynamic Re-Ranking is enabled, only records that match these filters will be impacted by Dynamic Re-Ranking.
+ $ref: '#/searchFilters'
searchParamsString:
type: object
@@ -197,5 +187,23 @@ aroundRadius:
oneOf:
- type: integer
minimum: 1
- - type: string
- enum: [all]
+ - $ref: '#/aroundRadiusAll'
+
+aroundRadiusAll:
+ type: string
+ enum: [all]
+
+searchFilters:
+ oneOf:
+ - title: searchFiltersString
+ type: string
+ - title: searchFiltersArray
+ type: array
+ items:
+ type: string
+ - title: searchFiltersNestedArray
+ type: array
+ items:
+ type: array
+ items:
+ type: string
diff --git a/specs/personalization/paths/personalizationStrategy.yml b/specs/personalization/paths/personalizationStrategy.yml
index 63ec4861988..f173f423ac8 100644
--- a/specs/personalization/paths/personalizationStrategy.yml
+++ b/specs/personalization/paths/personalizationStrategy.yml
@@ -32,8 +32,6 @@ post:
'404':
$ref: ../../common/responses/IndexNotFound.yml
get:
- tags:
- - personalization
operationId: getPersonalizationStrategy
description: The strategy contains information on the events and facets that impact user profiles and personalized search results.
summary: Get the current personalization strategy.
diff --git a/specs/query-suggestions/paths/qsConfig.yml b/specs/query-suggestions/paths/qsConfig.yml
index f4f2fae7747..45ca1ebfabf 100644
--- a/specs/query-suggestions/paths/qsConfig.yml
+++ b/specs/query-suggestions/paths/qsConfig.yml
@@ -19,8 +19,6 @@ put:
$ref: ../../common/responses/InternalError.yml
delete:
- tags:
- - query-suggestions
operationId: deleteConfig
description: >
Delete a configuration of a Query Suggestion's index.
@@ -42,8 +40,6 @@ delete:
$ref: ../../common/responses/InternalError.yml
get:
- tags:
- - query-suggestions
operationId: getConfig
description: Get the configuration of a single Query Suggestions index.
summary: Get the configuration of a single Query Suggestions index.
diff --git a/specs/query-suggestions/paths/qsConfigs.yml b/specs/query-suggestions/paths/qsConfigs.yml
index fd71ca3d096..d0a2282e872 100644
--- a/specs/query-suggestions/paths/qsConfigs.yml
+++ b/specs/query-suggestions/paths/qsConfigs.yml
@@ -23,8 +23,6 @@ post:
$ref: ../../common/responses/InternalError.yml
get:
- tags:
- - query-suggestions
operationId: getAllConfigs
description: >
Get all the configurations of Query Suggestions.
diff --git a/specs/search/common/schemas/Hit.yml b/specs/search/common/schemas/Hit.yml
index 819041769a3..8850e6dfbad 100644
--- a/specs/search/common/schemas/Hit.yml
+++ b/specs/search/common/schemas/Hit.yml
@@ -68,22 +68,9 @@ rankingInfo:
type: integer
description: Precision used when computing the geo distance, in meters.
matchedGeoLocation:
- type: object
- additionalProperties:
- type: object
- additionalProperties: false
- properties:
- lat:
- type: number
- format: double
- description: Latitude of the matched location.
- lng:
- type: number
- format: double
- description: Longitude of the matched location.
- distance:
- type: integer
- description: Distance between the matched location and the search location (in meters).
+ $ref: '#/matchedGeoLocation'
+ personalization:
+ $ref: '#/personalization'
nbExactWords:
type: integer
description: Number of exactly matched words.
@@ -99,11 +86,51 @@ rankingInfo:
userScore:
type: integer
description: Custom ranking for the object, expressed as a single integer value.
- word:
+ words:
type: integer
description: Number of matched words, including prefixes and typos.
+ promotedByReRanking:
+ type: boolean
+ description: Wether the record are promoted by the re-ranking strategy.
+ required:
+ - promoted
+ - nbTypos
+ - firstMatchedWord
+ - geoDistance
+ - nbExactWords
+ - words
+ - filters
+ - userScore
highlightedValue:
type: string
description: Markup text with occurrences highlighted.
example: George Clooney
+
+matchedGeoLocation:
+ type: object
+ properties:
+ lat:
+ type: number
+ format: double
+ description: Latitude of the matched location.
+ lng:
+ type: number
+ format: double
+ description: Longitude of the matched location.
+ distance:
+ type: integer
+ description: Distance between the matched location and the search location (in meters).
+
+personalization:
+ type: object
+ properties:
+ filtersScore:
+ type: integer
+ description: The score of the filters.
+ rankingScore:
+ type: integer
+ description: The score of the ranking.
+ score:
+ type: integer
+ description: The score of the event.
diff --git a/specs/search/paths/vault/vaultSources.yml b/specs/search/paths/vault/vaultSources.yml
index 2dba28ad34d..50f7e5abf39 100644
--- a/specs/search/paths/vault/vaultSources.yml
+++ b/specs/search/paths/vault/vaultSources.yml
@@ -19,8 +19,6 @@ get:
$ref: ../../../common/responses/IndexNotFound.yml
put:
- tags:
- - search
operationId: replaceSources
description: Replace all allowed sources.
summary: Replace all allowed sources.
diff --git a/templates/javascript/model.mustache b/templates/javascript/model.mustache
index 6abed907916..5d31bae2f73 100644
--- a/templates/javascript/model.mustache
+++ b/templates/javascript/model.mustache
@@ -6,10 +6,10 @@ import { {{classname}} } from '{{filename}}';
{{! We handle types that depend on other interfaces }}
{{#interfaces.size}}
-export type {{classname}} = {{#oneOf}}{{.}} {{^-last}}|{{/-last}} {{/oneOf}}{{#allOf}}{{.}} {{^-last}}&{{/-last}} {{/allOf}};
+export type {{classname}} = {{#oneOf}}{{{.}}} {{^-last}}|{{/-last}} {{/oneOf}}{{#allOf}}{{{.}}} {{^-last}}&{{/-last}} {{/allOf}};
{{/interfaces.size}}
-{{^interfaces}}
+{{^interfaces.size}}
{{#description}}
/**
* {{{description}}}
@@ -30,6 +30,7 @@ export type {{classname}} = {
{{/vars}}
}
+{{/isEnum}}
{{#hasEnums}}
{{#vars}}
{{#isEnum}}
@@ -38,13 +39,10 @@ export type {{classname}}{{nameInCamelCase}} = {{#allowableValues}}{{#enumVars}}
{{/isEnum}}
{{/vars}}
{{/hasEnums}}
-{{/isEnum}}
-
{{#isEnum}}
export type {{classname}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}|{{/-last}}{{/enumVars}}{{/allowableValues}}
{{/isEnum}}
-
-{{/interfaces}}
+{{/interfaces.size}}
{{/model}}
{{/models}}