-
Notifications
You must be signed in to change notification settings - Fork 32
[Feature] Support NDJson and CSV #262
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
Changes from 2 commits
619d525
3c563ae
02dcf72
23765f1
484d858
68266da
aeaa4bd
073dfbf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,35 +54,130 @@ abstract class MeiliSearchIndex { | |
| Future<Result<Map<String, Object?>>> getDocuments({DocumentsQuery? params}); | ||
|
|
||
| /// Add a list of documents by given [documents] and optional [primaryKey] parameter. | ||
| /// If index is not exists tries to create a new index and adds documents. | ||
| /// | ||
| /// If index does not exist, it tries to create a new index and adds documents. | ||
| Future<Task> addDocuments( | ||
| List<Map<String, Object?>> documents, { | ||
| String? primaryKey, | ||
| }); | ||
|
|
||
| /// Add a list of documents by given [documents] and optional [primaryKey] parameter | ||
| /// | ||
| /// * the passed [documents] must be a valid JSON string representing an array of objects. | ||
| /// * If index does not exist, it tries to create a new index and adds documents. | ||
| Future<Task> addDocumentsJson( | ||
| String documents, { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The best way to represent the JSON docs is to receive it as string?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current |
||
| String? primaryKey, | ||
| }); | ||
|
|
||
| /// Add a list of documents by given [documents] and optional [primaryKey] parameter | ||
| /// | ||
| /// * The passed [documents] must be a valid CSV string, where each line corresponds to an object. | ||
| /// * If index does not exist tries to create a new index and adds documents. | ||
ahmednfwela marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Future<Task> addDocumentsCsv( | ||
| String documents, { | ||
| String? primaryKey, | ||
| }); | ||
|
|
||
| /// Add a list of documents by given [documents] and optional [primaryKey] parameter | ||
| /// | ||
| /// the passed [documents] must be a valid Newline Delimited Json (NdJson) string, where each line corresponds to an object. | ||
| /// If index does not exist tries to create a new index and adds documents. | ||
ahmednfwela marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Future<Task> addDocumentsNdjson( | ||
| String documents, { | ||
| String? primaryKey, | ||
| }); | ||
|
|
||
| /// Add a list of documents in batches of size [batchSize] by given [documents] and optional [primaryKey] parameter. | ||
| /// If index is not exists tries to create a new index and adds documents. | ||
| /// If index does not exist tries to create a new index and adds documents. | ||
| Future<List<Task>> addDocumentsInBatches( | ||
| List<Map<String, Object?>> documents, { | ||
| int batchSize = 1000, | ||
| String? primaryKey, | ||
| }); | ||
|
|
||
| /// Add a list of documents in batches of size [batchSize] by given [documents] and optional [primaryKey] parameter. | ||
| /// | ||
| /// * The passed [documents] must be a valid CSV string, where each line corresponds to an object. | ||
| /// * If index does not exist tries to create a new index and adds documents. | ||
ahmednfwela marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Future<List<Task>> addDocumentsCsvInBatches( | ||
| String documents, { | ||
| String? primaryKey, | ||
| int batchSize = 1000, | ||
| }); | ||
|
|
||
| /// Add a list of documents in batches of size [batchSize] by given [documents] and optional [primaryKey] parameter. | ||
| /// | ||
| /// * The passed [documents] must be a valid Newline Delimited Json (NdJson) string, where each line corresponds to an object. | ||
| /// * If index does not exist tries to create a new index and adds documents. | ||
ahmednfwela marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Future<List<Task>> addDocumentsNdjsonInBatches( | ||
| String documents, { | ||
| String? primaryKey, | ||
| int batchSize = 1000, | ||
| }); | ||
|
|
||
| /// Add a list of documents or update them if they already exist by given [documents] and optional [primaryKey] parameter. | ||
| /// If index is not exists tries to create a new index and adds documents. | ||
| /// If index does not exist tries to create a new index and adds documents. | ||
| Future<Task> updateDocuments( | ||
| List<Map<String, Object?>> documents, { | ||
| String? primaryKey, | ||
| }); | ||
|
|
||
| /// Add a list of documents or update them if they already exist by given [documents] and optional [primaryKey] parameter. | ||
| /// | ||
| /// * the passed [documents] must be a valid JSON string representing an array of objects. | ||
| /// * If index does not exist, it tries to create a new index and adds documents. | ||
ahmednfwela marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Future<Task> updateDocumentsJson( | ||
| String documents, { | ||
| String? primaryKey, | ||
| }); | ||
|
|
||
| /// Add a list of documents or update them if they already exist by given [documents] and optional [primaryKey] parameter. | ||
| /// | ||
| /// * The passed [documents] must be a valid Newline Delimited Json (NdJson) string, where each line corresponds to an object. | ||
| /// * If index does not exist, it tries to create a new index and adds documents. | ||
ahmednfwela marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Future<Task> updateDocumentsNdjson( | ||
| String documents, { | ||
| String? primaryKey, | ||
| }); | ||
|
|
||
| /// Add a list of documents or update them if they already exist by given [documents] and optional [primaryKey] parameter. | ||
| /// | ||
| /// * The passed [documents] must be a valid CSV string, where each line corresponds to an object. | ||
| /// * If index does not exist, it tries to create a new index and adds documents. | ||
ahmednfwela marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Future<Task> updateDocumentsCsv( | ||
| String documents, { | ||
| String? primaryKey, | ||
| }); | ||
|
|
||
| /// Add a list of documents or update them if they already exist in batches of size [batchSize] by given [documents] and optional [primaryKey] parameter. | ||
| /// If index is not exists tries to create a new index and adds documents. | ||
| /// If index does not exist tries to create a new index and adds documents. | ||
| Future<List<Task>> updateDocumentsInBatches( | ||
| List<Map<String, Object?>> documents, { | ||
| int batchSize = 1000, | ||
| String? primaryKey, | ||
| }); | ||
|
|
||
| /// Add a list of documents or update them if they already exist in batches of size [batchSize] by given [documents] and optional [primaryKey] parameter. | ||
| /// | ||
| /// * The passed [documents] must be a valid CSV string, where each line corresponds to an object. | ||
| /// * If index does not exist, it tries to create a new index and adds documents. | ||
ahmednfwela marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Future<List<Task>> updateDocumentsCsvInBatches( | ||
| String documents, { | ||
| String? primaryKey, | ||
| int batchSize = 1000, | ||
| }); | ||
|
|
||
| /// Add a list of documents or update them if they already exist in batches of size [batchSize] by given [documents] and optional [primaryKey] parameter. | ||
| /// | ||
| /// * The passed [documents] must be a valid Newline Delimited Json (NdJson) string, where each line corresponds to an object. | ||
| /// * If index does not exist, it tries to create a new index and adds documents. | ||
ahmednfwela marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Future<List<Task>> updateDocumentsNdjsonInBatches( | ||
| String documents, { | ||
| String? primaryKey, | ||
| int batchSize = 1000, | ||
| }); | ||
|
|
||
| /// Delete one document by given [id]. | ||
| Future<Task> deleteDocument(Object id); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.