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

Commit

Permalink
Release v1.2.0 (#227)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* 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 <[email protected]>

* Fix a title number issue

Co-authored-by: Guillaume Mourier <[email protected]>

---------

Co-authored-by: Guillaume Mourier <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* Apply suggestions from code review

Co-authored-by: Guillaume Mourier <[email protected]>

* Update the details

Co-authored-by: Guillaume Mourier <[email protected]>

* delete the invalid_document_delete_filter error code and introduce the missing_document_filter

* fix the open-api thingy

---------

Co-authored-by: cvermand <[email protected]>
Co-authored-by: Guillaume Mourier <[email protected]>

* Auto deletion of tasks (#238)

* auto deletion of tasks

* Update text/0060-tasks-api.md

Co-authored-by: gui machiavelli <[email protected]>

* Update text/0060-tasks-api.md

Co-authored-by: gui machiavelli <[email protected]>

---------

Co-authored-by: gui machiavelli <[email protected]>

* 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 <[email protected]>
Co-authored-by: Clément Renault <[email protected]>
Co-authored-by: cvermand <[email protected]>
Co-authored-by: gui machiavelli <[email protected]>
Co-authored-by: Many the fish <[email protected]>
  • Loading branch information
6 people authored Jun 5, 2023
1 parent 4676834 commit 3116739
Show file tree
Hide file tree
Showing 12 changed files with 426 additions and 424 deletions.
137 changes: 135 additions & 2 deletions open-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.1.0
info:
title: Meilisearch Core API
description: 'Search documents, configure and manage the Meilisearch engine.'
version: 1.1.0
version: 1.2.0
contact:
name: Meilisearch
email: [email protected]
Expand Down Expand Up @@ -1208,7 +1208,7 @@ components:
examples:
Payload Too Large:
value:
message: The provided payload reached the size limit.
message: The provided payload reached the size limit. The maximum accepted payload size is 20.00 MiB.
code: payload_too_large
type: invalid_request
link: 'https://docs.meilisearch.com/errors#payload_too_large'
Expand Down Expand Up @@ -1664,6 +1664,7 @@ paths:
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/offset'
- $ref: '#/components/parameters/fields'
- $ref: '#/components/parameters/filter'
post:
operationId: indexes.documents.create
summary: Add or replace documents
Expand Down Expand Up @@ -1805,6 +1806,93 @@ paths:
description: Not Found
parameters:
- $ref: '#/components/parameters/indexUid'
'/indexes/{indexUid}/documents/fetch':
post:
operationId: indexes.documents.fetch
summary: Get Documents
description: |
Get [documents](https://docs.meilisearch.com/learn/core_concepts/documents.html) by batch.
tags:
- Documents
security:
- apiKey: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
offset:
type: number
description: Number of documents to skip.
default: 0
limit:
type: number
description: Maximum number of documents returned.
default: 20
fields:
type: array
description: 'Array of attributes whose fields will be present in the returned documents. By default all attributes will be returned.'
items:
type: string
example: '["title", "overview"]'
default: '["*"]'
filter:
$ref: '#/components/schemas/filter'
examples:
Example:
value:
offset: 2
limit: 5
fields:
- name
- picture
filter: 'doggo = "bernese mountain"'
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
properties:
results:
type: array
items:
$ref: '#/components/schemas/document'
limit:
$ref: '#/components/schemas/limit'
offset:
$ref: '#/components/schemas/offset'
total:
$ref: '#/components/schemas/total'
required:
- results
- limit
- offset
- total
examples:
Example:
value:
results:
- id: 25684
title: American Ninja 5
poster: 'https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg'
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: 725846400
- id: 45881
title: The Bridge of San Luis Rey
poster: 'https://image.tmdb.org/t/p/w500/4X7quIcdkc24Cveg5XdpfRqxtYA.jpg'
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."
release_date: 1072915200
limit: 20
offset: 0
total: 2
'401':
$ref: '#/components/responses/401'
'404':
description: Not Found
'/indexes/{indexUid}/documents/delete-batch':
post:
operationId: indexes.documents.removeBatch
Expand Down Expand Up @@ -1850,6 +1938,51 @@ paths:
- $ref: '#/components/parameters/Content-Type'
parameters:
- $ref: '#/components/parameters/indexUid'
'/indexes/{indexUid}/documents/delete':
post:
operationId: indexes.documents.remove
summary: Delete documents
description: Delete a selection of documents based on a filter.
tags:
- Documents
security:
- apiKey: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
filter:
$ref: '#/components/schemas/filter'
examples:
Example:
value:
offset: 2
limit: 5
fields:
- name
- picture
filter: 'doggo = "bernese mountain"'
responses:
'202':
description: Accepted
content:
application/json:
schema:
$ref: '#/components/responses/202'
examples:
'202':
$ref: '#/components/examples/202_documentDeletion'
'401':
$ref: '#/components/responses/401'
'404':
description: Not Found
parameters:
- $ref: '#/components/parameters/Content-Type'
parameters:
- $ref: '#/components/parameters/indexUid'
'/indexes/{indexUid}/documents/{documentId}':
get:
operationId: indexes.documents.get
Expand Down
15 changes: 9 additions & 6 deletions text/0028-indexing-csv.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ While there's [RFC 4180](https://tools.ietf.org/html/rfc4180) as a try to add a

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

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

- 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)
- 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.
- 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.
- 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`.

##### Example with a comma inside a cell

Given the CSV payload
```
"id:number","label","price:number","colors","description"
"1","t-shirt","4.99","red","Thus, you will rock at summer time."
"id:number","label","price:number","colors","description","contains_a_dog_picture:boolean"
"1","t-shirt","4.99","red","Thus, you will rock at summer time.","false"
```
the search result should be displayed as
```json
Expand All @@ -75,7 +76,8 @@ the search result should be displayed as
"label": "t-shirt",
"price": 4.99,
"colors": "red",
"description": "Hey, you will rock at summer time."
"description": "Thus, you will rock at summer time.",
"contains_a_dog_picture": false
}
],
...
Expand Down Expand Up @@ -172,6 +174,7 @@ curl \
- 🔴 Sending an invalid CSV format will lead to a 400 bad_request - **malformed_payload** error code.
- 🔴 Sending a CSV header that does not conform to the specification will lead to a 400 bad_request - **malformed_payload** error code.
- 🔴 Sending an invalid csv delimiter: not exactly one ASCII char. This will lead to a 400 bad_request - **invalid_document_csv_delimiter** error code.
- 🔴 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.

##### Errors Definition

Expand Down
Loading

0 comments on commit 3116739

Please sign in to comment.