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

Commit 61fd59c

Browse files
authored
Search API - Remove/Rename confusing fields (#135)
* Rename nbHits, remove exhaustive* boolean fields * Rename approximativeNbHits to estimatedTotalHits * Update open-api.yaml * Apply naming changes for facet distribution and showing matches position * Add a telemetry for facet distribution usage
1 parent 74989bd commit 61fd59c

File tree

4 files changed

+68
-94
lines changed

4 files changed

+68
-94
lines changed

open-api.yaml

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ components:
8686
overview: 'When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja.'
8787
release_date: '1993-01-01'
8888
description: 'A document made of attribute. The maximum number of attribute for a document is 65,535.'
89-
matchesInfo:
89+
matchesPosition:
9090
type: object
9191
properties:
9292
start:
@@ -113,7 +113,7 @@ components:
113113
poster: 'https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg'
114114
overview: 'When a scientists daughter is kidnapped, American <em>Ninja</em>, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the <em>ninja</em>.'
115115
release_date: '1993-01-01'
116-
_matchesInfo:
116+
_matchesPosition:
117117
overview:
118118
- start: 49
119119
length: 5
@@ -131,7 +131,7 @@ components:
131131
poster: 'https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg'
132132
overview: 'When a scientists daughter is kidnapped, American <em>Ninja</em>, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the <em>ninja</em>.'
133133
release_date: '1993-01-01'
134-
_matchesInfo:
134+
_matchesPosition:
135135
overview:
136136
- start: 49
137137
length: 5
@@ -143,12 +143,12 @@ components:
143143
type: object
144144
description: Only present if `attributesToHighlight`/`attributesToCrop` is not empty. Return highlighted and cropped fields.
145145
additionalProperties: true
146-
_matchesInfo:
146+
_matchesPosition:
147147
type: object
148-
description: Only present if matches = `true`. Array of all search query occurrences in all fields.
148+
description: Only present if showMatchesPosition = `true`. Array of all search query occurrences in all fields.
149149
properties:
150150
'':
151-
$ref: '#/components/schemas/matchesInfo'
151+
$ref: '#/components/schemas/matchesPosition'
152152
attribute:
153153
type:
154154
- string
@@ -228,20 +228,17 @@ components:
228228
limit:
229229
type: integer
230230
description: Number of returned documents.
231-
nbHits:
231+
estimatedTotalHits:
232232
type: integer
233-
description: Total number of candidates for this search in the database.
234-
exhaustiveNbHits:
235-
type: boolean
236-
description: Whether `nbHits` is exhaustive.
237-
facetsDistribution:
233+
description: Estimated number of candidates for the search query.
234+
facetDistribution:
238235
type: object
239236
additionalProperties:
240237
type: object
241238
additionalProperties:
242239
type: integer
243240
description: |
244-
[Distribution of the given facets](https://docs.meilisearch.com/reference/features/search_parameters.html#facets-distribution).
241+
[Distribution of the given facets](https://docs.meilisearch.com/reference/features/search_parameters.html#facet-distribution).
245242
example:
246243
genres:
247244
action: 273
@@ -251,9 +248,6 @@ components:
251248
comedy: 475
252249
mystery: 70
253250
thriller: 217
254-
exhaustiveFacetsCount:
255-
type: boolean
256-
description: Whether `facetsDistribution` is exhaustive.
257251
processingTimeMs:
258252
type: integer
259253
description: Processing time of the query.
@@ -265,8 +259,7 @@ components:
265259
- hits
266260
- offset
267261
- limit
268-
- nbHits
269-
- exhaustiveNbHits
262+
- estimatedTotalHits
270263
- processingTimeMs
271264
- query
272265
task:
@@ -769,21 +762,21 @@ components:
769762
example: 5
770763
default: 10
771764
description: Sets the total number of words to keep around the matched part of an attribute specified in the `attributesToCrop` parameter.
772-
facetsDistribution:
773-
name: facetsDistribution
765+
facets:
766+
name: facets
774767
in: query
775768
schema:
776769
type: string
777770
example: 'genres,author'
778-
description: 'Comma-separated list of attributes whose fields will be distributed as a facet. If you have [set up filterableAttributes](https://docs.meilisearch.com/reference/features/settings.html#filterable-attributes), you can retrieve the count of matching terms for each facets.[Learn more about facet distribution in the dedicated guide](https://docs.meilisearch.com/reference/features/search_parameters.html#facets-distribution)'
779-
matches:
780-
name: matches
771+
description: 'Comma-separated list of attributes whose fields will be distributed as a facet. If you have [set up filterableAttributes](https://docs.meilisearch.com/reference/features/settings.html#filterable-attributes), you can retrieve the count of matching terms for each facets.[Learn more about facet distribution in the dedicated guide](https://docs.meilisearch.com/reference/features/search_parameters.html#facet-distribution)'
772+
showMatchesPosition:
773+
name: showMatchesPosition
781774
in: query
782775
required: false
783776
schema:
784777
type: boolean
785778
default: 'false'
786-
description: Defines whether an `_matchesInfo` object that contains information about the matches should be returned or not.
779+
description: Defines whether an `_matchesPosition` object that contains information about the matches should be returned or not.
787780
sort:
788781
name: sort
789782
in: query
@@ -1432,12 +1425,12 @@ paths:
14321425
- $ref: '#/components/parameters/attributesToCrop'
14331426
- $ref: '#/components/parameters/cropMarker'
14341427
- $ref: '#/components/parameters/cropLength'
1435-
- $ref: '#/components/parameters/facetsDistribution'
1428+
- $ref: '#/components/parameters/facets'
14361429
- $ref: '#/components/parameters/filter'
14371430
- $ref: '#/components/parameters/offset'
14381431
- $ref: '#/components/parameters/sort'
14391432
- $ref: '#/components/parameters/limit'
1440-
- $ref: '#/components/parameters/matches'
1433+
- $ref: '#/components/parameters/showMatchesPosition'
14411434
responses:
14421435
'200':
14431436
description: Ok
@@ -1460,17 +1453,16 @@ paths:
14601453
poster: 'https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg'
14611454
overview: 'When a scientists daughter is kidnapped, American <em>Ninja</em>, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the <em>ninja</em>.'
14621455
release_date: '1993-01-01'
1463-
_matchesInfo:
1456+
_matchesPosition:
14641457
overview:
14651458
- start: 49
14661459
length: 5
14671460
- start: 155
14681461
length: 5
14691462
limit: 0
14701463
offset: 0
1471-
nbHits: 0
1464+
estimatedTotalHits: 0
14721465
query: string
1473-
exhaustiveNbHits: true
14741466
processingTimeMs: 0
14751467
'401':
14761468
$ref: '#/components/responses/401'
@@ -1539,15 +1531,15 @@ paths:
15391531
type: number
15401532
description: Sets the total number of **words** to keep for the cropped part of an attribute specified in the `attributesToCrop` parameter.
15411533
default: 10
1542-
matches:
1534+
showMatchesPosition:
15431535
type: boolean
1544-
description: Defines whether an `_matchesInfo` object that contains information about the matches should be returned or not.
1536+
description: Defines whether an `_matchesPosition` object that contains information about the matches should be returned or not.
15451537
default: false
15461538
filter:
15471539
$ref: '#/components/schemas/filter'
1548-
facetsDistribution:
1540+
facets:
15491541
type: array
1550-
description: 'Array of attributes whose fields will be distributed as a facet. If you have [set up filterableAttributes](https://docs.meilisearch.com/reference/features/settings.html#filterable-attributes), you can retrieve the count of matching terms for each [facets](https://docs.meilisearch.com/reference/features/filtering_and_faceted_search.html#faceted-search).[Learn more about facet distribution in the dedicated guide](https://docs.meilisearch.com/reference/features/search_parameters.html#facets-distribution)'
1542+
description: 'Array of attributes whose fields will be distributed as a facet. If you have [set up filterableAttributes](https://docs.meilisearch.com/reference/features/settings.html#filterable-attributes), you can retrieve the count of matching terms for each [facets](https://docs.meilisearch.com/reference/features/filtering_and_faceted_search.html#faceted-search).[Learn more about facet distribution in the dedicated guide](https://docs.meilisearch.com/reference/features/search_parameters.html#facet-distribution)'
15511543
items:
15521544
type: string
15531545
example: '["genres", "author"]'
@@ -1569,7 +1561,7 @@ paths:
15691561
offset: 0
15701562
limit: 20
15711563
filter: (genres = Horror AND genres = Mystery) OR release_date > 523242000
1572-
facetsDistribution:
1564+
facets:
15731565
- genres
15741566
- author
15751567
attributesToRetrieve:
@@ -1580,7 +1572,7 @@ paths:
15801572
cropLength: 20
15811573
attributesToHighlight:
15821574
- overview
1583-
matches: true
1575+
showMatchesPosition: true
15841576
responses:
15851577
'200':
15861578
description: Ok
@@ -1603,17 +1595,16 @@ paths:
16031595
poster: 'https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg'
16041596
overview: 'When a scientists daughter is kidnapped, American <em>Ninja</em>, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the <em>ninja</em>.'
16051597
release_date: '1993-01-01'
1606-
_matchesInfo:
1598+
_matchesPosition:
16071599
overview:
16081600
- start: 49
16091601
length: 5
16101602
- start: 155
16111603
length: 5
16121604
limit: 0
16131605
offset: 0
1614-
nbHits: 0
1606+
estimatedTotalHits: 0
16151607
query: string
1616-
exhaustiveNbHits: true
16171608
processingTimeMs: 0
16181609
'401':
16191610
$ref: '#/components/responses/401'

text/0034-telemetry-policies.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ The collected data is sent to [Segment](https://segment.com/). Segment is a plat
3535

3636
[Amplitude](https://amplitude.com/) is a tool for graphing and highlighting collected data. Segment feeds Amplitude so that we can build visualizations according to our needs.
3737

38-
3938
----
4039

4140
#### Events table
@@ -113,7 +112,8 @@ The collected data is sent to [Segment](https://segment.com/). Segment is a plat
113112
| `formatting.highlight_post_tag` | `true` if `highlightPostTag` was used in this batch, otherwise `false` | false | `Documents Searched POST`, `Documents Searched GET` |
114113
| `formatting.crop_length` | `true` if `cropLength` was used in this batch, otherwise `false` | false | `Documents Searched POST`, `Documents Searched GET` |
115114
| `formatting.crop_marker` | `true` if `cropMarker` was used in this batch, otherwise `false` | false | `Documents Searched POST`, `Documents Searched GET` |
116-
| `formatting.matches` | `true` if `matches` was used in this batch, otherwise `false` | false | `Documents Searched POST`, `Documents Searched GET` |
115+
| `formatting.show_matches_position` | `true` if `showMatchesPosition` was used in this batch, otherwise `false` | false | `Documents Searched POST`, `Documents Searched GET` |
116+
| `facets` | `true` if `facets` was used in this batch, otherwise `false` | false | `Documents Searched POST`, `Documents Searched GET` |
117117
| `primary_key` | Value given for the `primaryKey` parameter if used, otherwise `null` | id | `Index Created`, `Index Updated`, `Documents Added`, `Documents Updated`|
118118
| `payload_type` | All `payload_type` encountered in this batch | ["application/json", "text/plain", "application/x-ndjson"] | `Documents Added`, `Documents Updated` |
119119
| `index_creation` | `true` if a document addition or update request triggered index creation in this batch, otherwise `false` | true | `Documents Added`, `Documents Updated` |
@@ -133,7 +133,6 @@ The collected data is sent to [Segment](https://segment.com/). Segment is a plat
133133
| `filtered_by_type` | `true` if `GET /tasks` endpoint is filered by `type`, otherwise `false` | false | `Tasks Seen` |
134134
| `filtered_by_status` | `true` if `GET /tasks` endpoint is filered by `status`, otherwise `false` | false | `Tasks Seen` |
135135

136-
137136
----
138137

139138
#### Detailed list of Instance metrics and, events with their metrics
@@ -218,7 +217,8 @@ This property allows us to gather essential information to better understand on
218217
| formatting.highlight_post_tag | Does `highlightPostTag` has been used in the aggregated event? If yes, `true` otherwise `false` | `false` |
219218
| formatting.crop_length | Does `cropLength` has been used in the aggregated event? If yes, `true` otherwise `false` | `false` |
220219
| formatting.crop_marker | Does `cropMarker` has been used in the aggregated event? If yes, `true` otherwise `false` | `false` |
221-
| formatting.matches | Does `matches` has been used in the aggregated event? If yes, `true` otherwise `false` | `false` |
220+
| formatting.show_matches_position | Does `showMatchesPosition` has been used in the aggregated event? If yes, `true` otherwise `false` | `false` |
221+
| facets | Does `facets` has been used in the aggregated event? If yes, `true` otherwise `false` | `false` |
222222

223223
---
224224

@@ -245,7 +245,8 @@ This property allows us to gather essential information to better understand on
245245
| formatting.highlight_post_tag | Does `highlightPostTag` has been used in the aggregated event? If yes, `true` otherwise `false` | `false` |
246246
| formatting.crop_length | Does `cropLength` has been used in the aggregated event? If yes, `true` otherwise `false` | `false` |
247247
| formatting.crop_marker | Does `cropMarker` has been used in the aggregated event? If yes, `true` otherwise `false` | `false` |
248-
| formatting.matches | Does `matches` has been used in the aggregated event? If yes, `true` otherwise `false` | `false` |
248+
| formatting.show_matches_position | Does `showMatchesPosition` has been used in the aggregated event? If yes, `true` otherwise `false` | `false` |
249+
| facets | Does `facets` has been used in the aggregated event? If yes, `true` otherwise `false` | `false` |
249250

250251
---
251252

@@ -347,7 +348,6 @@ This property allows us to gather essential information to better understand on
347348
| user_agent | Represents the user-agent encountered on this call. | `["Meilisearch Ruby (v2.1)", "Ruby (3.0)"]` |
348349
| searchable_attributes.total | Number of searchable attributes. | `3` |
349350

350-
351351
## `TypoTolerance Updated`
352352

353353
| Property name | Description | Example |

0 commit comments

Comments
 (0)