Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
257: Add methods to add JSON, CSV and NDJSON document r=curquiza a=thicolares ### Addresses the following items of #243: - [x] addDocumentsJson(string docs, string primaryKey) - [x] addDocumentsCsv(string docs, string primaryKey) - [x] addDocumentsNdjson(string docs, string primaryKey) ### Changes _Tip: in order to ease the code review, you can start reviewing it commit by commit._ - Expose request options as a parameter of `http_post`. Motivations: - Allow who knows about the content to use `transform_body?` in order to decide if `http_request` should or not transform the body to JSON; - Group `transform_body?`, `headers` and [other options' default values that were spread around](https://github.com/meilisearch/meilisearch-ruby/blob/1ddbc9253f15cc4879bd6e7392c145ae9af9bde9/lib/meilisearch/http_request.rb#L82-L83) into a single Hash; - It can be improved in the next iterations, but it will already ease the next tasks within #243. - Create methods to add documents as JSON, NDJSON and CSV - Add related tests exposing the usage of primaryKeys - No _"add in batches"_ included in this PR. Co-authored-by: Thiago Colares <thicolares@gmail.com> Co-authored-by: Clémentine Urquizar - curqui <clementine@meilisearch.com>
- Loading branch information
Showing
5 changed files
with
134 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters