-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New format handling CSV
NDJSON
#329
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the integration guide issue I wrote:
The SDKs always send application/json as Content-Type to every request: this should be adapted to the concerned requests (POST and PUT)
What is your investigation about this, is it complicated to adapt?
Also, in the typesense docs, they don't seem to accept string
as documents, but object or list
cf
- the code base: https://github.com/typesense/typesense-python/blob/8a07f5ba1fd286e2f109866109effc25f50acd36/typesense/documents.py#L53-L72
- they documentation (tab
python
): https://typesense.org/docs/0.21.0/api/documents.html#configure-batch-size
Wouldn't it be an easier way to approach it for the users, accepting object instead of string? Look like there is less parsing on the user side.
For the format:
|
Is it possible to only send |
Oh yes, I think so! Sorry misunderstood |
I feel like I don't really understand the problem 😕 Why would the user not send his CSV in string? Is it not possible to do the following: const dataset = fs.readFileSync('./mydataset.csv')
client.index("movies").addDocumentsCsv(dataset) and then at our side: request.post(dataset, { "Content-type": "application/csv" }) I'm really sorry if I'm missing something |
e213f6f
to
52f2067
Compare
You right It's work well! |
327: Changes related to the next MeiliSearch release (v0.23.0) r=alallema a=meili-bot Related to this issue: meilisearch/integration-guides#142 This PR: - gathers the changes related to the next MeiliSearch release (v0.23.0) so that this package is ready when the official release is out. - should pass the tests against the [latest pre-release of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases). - might eventually contain test failures until the MeiliSearch v0.23.0 is out.⚠️ This PR should NOT be merged until the next release of MeiliSearch (v0.23.0) is out. _This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/master/guides/pre-release-week.md) purpose._ Done: - #329 - Add new methods: - `addDocumentsJson(string $documents, ?string $primaryKey = null)` - `addDocumentsNdJson(string $documents, ?string $primaryKey = null)` - `addDocumentsCsv(string $documents, ?string $primaryKey = null)` - Add tests for new methods - Remove json header `application/json` for every http methods - #331 Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com> Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com> Co-authored-by: alallema <amelie@meilisearch.com> Co-authored-by: Amélie <alallema@users.noreply.github.com>
New handler to accept
CSV
andNDJSON
format.These functions accept document data as
string
.The
add_documents_raw()
has been added to avoid code duplication but is not mandatory.The
add_documents()
still exists and gives the possibility to add documents asList
.Example of usage:
Please note:
add_documents_csv()
can also take file directly after open it, if the optionrb
is given toopen(path_to_file, 'rb')
. I haven't found a way to avoid this.