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

Commit 3116739

Browse files
gmourierirevoireKerollmopsbidoubiwaguimachiavelli
authored
Release v1.2.0 (#227)
* Bump OpenAPI version * CSV Content-Type — Add support for the boolean type in CSV (#228) * add support for the boolean type in csv * fix a typo * Update text/0028-indexing-csv.md --------- Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com> * Filter operators - `IS NULL` and `IS EMPTY` filter operators (#232) * Introduce the spec of the IS EMPTY filter * Introduce the spec of the IS NULL filter * Fix suggestions * Uppercase the IN operator Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com> * Fix a title number issue Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com> --------- Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com> * Search Algorithms Refactor: Relevancy Changes (#233) * Remove old exactness-criterion specification * Remove old asc-desc-criterion specification * Get and delete documents by filter (#236) * specify the new fetch documents route * update open-api * try to be nice with bumpsh * specify the new analytics of the get/fetch documents route * group the analytics behind already used groups * fix a placeholder text * group the get and fetch route under a common section * rename the section to contain the name of both routes * clarify how to send the parameter to both routes * fix the type of the parameters * add the new fetch route to the api keys actions * capitalize json Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com> * update open-api * Specify the new route to delete documents by filter * add the new analytics event * improve a comment * add the post - delete route to the api key actions * Fix the json payload Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com> * Update the details Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com> * delete the invalid_document_delete_filter error code and introduce the missing_document_filter * fix the open-api thingy --------- Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com> Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com> * Auto deletion of tasks (#238) * auto deletion of tasks * Update text/0060-tasks-api.md Co-authored-by: gui machiavelli <hey@guimachiavelli.com> * Update text/0060-tasks-api.md Co-authored-by: gui machiavelli <hey@guimachiavelli.com> --------- Co-authored-by: gui machiavelli <hey@guimachiavelli.com> * Experimental reduce indexing memory usage (#239) * Add the experimental-reduce-indexing-memory-usage option in the telemetry policies * Add the experimental-reduce-indexing-memory-usage option in the instance options * Update 0055-sort.md (#240) related to meilisearch/meilisearch#3749 * Update `payload_too_large` error `message` (#241) * Update 0061-error-format-and-definitions.md Update error message in the specification * Update open-api.yaml --------- Co-authored-by: Tamo <tamo@meilisearch.com> Co-authored-by: Clément Renault <renault.cle@gmail.com> Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com> Co-authored-by: gui machiavelli <hey@guimachiavelli.com> Co-authored-by: Many the fish <legendre.maxime.isn@gmail.com>
1 parent 4676834 commit 3116739

12 files changed

Lines changed: 426 additions & 424 deletions

open-api.yaml

Lines changed: 135 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ openapi: 3.1.0
22
info:
33
title: Meilisearch Core API
44
description: 'Search documents, configure and manage the Meilisearch engine.'
5-
version: 1.1.0
5+
version: 1.2.0
66
contact:
77
name: Meilisearch
88
email: bonjour@Meilisearch.com
@@ -1208,7 +1208,7 @@ components:
12081208
examples:
12091209
Payload Too Large:
12101210
value:
1211-
message: The provided payload reached the size limit.
1211+
message: The provided payload reached the size limit. The maximum accepted payload size is 20.00 MiB.
12121212
code: payload_too_large
12131213
type: invalid_request
12141214
link: 'https://docs.meilisearch.com/errors#payload_too_large'
@@ -1664,6 +1664,7 @@ paths:
16641664
- $ref: '#/components/parameters/limit'
16651665
- $ref: '#/components/parameters/offset'
16661666
- $ref: '#/components/parameters/fields'
1667+
- $ref: '#/components/parameters/filter'
16671668
post:
16681669
operationId: indexes.documents.create
16691670
summary: Add or replace documents
@@ -1805,6 +1806,93 @@ paths:
18051806
description: Not Found
18061807
parameters:
18071808
- $ref: '#/components/parameters/indexUid'
1809+
'/indexes/{indexUid}/documents/fetch':
1810+
post:
1811+
operationId: indexes.documents.fetch
1812+
summary: Get Documents
1813+
description: |
1814+
Get [documents](https://docs.meilisearch.com/learn/core_concepts/documents.html) by batch.
1815+
tags:
1816+
- Documents
1817+
security:
1818+
- apiKey: []
1819+
requestBody:
1820+
required: true
1821+
content:
1822+
application/json:
1823+
schema:
1824+
type: object
1825+
properties:
1826+
offset:
1827+
type: number
1828+
description: Number of documents to skip.
1829+
default: 0
1830+
limit:
1831+
type: number
1832+
description: Maximum number of documents returned.
1833+
default: 20
1834+
fields:
1835+
type: array
1836+
description: 'Array of attributes whose fields will be present in the returned documents. By default all attributes will be returned.'
1837+
items:
1838+
type: string
1839+
example: '["title", "overview"]'
1840+
default: '["*"]'
1841+
filter:
1842+
$ref: '#/components/schemas/filter'
1843+
examples:
1844+
Example:
1845+
value:
1846+
offset: 2
1847+
limit: 5
1848+
fields:
1849+
- name
1850+
- picture
1851+
filter: 'doggo = "bernese mountain"'
1852+
responses:
1853+
'200':
1854+
description: Ok
1855+
content:
1856+
application/json:
1857+
schema:
1858+
type: object
1859+
properties:
1860+
results:
1861+
type: array
1862+
items:
1863+
$ref: '#/components/schemas/document'
1864+
limit:
1865+
$ref: '#/components/schemas/limit'
1866+
offset:
1867+
$ref: '#/components/schemas/offset'
1868+
total:
1869+
$ref: '#/components/schemas/total'
1870+
required:
1871+
- results
1872+
- limit
1873+
- offset
1874+
- total
1875+
examples:
1876+
Example:
1877+
value:
1878+
results:
1879+
- id: 25684
1880+
title: American Ninja 5
1881+
poster: 'https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg'
1882+
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.'
1883+
release_date: 725846400
1884+
- id: 45881
1885+
title: The Bridge of San Luis Rey
1886+
poster: 'https://image.tmdb.org/t/p/w500/4X7quIcdkc24Cveg5XdpfRqxtYA.jpg'
1887+
overview: "The Bridge of San Luis Rey is American author Thornton Wilder's second novel, first published in 1927 to worldwide acclaim. It tells the story of several interrelated people who die in the collapse of an Inca rope-fiber suspension bridge in Peru, and the events that lead up to their being on the bridge.[ A friar who has witnessed the tragic accident then goes about inquiring into the lives of the victims, seeking some sort of cosmic answer to the question of why each had to die. The novel won the Pulitzer Prize in 1928."
1888+
release_date: 1072915200
1889+
limit: 20
1890+
offset: 0
1891+
total: 2
1892+
'401':
1893+
$ref: '#/components/responses/401'
1894+
'404':
1895+
description: Not Found
18081896
'/indexes/{indexUid}/documents/delete-batch':
18091897
post:
18101898
operationId: indexes.documents.removeBatch
@@ -1850,6 +1938,51 @@ paths:
18501938
- $ref: '#/components/parameters/Content-Type'
18511939
parameters:
18521940
- $ref: '#/components/parameters/indexUid'
1941+
'/indexes/{indexUid}/documents/delete':
1942+
post:
1943+
operationId: indexes.documents.remove
1944+
summary: Delete documents
1945+
description: Delete a selection of documents based on a filter.
1946+
tags:
1947+
- Documents
1948+
security:
1949+
- apiKey: []
1950+
requestBody:
1951+
required: true
1952+
content:
1953+
application/json:
1954+
schema:
1955+
type: object
1956+
properties:
1957+
filter:
1958+
$ref: '#/components/schemas/filter'
1959+
examples:
1960+
Example:
1961+
value:
1962+
offset: 2
1963+
limit: 5
1964+
fields:
1965+
- name
1966+
- picture
1967+
filter: 'doggo = "bernese mountain"'
1968+
responses:
1969+
'202':
1970+
description: Accepted
1971+
content:
1972+
application/json:
1973+
schema:
1974+
$ref: '#/components/responses/202'
1975+
examples:
1976+
'202':
1977+
$ref: '#/components/examples/202_documentDeletion'
1978+
'401':
1979+
$ref: '#/components/responses/401'
1980+
'404':
1981+
description: Not Found
1982+
parameters:
1983+
- $ref: '#/components/parameters/Content-Type'
1984+
parameters:
1985+
- $ref: '#/components/parameters/indexUid'
18531986
'/indexes/{indexUid}/documents/{documentId}':
18541987
get:
18551988
operationId: indexes.documents.get

text/0028-indexing-csv.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ While there's [RFC 4180](https://tools.ietf.org/html/rfc4180) as a try to add a
3838

3939
- CSV data format needs to contain a first line representing the list of attributes with the optionally chosen type separated from the attribute name by `:` character. The type is case insensitive.
4040

41-
> An attribute can be specificed with two types: `string` or `number`. A missing type will be interpreted as a `string` by default.
41+
> An attribute can be specificed with three types: `string`, `boolean` or `number`. A missing type will be interpreted as a `string` by default.
4242
>
43-
> Valid headline example: "id:number","title:string","author","price:number"
43+
> Valid headline example: "id:number","title:string","author","price:number","cute:boolean"
4444
4545
- The following CSV lines will represent a document for Meilisearch.
4646
- A `,` character must separate each cell.
@@ -57,14 +57,15 @@ While there's [RFC 4180](https://tools.ietf.org/html/rfc4180) as a try to add a
5757
##### `null` value
5858

5959
- If a field is of type `string`, then an empty cell is considered as a `null` value (e.g. `,,`), anything else is turned into a string value (e.g. `, ,` is a single whitespace string)
60-
- If a field is of type `number`, when the trimmed field is empty, it's considered as a `null` value (e.g. `,,` `, ,`); otherwise Meilisearch try to parse the number.
60+
- If a field is of type `number`, when the trimmed field is empty, it's considered as a `null` value (e.g. `,,` `, ,`); otherwise, Meilisearch tries to parse the number.
61+
- If a field is of type `boolean`, when the trimmed field is empty, it's considered as a `null` value (e.g. `,,` `, ,`); otherwise, Meilisearch tries to parse the boolean as either `true` or `false`.
6162

6263
##### Example with a comma inside a cell
6364

6465
Given the CSV payload
6566
```
66-
"id:number","label","price:number","colors","description"
67-
"1","t-shirt","4.99","red","Thus, you will rock at summer time."
67+
"id:number","label","price:number","colors","description","contains_a_dog_picture:boolean"
68+
"1","t-shirt","4.99","red","Thus, you will rock at summer time.","false"
6869
```
6970
the search result should be displayed as
7071
```json
@@ -75,7 +76,8 @@ the search result should be displayed as
7576
"label": "t-shirt",
7677
"price": 4.99,
7778
"colors": "red",
78-
"description": "Hey, you will rock at summer time."
79+
"description": "Thus, you will rock at summer time.",
80+
"contains_a_dog_picture": false
7981
}
8082
],
8183
...
@@ -172,6 +174,7 @@ curl \
172174
- 🔴 Sending an invalid CSV format will lead to a 400 bad_request - **malformed_payload** error code.
173175
- 🔴 Sending a CSV header that does not conform to the specification will lead to a 400 bad_request - **malformed_payload** error code.
174176
- 🔴 Sending an invalid csv delimiter: not exactly one ASCII char. This will lead to a 400 bad_request - **invalid_document_csv_delimiter** error code.
177+
- 🔴 Sending a CSV cell with the type `number` or `boolean` that can't be parsed will lead to a 400 bad_request - **malformed_payload** error code.
175178

176179
##### Errors Definition
177180

0 commit comments

Comments
 (0)