Skip to content

added updateDocumentsCsv(string docs, string primaryKey) #654

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

Merged
merged 5 commits into from
Jan 30, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions meilisearch/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,33 @@ def update_documents_json(
"""
return self.update_documents_raw(str_documents, primary_key, "application/json")

def update_documents_csv(
self,
str_documents: str,
primary_key: Optional[str] = None,
) -> TaskInfo:
"""Update documents as a csv string in the index.

Parameters
----------
str_documents:
String of document from a CSV file.
primary_key (optional):
The primary-key used in index. Ignored if already set up

Returns
-------
task_info:
TaskInfo instance containing information about a task to track the progress of an asynchronous process.
https://docs.meilisearch.com/reference/api/tasks.html#get-one-task

Raises
------
MeiliSearchApiError
An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://docs.meilisearch.com/errors/#meilisearch-errors
"""
return self.update_documents_raw(str_documents, primary_key, "application/csv")

def update_documents_raw(
self,
str_documents: str,
Expand Down