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

Commit

Permalink
Search API - Remove/Rename confusing fields (#135)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
gmourier committed Jul 7, 2022
1 parent f01752e commit 65e7ace
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 94 deletions.
67 changes: 29 additions & 38 deletions open-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ components:
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.'
release_date: '1993-01-01'
description: 'A document made of attribute. The maximum number of attribute for a document is 65,535.'
matchesInfo:
matchesPosition:
type: object
properties:
start:
Expand All @@ -113,7 +113,7 @@ components:
poster: 'https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg'
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>.'
release_date: '1993-01-01'
_matchesInfo:
_matchesPosition:
overview:
- start: 49
length: 5
Expand All @@ -131,7 +131,7 @@ components:
poster: 'https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg'
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>.'
release_date: '1993-01-01'
_matchesInfo:
_matchesPosition:
overview:
- start: 49
length: 5
Expand All @@ -143,12 +143,12 @@ components:
type: object
description: Only present if `attributesToHighlight`/`attributesToCrop` is not empty. Return highlighted and cropped fields.
additionalProperties: true
_matchesInfo:
_matchesPosition:
type: object
description: Only present if matches = `true`. Array of all search query occurrences in all fields.
description: Only present if showMatchesPosition = `true`. Array of all search query occurrences in all fields.
properties:
'':
$ref: '#/components/schemas/matchesInfo'
$ref: '#/components/schemas/matchesPosition'
attribute:
type:
- string
Expand Down Expand Up @@ -228,20 +228,17 @@ components:
limit:
type: integer
description: Number of returned documents.
nbHits:
estimatedTotalHits:
type: integer
description: Total number of candidates for this search in the database.
exhaustiveNbHits:
type: boolean
description: Whether `nbHits` is exhaustive.
facetsDistribution:
description: Estimated number of candidates for the search query.
facetDistribution:
type: object
additionalProperties:
type: object
additionalProperties:
type: integer
description: |
[Distribution of the given facets](https://docs.meilisearch.com/reference/features/search_parameters.html#facets-distribution).
[Distribution of the given facets](https://docs.meilisearch.com/reference/features/search_parameters.html#facet-distribution).
example:
genres:
action: 273
Expand All @@ -251,9 +248,6 @@ components:
comedy: 475
mystery: 70
thriller: 217
exhaustiveFacetsCount:
type: boolean
description: Whether `facetsDistribution` is exhaustive.
processingTimeMs:
type: integer
description: Processing time of the query.
Expand All @@ -265,8 +259,7 @@ components:
- hits
- offset
- limit
- nbHits
- exhaustiveNbHits
- estimatedTotalHits
- processingTimeMs
- query
task:
Expand Down Expand Up @@ -769,21 +762,21 @@ components:
example: 5
default: 10
description: Sets the total number of words to keep around the matched part of an attribute specified in the `attributesToCrop` parameter.
facetsDistribution:
name: facetsDistribution
facets:
name: facets
in: query
schema:
type: string
example: 'genres,author'
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)'
matches:
name: matches
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)'
showMatchesPosition:
name: showMatchesPosition
in: query
required: false
schema:
type: boolean
default: 'false'
description: Defines whether an `_matchesInfo` object that contains information about the matches should be returned or not.
description: Defines whether an `_matchesPosition` object that contains information about the matches should be returned or not.
sort:
name: sort
in: query
Expand Down Expand Up @@ -1432,12 +1425,12 @@ paths:
- $ref: '#/components/parameters/attributesToCrop'
- $ref: '#/components/parameters/cropMarker'
- $ref: '#/components/parameters/cropLength'
- $ref: '#/components/parameters/facetsDistribution'
- $ref: '#/components/parameters/facets'
- $ref: '#/components/parameters/filter'
- $ref: '#/components/parameters/offset'
- $ref: '#/components/parameters/sort'
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/matches'
- $ref: '#/components/parameters/showMatchesPosition'
responses:
'200':
description: Ok
Expand All @@ -1460,17 +1453,16 @@ paths:
poster: 'https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg'
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>.'
release_date: '1993-01-01'
_matchesInfo:
_matchesPosition:
overview:
- start: 49
length: 5
- start: 155
length: 5
limit: 0
offset: 0
nbHits: 0
estimatedTotalHits: 0
query: string
exhaustiveNbHits: true
processingTimeMs: 0
'401':
$ref: '#/components/responses/401'
Expand Down Expand Up @@ -1539,15 +1531,15 @@ paths:
type: number
description: Sets the total number of **words** to keep for the cropped part of an attribute specified in the `attributesToCrop` parameter.
default: 10
matches:
showMatchesPosition:
type: boolean
description: Defines whether an `_matchesInfo` object that contains information about the matches should be returned or not.
description: Defines whether an `_matchesPosition` object that contains information about the matches should be returned or not.
default: false
filter:
$ref: '#/components/schemas/filter'
facetsDistribution:
facets:
type: array
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)'
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)'
items:
type: string
example: '["genres", "author"]'
Expand All @@ -1569,7 +1561,7 @@ paths:
offset: 0
limit: 20
filter: (genres = Horror AND genres = Mystery) OR release_date > 523242000
facetsDistribution:
facets:
- genres
- author
attributesToRetrieve:
Expand All @@ -1580,7 +1572,7 @@ paths:
cropLength: 20
attributesToHighlight:
- overview
matches: true
showMatchesPosition: true
responses:
'200':
description: Ok
Expand All @@ -1603,17 +1595,16 @@ paths:
poster: 'https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg'
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>.'
release_date: '1993-01-01'
_matchesInfo:
_matchesPosition:
overview:
- start: 49
length: 5
- start: 155
length: 5
limit: 0
offset: 0
nbHits: 0
estimatedTotalHits: 0
query: string
exhaustiveNbHits: true
processingTimeMs: 0
'401':
$ref: '#/components/responses/401'
Expand Down
12 changes: 6 additions & 6 deletions text/0034-telemetry-policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ The collected data is sent to [Segment](https://segment.com/). Segment is a plat

[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.


----

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


----

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

---

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

---

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


## `TypoTolerance Updated`

| Property name | Description | Example |
Expand Down
Loading

0 comments on commit 65e7ace

Please sign in to comment.