diff --git a/learn/self_hosted/configure_meilisearch_at_launch.mdx b/learn/self_hosted/configure_meilisearch_at_launch.mdx index d947ed4b8..5339bd839 100644 --- a/learn/self_hosted/configure_meilisearch_at_launch.mdx +++ b/learn/self_hosted/configure_meilisearch_at_launch.mdx @@ -519,7 +519,7 @@ Limit the number of tasks Meilisearch performs in a single batch. May improve st **Environment variable**: `MEILI_EXPERIMENTAL_LIMIT_BATCHED_TASKS_TOTAL_SIZE`
**CLI option**: `--experimental-limit-batched-tasks-total-size`
-**Default value**: `None`
+**Default value**: Half of total available memory, up to a maximum of 10 GiB
**Expected value**: an integer Sets a maximum payload size for batches in bytes. Smaller batches are less efficient, but consume less RAM and reduce immediate latency. diff --git a/snippets/samples/code_samples_compact_index_1.mdx b/snippets/samples/code_samples_compact_index_1.mdx index 9c4347220..4c0fed75a 100644 --- a/snippets/samples/code_samples_compact_index_1.mdx +++ b/snippets/samples/code_samples_compact_index_1.mdx @@ -12,4 +12,12 @@ client.index('movies').compact() ```java Java client.index("INDEX_NAME").compact(); ``` + +```rust Rust +let task: TaskInfo = client + .index("INDEX_UID") + .compact() + .await + .unwrap(); +``` \ No newline at end of file diff --git a/snippets/samples/code_samples_field_properties_guide_displayed_1.mdx b/snippets/samples/code_samples_field_properties_guide_displayed_1.mdx index 0b8b059c5..81b450d40 100644 --- a/snippets/samples/code_samples_field_properties_guide_displayed_1.mdx +++ b/snippets/samples/code_samples_field_properties_guide_displayed_1.mdx @@ -79,7 +79,7 @@ await client.Index("movies").UpdateDisplayedAttributesAsync(new[] ```rust Rust let displayed_attributes = [ "title", - "overvieww", + "overview", "genres", "release_date" ]; diff --git a/snippets/samples/code_samples_field_properties_guide_searchable_1.mdx b/snippets/samples/code_samples_field_properties_guide_searchable_1.mdx index 5e1ac6abb..34b221b3e 100644 --- a/snippets/samples/code_samples_field_properties_guide_searchable_1.mdx +++ b/snippets/samples/code_samples_field_properties_guide_searchable_1.mdx @@ -70,7 +70,7 @@ await client.Index("movies").UpdateSearchableAttributesAsync(new[] ```rust Rust let searchable_attributes = [ "title", - "overvieww", + "overview", "genres" ]; diff --git a/snippets/samples/code_samples_get_all_batches_1.mdx b/snippets/samples/code_samples_get_all_batches_1.mdx index 403117765..d029db8d7 100644 --- a/snippets/samples/code_samples_get_all_batches_1.mdx +++ b/snippets/samples/code_samples_get_all_batches_1.mdx @@ -24,4 +24,11 @@ client.batches ```go Go client.GetBatches(); ``` + +```rust Rust +let mut query = meilisearch_sdk::batches::BatchesQuery::new(&client); +query.with_limit(20); +let batches: meilisearch_sdk::batches::BatchesResults = + client.get_batches_with(&query).await.unwrap(); +``` \ No newline at end of file diff --git a/snippets/samples/code_samples_get_all_batches_paginating_1.mdx b/snippets/samples/code_samples_get_all_batches_paginating_1.mdx new file mode 100644 index 000000000..36a27254c --- /dev/null +++ b/snippets/samples/code_samples_get_all_batches_paginating_1.mdx @@ -0,0 +1,10 @@ + + +```rust Rust +let mut query = meilisearch_sdk::batches::BatchesQuery::new(&client); +query.with_limit(2); +query.with_from(40); +let batches: meilisearch_sdk::batches::BatchesResults = + client.get_batches_with(&query).await.unwrap(); +``` + \ No newline at end of file diff --git a/snippets/samples/code_samples_get_batch_1.mdx b/snippets/samples/code_samples_get_batch_1.mdx index a7bc333b1..1689ee8a9 100644 --- a/snippets/samples/code_samples_get_batch_1.mdx +++ b/snippets/samples/code_samples_get_batch_1.mdx @@ -24,4 +24,12 @@ client.batch(BATCH_UID) ```go Go client.GetBatch(BATCH_UID); ``` + +```rust Rust +let uid: u32 = 42; +let batch: meilisearch_sdk::batches::Batch = client + .get_batch(uid) + .await + .unwrap(); +``` \ No newline at end of file diff --git a/snippets/samples/code_samples_get_documents_by_ids_1.mdx b/snippets/samples/code_samples_get_documents_by_ids_1.mdx new file mode 100644 index 000000000..63cd64b7d --- /dev/null +++ b/snippets/samples/code_samples_get_documents_by_ids_1.mdx @@ -0,0 +1,11 @@ + + +```rust Rust +let index = client.index("books"); +let documents: DocumentsResults = DocumentsQuery::new(&index) + .with_ids(["1", "2"]) // retrieve documents by IDs + .execute::() + .await + .unwrap(); +``` + \ No newline at end of file diff --git a/snippets/samples/code_samples_getting_started_add_documents.mdx b/snippets/samples/code_samples_getting_started_add_documents.mdx index 6c00fa42e..44e882cd5 100644 --- a/snippets/samples/code_samples_getting_started_add_documents.mdx +++ b/snippets/samples/code_samples_getting_started_add_documents.mdx @@ -78,14 +78,14 @@ $client->index('movies')->addDocuments($movies); // // com.meilisearch.sdk // meilisearch-java -// 0.17.0 +// 0.17.1 // pom // // For Gradle // Add the following line to the `dependencies` section of your `build.gradle`: // -// implementation 'com.meilisearch.sdk:meilisearch-java:0.17.0' +// implementation 'com.meilisearch.sdk:meilisearch-java:0.17.1' // In your .java file: import com.meilisearch.sdk; @@ -192,7 +192,7 @@ namespace Meilisearch_demo ```text Rust // In your .toml file: [dependencies] - meilisearch-sdk = "0.30.0" + meilisearch-sdk = "0.31.0" # futures: because we want to block on futures futures = "0.3" # serde: required if you are going to use documents diff --git a/snippets/samples/code_samples_search_parameter_reference_media_1.mdx b/snippets/samples/code_samples_search_parameter_reference_media_1.mdx index 0e6f82187..9f38e66c1 100644 --- a/snippets/samples/code_samples_search_parameter_reference_media_1.mdx +++ b/snippets/samples/code_samples_search_parameter_reference_media_1.mdx @@ -66,4 +66,20 @@ client.Index("INDEX_NAME").Search("", &meilisearch.SearchRequest{ }, }); ``` + +```rust Rust +let results = index + .search() + .with_hybrid("EMBEDDER_NAME", 0.5) + .with_media(json!({ + "FIELD_A": "VALUE_A", + "FIELD_B": { + "FIELD_C": "VALUE_B", + "FIELD_D": "VALUE_C" + } + })) + .execute() + .await + .unwrap(); +``` \ No newline at end of file diff --git a/snippets/samples/code_samples_webhooks_delete_1.mdx b/snippets/samples/code_samples_webhooks_delete_1.mdx index d27883400..f90705f24 100644 --- a/snippets/samples/code_samples_webhooks_delete_1.mdx +++ b/snippets/samples/code_samples_webhooks_delete_1.mdx @@ -9,6 +9,10 @@ curl \ client.deleteWebhook(WEBHOOK_UUID) ``` +```python Python +client.delete_webhook('WEBHOOK_UID') +``` + ```go Go client.DeleteWebhook("WEBHOOK_UUID"); ``` diff --git a/snippets/samples/code_samples_webhooks_get_1.mdx b/snippets/samples/code_samples_webhooks_get_1.mdx index dad2b7c70..359b85220 100644 --- a/snippets/samples/code_samples_webhooks_get_1.mdx +++ b/snippets/samples/code_samples_webhooks_get_1.mdx @@ -9,6 +9,10 @@ curl \ client.getWebhooks() ``` +```python Python +client.get_webhooks() +``` + ```go Go client.ListWebhooks(); ``` diff --git a/snippets/samples/code_samples_webhooks_get_single_1.mdx b/snippets/samples/code_samples_webhooks_get_single_1.mdx index 345224939..8f9406697 100644 --- a/snippets/samples/code_samples_webhooks_get_single_1.mdx +++ b/snippets/samples/code_samples_webhooks_get_single_1.mdx @@ -9,6 +9,10 @@ curl \ client.getWebhook(WEBHOOK_UUID) ``` +```python Python +client.get_webhook('WEBHOOK_UID') +``` + ```go Go client.GetWebhook("WEBHOOK_UUID"); ``` diff --git a/snippets/samples/code_samples_webhooks_patch_1.mdx b/snippets/samples/code_samples_webhooks_patch_1.mdx index b7b6d8aba..d4cdce86d 100644 --- a/snippets/samples/code_samples_webhooks_patch_1.mdx +++ b/snippets/samples/code_samples_webhooks_patch_1.mdx @@ -19,6 +19,13 @@ client.updateWebhook(WEBHOOK_UUID, { }) ``` +```python Python +client.update_webhook('WEBHOOK_UID', { + 'url': 'https://example.com/new-webhook', + 'headers': {"Authorization":"", "X-Custom-Header":"test"}, +}) +``` + ```go Go client.UpdateWebhook("WEBHOOK_UUID", &meilisearch.UpdateWebhookRequest{ Header: map[string]string{ diff --git a/snippets/samples/code_samples_webhooks_post_1.mdx b/snippets/samples/code_samples_webhooks_post_1.mdx index ffe892ed0..6f75fe9f8 100644 --- a/snippets/samples/code_samples_webhooks_post_1.mdx +++ b/snippets/samples/code_samples_webhooks_post_1.mdx @@ -23,6 +23,13 @@ client.createWebhook({ }) ``` +```python Python +client.create_webhook({ + 'url': 'https://example.com/webhook', + 'headers': {"Authorization":"", "X-Custom-Header":"test"}, +}) +``` + ```go Go client.AddWebhook(&meilisearch.AddWebhookRequest{ URL: "WEBHOOK_TARGET_URL",