Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Commit a317e95

Browse files
dureuillmacraig
andauthored
Experimental features (#250)
* Fix various typos * Fix wrongly tagged routes in open api * Telemetry policy * Add new error and api keys actions * Add experimental features and experimental feature API specs * Update open API * Score details (#252) * ranking score spec * search API changes * telemetry policies score * open api * Fix typos in spec Co-authored-by: Maria Craig <marycraig90@gmail.com> * Add multi search telemetry --------- Co-authored-by: Maria Craig <marycraig90@gmail.com> --------- Co-authored-by: Maria Craig <marycraig90@gmail.com>
1 parent aeea752 commit a317e95

9 files changed

Lines changed: 753 additions & 55 deletions

open-api.yaml

Lines changed: 262 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,157 @@ components:
117117
- start
118118
- length
119119
description: Starting position and length in bytes of the matched term in the returned value
120+
order:
121+
type: integer
122+
description: The order that this ranking rule was applied
123+
customRankingRuleDetails:
124+
type: object
125+
properties:
126+
order:
127+
$ref: '#/components/schemas/order'
128+
value:
129+
type:
130+
- string
131+
- number
132+
- point
133+
description: The value that was used for sorting this document
134+
distance:
135+
type: number
136+
description: The distance between the target point and the geoPoint in the document
137+
required:
138+
- order
139+
- value
140+
description: Custom rule in the form of either `attribute:direction` or `_geoPoint(lat, lng):direction`.
141+
score:
142+
type: number
143+
description: |
144+
The relevancy score of a document according to a ranking rule and relative to a search query. Higher is better.
145+
146+
`1.0` indicates a perfect match, `0.0` no match at all (Meilisearch should not return documents that don't match the query).
147+
rankingScoreDetails:
148+
type: object
149+
properties:
150+
words:
151+
type: object
152+
properties:
153+
order:
154+
$ref: '#/components/schemas/order'
155+
matchingWords:
156+
type: integer
157+
description: the number of words from the query found
158+
maxMatchingWords:
159+
type: integer
160+
score:
161+
$ref: '#/components/schemas/score'
162+
required:
163+
- order
164+
- matchingWords
165+
- maxMatchingWords
166+
- score
167+
typo:
168+
type: object
169+
properties:
170+
order:
171+
$ref: '#/components/schemas/order'
172+
typoCount:
173+
type: integer
174+
description: The number of typos to correct in the query to match that document.
175+
maxTypoCount:
176+
type: integer
177+
description: The maximum number of typos that can be corrected in the query to match a document.
178+
score:
179+
$ref: '#/components/schemas/score'
180+
required:
181+
- order
182+
- typoCount
183+
- maxTypoCount
184+
- score
185+
proximity:
186+
type: object
187+
properties:
188+
order:
189+
$ref: '#/components/schemas/order'
190+
score:
191+
$ref: '#/components/schemas/score'
192+
required:
193+
- order
194+
- score
195+
attribute:
196+
type: object
197+
properties:
198+
order:
199+
$ref: '#/components/schemas/order'
200+
attribute_ranking_order_score:
201+
type: number
202+
description: |
203+
Score computed depending on the first attribute each word of the query appears in.
204+
205+
The first attribute in the `searchableAttributes` list yields the highest score, the last attribute the lowest.
206+
query_word_distance_score:
207+
type: number
208+
description: |
209+
Score computed depending on the position the attributes where each word of the query appears in.
210+
211+
Words appearing in an attribute at the same position as in the query yield the highest score. The greater the distance to the position
212+
in the query, the lower the score.
213+
score:
214+
$ref: '#/components/schemas/score'
215+
required:
216+
- order
217+
- attribute_ranking_order_score
218+
- query_word_distance_score
219+
- score
220+
exactness:
221+
type: object
222+
properties:
223+
order:
224+
$ref: '#/components/schemas/order'
225+
matchType:
226+
type: string
227+
description: |
228+
One of `exactMatch`, `matchesStart` or `noExactMatch`.
229+
- `exactMatch`: the document contains an attribute that exactly matches the query.
230+
- `matchesStart`: the document contains an attribute that exactly starts with the query.
231+
- `noExactMatch`: any other document.
232+
score:
233+
$ref: '#/components/schemas/score'
234+
required:
235+
- order
236+
- matchType
237+
- score
238+
additionalProperties:
239+
$ref: '#/components/schemas/customRankingRuleDetails'
240+
description: (EXPERIMENTAL) The ranking score per ranking rule.
241+
examples:
242+
With sort:
243+
words:
244+
order: 0
245+
matchingWords: 7
246+
maxMatchingWords: 7
247+
score: 1.0
248+
"typo":
249+
"order": 1
250+
"typoCount": 0
251+
"maxTypoCount": 0
252+
"score": 1.0
253+
"proximity":
254+
"order": 2,
255+
"score": 1.0
256+
"attribute":
257+
"order": 3
258+
"attribute_ranking_order_score": 1.0
259+
"query_word_distance_score": 1.0
260+
"score": 1.0
261+
"title:asc":
262+
"order": 4
263+
"value": "batman: the dark knight returns, part 1"
264+
"release_date:desc":
265+
"order": 5
266+
"value": 1345507200.0
267+
"exactness":
268+
"order": 6
269+
"matchType": "exactMatch"
270+
"score": 1.0
120271
hit:
121272
type: object
122273
additionalProperties: true
@@ -168,6 +319,15 @@ components:
168319
properties:
169320
'':
170321
$ref: '#/components/schemas/matchesPosition'
322+
_rankingScore:
323+
type: number
324+
description: Only present if showRankingScore = `true`. The ranking score of that document.
325+
_rankingScoreDetails:
326+
type: object
327+
description: (EXPERIMENTAL) Only present if showRankingScoreDetails = `true`. The ranking score of each ranking rule for that document.
328+
properties:
329+
'':
330+
$ref: '#/components/schemas/rankingScoreDetails'
171331
attribute:
172332
type:
173333
- string
@@ -759,6 +919,14 @@ components:
759919
type: boolean
760920
description: Defines whether an `_matchesPosition` object that contains information about the matches should be returned or not.
761921
default: false
922+
showRankingScore:
923+
type: boolean
924+
description: Defines whether a `_rankingScore` number representing the relevancy score of that document should be returned or not.
925+
default: false
926+
showRankingScoreDetails:
927+
type: boolean
928+
description: (EXPERIMENTAL) Defines whether a `_rankingScoreDetails` object containing information about the score of that document for each ranking rule should be returned or not.
929+
default: false
762930
matchingStrategy:
763931
type: string
764932
description: Defines which strategy to use to match the query terms within the documents as search results. Two different strategies are available, `last` and `all`. By default, the `last` strategy is chosen.
@@ -813,6 +981,8 @@ components:
813981
attributesToHighlight:
814982
- overview
815983
showMatchesPosition: true
984+
showRankingScore: true
985+
wordsMatchingStrategy: all
816986
matchingStrategy: all
817987
facetSearchQuery:
818988
type: object
@@ -905,6 +1075,8 @@ components:
9051075
- keys.create
9061076
- keys.update
9071077
- keys.delete
1078+
- experimental.get
1079+
- experimental.update
9081080
indexes:
9091081
type: array
9101082
description: 'A list of accesible indexes permitted for the key. ["*"] for all indexes. The * character can be used as a wildcard when located at the last position. e.g. "products_*"" to allow access to all indexes whose names start with "products_".'
@@ -1432,6 +1604,10 @@ tags:
14321604
During a [dump export](https://docs.meilisearch.com/reference/api/dump.html#create-a-dump), all indexes of the current instance are exported—together with their documents and settings—and saved as a single `.dump` file.
14331605
During a dump import, all indexes contained in the indicated `.dump` file are imported along with their associated documents and settings. Any existing index with the same uid as an index in the dump file will be overwritten.
14341606
Dump imports are [performed at launch](https://docs.meilisearch.com/reference/features/configuration.html#import-dump) using an option.
1607+
- name: Experimental
1608+
description: |
1609+
The `experimental-features` endpoint allows enabling and disabling [experimental features](https://github.com/meilisearch/engine-team/blob/main/resources/experimental-features.md) at runtime.
1610+
Experimental features are features that are not yet covered by [Meilisearch's stability guarantee](https://github.com/meilisearch/engine-team/blob/main/resources/versioning-policy.md) and that could break between minor and patch Meilisearch versions.
14351611
paths:
14361612
/dumps:
14371613
post:
@@ -3900,7 +4076,7 @@ paths:
39004076
summary: Get all tasks
39014077
description: 'Get all [tasks](https://docs.meilisearch.com/learn/advanced/asynchronous_operations.html)'
39024078
tags:
3903-
- tasks
4079+
- Tasks
39044080
responses:
39054081
'200':
39064082
description: OK
@@ -3986,7 +4162,7 @@ paths:
39864162
summary: Delete tasks
39874163
description: 'Delete finished [tasks](https://docs.meilisearch.com/lean/advanced/asynchronous_operations.html)'
39884164
tags:
3989-
- tasks
4165+
- Tasks
39904166
responses:
39914167
'202':
39924168
description: Accepted
@@ -4023,7 +4199,7 @@ paths:
40234199
summary: Get a task
40244200
description: 'Get a [task](https://docs.meilisearch.com/learn/advanced/asynchronous_operations.html) '
40254201
tags:
4026-
- tasks
4202+
- Tasks
40274203
responses:
40284204
'200':
40294205
description: OK
@@ -4072,7 +4248,7 @@ paths:
40724248
summary: Cancel tasks
40734249
description: 'Cancel enqueued and/or processing [tasks](https://docs.meilisearch.com/learn/advanced/asynchronous_operations.html) '
40744250
tags:
4075-
- tasks
4251+
- Tasks
40764252
responses:
40774253
'202':
40784254
description: Accepted
@@ -4141,12 +4317,93 @@ paths:
41414317
$ref: '#/components/responses/401'
41424318
parameters:
41434319
- $ref: '#/components/parameters/taskUid'
4320+
'/experimental-features':
4321+
get:
4322+
operationId: experimental.get
4323+
security:
4324+
- apiKey: []
4325+
summary: (EXPERIMENTAL) Get the status of runtime experimental features
4326+
description: 'Get the status of all experimental features that can be toggled at runtime'
4327+
tags:
4328+
- Experimental
4329+
responses:
4330+
'200':
4331+
description: Ok
4332+
content:
4333+
application/json:
4334+
schema:
4335+
type: object
4336+
additionalProperties: false
4337+
properties:
4338+
vectorStore:
4339+
type: boolean
4340+
scoreDetails:
4341+
type: boolean
4342+
required:
4343+
- vectorStore
4344+
- scoreDetails
4345+
examples:
4346+
Default status of the features:
4347+
value:
4348+
vectorStore: false
4349+
scoreDetails: false
4350+
'401':
4351+
$ref: '#/components/responses/401'
4352+
patch:
4353+
operationId: experimental.update
4354+
security:
4355+
- apiKey: []
4356+
summary: (EXPERIMENTAL) Set the status of runtime experimental features
4357+
description: 'Set the status of experimental features that can be toggled at runtime'
4358+
tags:
4359+
- Experimental
4360+
requestBody:
4361+
required: true
4362+
content:
4363+
application/json:
4364+
schema:
4365+
type: object
4366+
properties:
4367+
vectorStore:
4368+
type: boolean
4369+
scoreDetails:
4370+
type: boolean
4371+
additionalProperties: false
4372+
examples:
4373+
Example:
4374+
value:
4375+
vectorStore: true
4376+
scoreDetails: false
4377+
responses:
4378+
'200':
4379+
description: Ok
4380+
content:
4381+
application/json:
4382+
schema:
4383+
type: object
4384+
additionalProperties: false
4385+
properties:
4386+
vectorStore:
4387+
type: boolean
4388+
scoreDetails:
4389+
type: boolean
4390+
required:
4391+
- vectorStore
4392+
- scoreDetails
4393+
examples:
4394+
Updated status of the feature:
4395+
value:
4396+
vectorStore: true
4397+
scoreDetails: false
4398+
'401':
4399+
$ref: '#/components/responses/401'
41444400
/metrics:
41454401
get:
41464402
summary: (EXPERIMENTAL) Get prometheus format metrics for observability and monitoring
41474403
description: 'See [technical specification](https://github.com/meilisearch/specifications/blob/main/text/0174-metrics-api.md)'
41484404
tags:
4149-
- stats
4405+
- Stats
4406+
- Experimental
41504407
responses:
41514408
'200':
41524409
description: OK

0 commit comments

Comments
 (0)