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

Commit

Permalink
Release v0.26.0 (#126)
Browse files Browse the repository at this point in the history
* Search API (#118)

* Add specification the search API endpoints

* Add errors

* Add a future possibility about error code

* Replace spec id

* Fix typo

* Harmonize sentences

* Apply suggestions from code review

Co-authored-by: Clémentine Urquizar - curqui <clementine@meilisearch.com>

* Fix type definition by http verb for filter parameter

* fix typos

Co-authored-by: Clémentine Urquizar - curqui <clementine@meilisearch.com>

* Handle empty cell as `null` value for CSV format (#110)

* Add null value part and example

* Update text/0028-indexing-csv.md

Co-authored-by: Clément Renault <clement@meilisearch.com>

* Replace MeiliSearch by Meilisearch

Co-authored-by: Clément Renault <clement@meilisearch.com>

* Dumps (#105)

* Init dumps specification

* Apply suggestions from code review

Co-authored-by: Tamo <tamo@meilisearch.com>

* Describe CLI flags and error messages

* Apply suggestions from code review

Co-authored-by: Clémentine Urquizar - curqui <clementine@meilisearch.com>

* remove wrong statement

* Add dump creation as a task into future possibilities section

* Rename spec file and mentions technical aspects

Co-authored-by: Tamo <tamo@meilisearch.com>
Co-authored-by: Clémentine Urquizar - curqui <clementine@meilisearch.com>

* Remove the error on put/post documents when sending paylaod with 0 document object (#98)

* Add CLI flag/option to telemetry specification (#107)

* Add CLI analytics

* Add log_level

* use snake case

* Add backticks on examples

* Apply suggestions from code review

Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>

* Fix debounce-duration-sec parameter name

Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>

* Keys API - Update the error message for `expiresAt` (#114)

* update the wrong date message

* Change ISO-8601 by RFC 3339

* Update errors: backticks, example error message and placeholder var

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Dump support (#122)

* Add dump version support

* Fix titles numerotation, clear API endpoints definition, apply curquiza suggestion to gain one title level

* Update text/0105-dumps-api.md

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Tenant Token (#89)

* init specification

* update filename

* update typo

* rephrase motivation

* rename master occurences by main

* replace mention of main by master

* Update text/0089-scoped-api-keys.md

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* replace client code by frontend or backend

* Update text/0089-scoped-api-keys.md

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Update text/0089-scoped-api-keys.md

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Update text/0089-scoped-api-keys.md

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* update javascript code sample for generateScopedApiKey method

* Rename Scoped API Key to Tenant Token

* Apply suggestions from code review

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* precise message from reviews

* Add JWT part

* Rename specification file

* Update specification texts

* Add examples for indexesPolicy

* Update indexesPolicy examples texts

* Update indexesPolicy examples texts

* Update indexesPolicy examples texts

* Add a multi-tenant definition and tenant examples for MeiliSearch

* Update text/0089-tenant-tokens.md

Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>

* Update text/0089-tenant-tokens.md

Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>

* Add array format for indexesPolicy and rename iss to apiKeyPrefix

* update indexesPolicy formats example

* rename indexesPolicy to searchRules and add supported JWT signatures

* Rephrase searchRules explanations

* Update text/0089-tenant-tokens.md

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Update text/0089-tenant-tokens.md

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Update text/0089-tenant-tokens.md

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Rephrase explanations from suggestions

* Update scheme

* Update text/0089-tenant-tokens.md

Co-authored-by: Many <legendre.maxime.isn@gmail.com>

* Mention tenant token revoking

* Add precision on SDKs and Meilisearch role for Tenant Token

* Apply suggestions from code review

Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Add Future Possibilities on tenant token formatting error

* Replace MeiliSearch by Meilisearch, fix typos, rephrase sentences and reorganize sections

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>
Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>
Co-authored-by: Many <legendre.maxime.isn@gmail.com>
Co-authored-by: Bruno Casali <brunoocasali@gmail.com>

* Auto-Batching (#96)

* init auto-batching specification

* replace file name

* Add content and explanations

* fix typo

* change wording

* Update auto-batching

* Mention batchUid identifier

* Update spec titles numerotation

* Separate consecutive tasks type

* Add a simple schema to represent the batchUid and tasks picking

* Apply suggestions from code review

Co-authored-by: Clémentine Urquizar - curqui <clementine@meilisearch.com>

* Update auto-batching spec with CLI flags explanations

* Modify Task API resource to display the batchUid

* Add the batchUid field to the Task API object description

* Fix parameter name

* Replaces MeiliSearch by Meilisearch, fix typos, rephrase sentences and reorganize section

* Rename --enable-autbatching to --enable-auto-batching

* Update text/0096-auto-batching.md

Co-authored-by: Clémentine Urquizar - curqui <clementine@meilisearch.com>

* Update text/0096-auto-batching.md

Co-authored-by: ad hoc <postma.marin@protonmail.com>

* Add precisions

* Rephrase debounce-duration-sec option

* Apply suggestions from code review

Co-authored-by: ad hoc <postma.marin@protonmail.com>

* Apply suggestions from code review

Co-authored-by: Tamo <irevoire@protonmail.ch>

Co-authored-by: Clémentine Urquizar - curqui <clementine@meilisearch.com>
Co-authored-by: ad hoc <postma.marin@protonmail.com>
Co-authored-by: Tamo <irevoire@protonmail.ch>

* Bump OAS to v0.26.0

Co-authored-by: Clémentine Urquizar - curqui <clementine@meilisearch.com>
Co-authored-by: Clément Renault <clement@meilisearch.com>
Co-authored-by: Tamo <tamo@meilisearch.com>
Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>
Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>
Co-authored-by: Many <legendre.maxime.isn@gmail.com>
Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
Co-authored-by: ad hoc <postma.marin@protonmail.com>
Co-authored-by: Tamo <irevoire@protonmail.ch>
  • Loading branch information
10 people authored Mar 14, 2022
1 parent bf097e2 commit aa2a262
Show file tree
Hide file tree
Showing 10 changed files with 1,002 additions and 77 deletions.
33 changes: 22 additions & 11 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: 0.25.0
version: 0.26.0
contact:
name: Meilisearch
email: bonjour@Meilisearch.com
Expand All @@ -27,7 +27,7 @@ components:
schemas:
timestamp:
type: string
description: An `ISO-8601` format for date/time/duration.
description: An `RFC 3339` format for date/time/duration.
example: '2019-11-20T09:40:33.711324Z'
index:
type: object
Expand Down Expand Up @@ -269,6 +269,7 @@ components:
examples:
- uid: 0
indexUid: movies
batchUid: 0
status: succeeded
type: documentAddition
details:
Expand All @@ -285,6 +286,9 @@ components:
indexUid:
type: string
description: The unique identifier of the index where this task is operated
batchUid:
type: integer
description: Identify in which batch a task has been grouped by auto-batching. It corresponds to the first task uid grouped within a batch.
status:
type: string
description: The status of the task
Expand Down Expand Up @@ -315,7 +319,7 @@ components:
description: Number of documents received for documentAddition or documentPartial task.
indexedDocuments:
type: integer
description: Number of documents finally indexed for documentAddition or documentPartial task.
description: Number of documents finally indexed for documentAddition or documentPartial task or if batched, in the batchUid.
receivedDocumentsIds:
type: integer
description: Number of document ids received for documentDeletion task.
Expand All @@ -335,19 +339,20 @@ components:
description: Total elasped time the engine was in processing state expressed as a `ISO-8601` duration format. Default is set to `null`
nullable: true
enqueuedAt:
description: Represent the date and time as a `ISO-8601` format when the task has been enqueued
description: Represent the date and time as a `RFC 3339` format when the task has been enqueued
$ref: '#/components/schemas/timestamp'
startedAt:
$ref: '#/components/schemas/timestamp'
description: Represent the date and time as a `ISO-8601` format when the task has been dequeued and started to be processed. Default is set to `null`
description: Represent the date and time as a `RFC 3339` format when the task has been dequeued and started to be processed. Default is set to `null`
nullable: true
finishedAt:
$ref: '#/components/schemas/timestamp'
description: Represent the date and time as a `ISO-8601` format when the task has failed or succeeded. Default is set to `null`
description: Represent the date and time as a `RFC 3339` format when the task has failed or succeeded. Default is set to `null`
nullable: true
required:
- uid
- indexUid
- batchUid
- status
- type
- enqueuedAt
Expand Down Expand Up @@ -584,17 +589,17 @@ components:
type:
- string
- 'null'
description: Represent the expiration date and time as ISO-8601 format. null equals to no expiration time.
description: Represent the expiration date and time as RFC 3339 format. null equals to no expiration time.
createdAt:
type: string
description: Represent the date and time as ISO-8601 format when the API key has been created. Generated by Meilisearch.
description: Represent the date and time as RFC 3339 format when the API key has been created. Generated by Meilisearch.
example: '2021-11-12T10:00:00Z'
readOnly: true
updatedAt:
type:
- string
- 'null'
description: Represent the date and time as ISO-8601 format when the API key has been updated. Generated by Meilisearch.
description: Represent the date and time as RFC 3339 format when the API key has been updated. Generated by Meilisearch.
default: null
readOnly: true
required:
Expand Down Expand Up @@ -772,7 +777,7 @@ components:
example: enqueued
enqueuedAt:
$ref: '#/components/schemas/timestamp'
description: Represent the date and time as `ISO-8601` format when the task has been enqueued
description: Represent the date and time as `RFC 3339` format when the task has been enqueued
additionalProperties: false
required:
- uid
Expand Down Expand Up @@ -2366,7 +2371,8 @@ paths:
value:
results:
- uid: 1
indexUid: movies
indexUid: movies,
batchUid: 1
status: succeeded
type: documentAddition
details:
Expand All @@ -2378,6 +2384,7 @@ paths:
finishedAt: '2021-01-01T09:39:02.000000Z'
- uid: 0
indexUid: movies
batchUid: 0
status: failed
type: documentAddition
details:
Expand Down Expand Up @@ -2420,6 +2427,7 @@ paths:
value:
uid: 1
indexUid: movies
batchUid: 1
status: succeeded
type: documentAddition
details:
Expand Down Expand Up @@ -2707,6 +2715,7 @@ paths:
results:
- uid: 1
indexUid: movies
batchUid: 1
status: succeeded
type: documentAddition
details:
Expand All @@ -2718,6 +2727,7 @@ paths:
finishedAt: '2021-01-01T09:39:02.000000Z'
- uid: 0
indexUid: movies_Review
batchUid: 0
status: failed
type: documentAddition
details:
Expand Down Expand Up @@ -2754,6 +2764,7 @@ paths:
value:
uid: 1
indexUid: movies
batchUid: 1
status: succeeded
type: documentAddition
details:
Expand Down
39 changes: 33 additions & 6 deletions text/0028-indexing-csv.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- Title: Indexing CSV
- Start Date: 2021-04-9
- Specification PR: [PR-#28](https://github.com/meilisearch/specifications/pull/28)
- Specification PR: [PR-#28](https://github.com/Meilisearch/specifications/pull/28)
- Discovery Issue: n/a

# Indexing CSV
Expand All @@ -9,7 +9,7 @@

### I. Summary

To index documents, the body of the add documents request has to match a specific format. That specific format is then parsed and tokenized inside MeiliSearch. After which, the documents added are in the pool of searchable and returnable documents.
To index documents, the body of the add documents request has to match a specific format. That specific format is then parsed and tokenized inside Meilisearch. After which, the documents added are in the pool of searchable and returnable documents.

A [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) data format is broadly used to store and exchange data in a simple format.

Expand All @@ -25,30 +25,35 @@ Also, in order to boost write performance CSV data format is more suited than JS

We want to provide our users with an always improved usage experience. Currently, the engine only accepts JSON format as a data source. We want to give users the possibility of another simple data format, well known, to use. Thus, give them more versatility at the data source choices for the indexing (add and update) step.

Since most SQL engines or SQL clients can easily dump data as CSV, it will facilitate MeiliSearch adoption by extending the indexing step on a wider range of customer cases than before.
Since most SQL engines or SQL clients can easily dump data as CSV, it will facilitate Meilisearch adoption by extending the indexing step on a wider range of customer cases than before.

Writing performance is also considered as a motivation since CSV parsing is less CPU and memory intensive than parsing Json due to the streamable capability of the CSV format.

### III.Explanation

#### CSV Formatting Rules

While there's [RFC 4180](https://tools.ietf.org/html/rfc4180) as a try to add a specification for CSV format, we will find a lot of variations from that. MeiliSearch features capabilities requires CSV data to be formatted the proper way to be parsable by the engine.
While there's [RFC 4180](https://tools.ietf.org/html/rfc4180) as a try to add a specification for CSV format, we will find a lot of variations from that. Meilisearch features capabilities requires CSV data to be formatted the proper way to be parsable by the engine.

- 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.
>
> Valid headline example: "id:number","title:string","author","price:number"
- The following CSV lines will represent a document for MeiliSearch.
- The following CSV lines will represent a document for Meilisearch.
- A `,` character must separate each cell.
- A CSV value should be enclosed in double-quotes when it contains a comma character or a newline to escape it.
- Using double-quotes to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote as mentioned in [RFC 4180](https://tools.ietf.org/html/rfc4180).
- Float value should be written with a `.` character, like `3.14`.
- CSV text should be encoded in UTF8.
- The format can't handle array cell values. We are providing `nd-json` format to deal with theses types of attribute in a easier way.

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

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

Given the CSV payload
Expand Down Expand Up @@ -95,7 +100,29 @@ the search result should be displayed as
}
```

> Note that the price attribute was not typed as a number. By default, MeiliSearch type it as a string.
> Note that the price attribute was not typed as a number. By default, Meilisearch type it as a string.
##### Example with an empty cell

Given the CSV payload
```
id:number,label,price:number,colors
1,t-shirt,,red
```
the search result should be displayed as
```json
{
"hits": [
{
"id": 1,
"label": "t-shirt",
"price": null,
"colors": "red"
}
],
...
}
```

#### API Endpoints

Expand Down
Loading

0 comments on commit aa2a262

Please sign in to comment.