Skip to content

v1.16 #3311

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

v1.16 #3311

Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"navigation": {
"versions": [
{
"version": "v1.15",
"version": "v1.16",
"anchors": [
{
"anchor": "Learn",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.15.0",
"version": "1.16.0",
"homepage": "https://meilisearch.com/docs",
"license": "MIT",
"repository": "meilisearch/documentation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ await client.GetTasksAsync(new TasksQuery { Statuses = new List<TaskInfoStatus>
```rust Rust
let mut query = TasksQuery::new(&client);
let tasks = query
.with_statuses(["failed", "canceled"])
.with_statuses(["failed"])
.execute()
.await
.unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@
curl \
-X GET 'MEILISEARCH_URL/tasks?statuses=failed,canceled'
```

```rust Rust
let mut query = TasksQuery::new(&client);
let tasks = query
.with_statuses(["failed", "canceled"])
.execute()
.await
.unwrap();
```
</CodeGroup>
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@ curl \
"primaryKey": "id"
}'
```

```rust Rust
let client = Client::new("http://localhost:7700", Some("DEFAULT_ADMIN_API_KEY"));
let task = client
.create_index("medical_records", Some("id"))
.await
.unwrap();
```
</CodeGroup>
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@
curl -X GET 'MEILISEARCH_URL/keys' \
-H 'Authorization: Bearer MASTER_KEY'
```

```rust Rust
let client = Client::new("http://localhost:7700", Some("MASTER_KEY"));
client
.get_keys()
.await
.unwrap();
```
</CodeGroup>
11 changes: 11 additions & 0 deletions snippets/samples/code_samples_basic_security_tutorial_search_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,15 @@ curl \
-H 'Authorization: Bearer DEFAULT_SEARCH_API_KEY' \
--data-binary '{ "q": "appointments" }'
```

```rust Rust
let client = Client::new("http://localhost:7700", Some("DEFAULT_SEARCH_API_KEY"));
let index = client.index("medical_records");
index
.search()
.with_query("appointments")
.execute::<MedicalRecord>()
.await
.unwrap();
```
</CodeGroup>
10 changes: 10 additions & 0 deletions snippets/samples/code_samples_facet_search_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ var query = new SearchFacetsQuery()
await client.Index("books").FacetSearchAsync("genres", query);
```

```rust Rust
let res = client.index("books")
.facet_search("genres")
.with_facet_query("fiction")
.with_filter("rating > 3")
.execute()
.await
.unwrap();
```

```dart Dart
await client.index('books').facetSearch(
FacetSearchQuery(
Expand Down
14 changes: 14 additions & 0 deletions snippets/samples/code_samples_facet_search_2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ var newFaceting = new Faceting
await client.Index("books").UpdateFacetingAsync(newFaceting);
```

```rust Rust
let mut facet_sort_setting = BTreeMap::new();
facet_sort_setting.insert("genres".to_string(), FacetSortValue::Count);
let faceting = FacetingSettings {
max_values_per_facet: 100,
sort_facet_values_by: Some(facet_sort_setting),
};

let res = client.index("books")
.set_faceting(&faceting)
.await
.unwrap();
```

```dart Dart
await client.index('books').updateFaceting(
Faceting(
Expand Down
9 changes: 9 additions & 0 deletions snippets/samples/code_samples_facet_search_3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ var query = new SearchFacetsQuery()
await client.Index("books").FacetSearchAsync("genres", query);
```

```rust Rust
let res = client.index("books")
.facet_search("genres")
.with_facet_query("c")
.execute()
.await
.unwrap();
```

```dart Dart
await client.index('books').facetSearch(
FacetSearchQuery(
Expand Down
4 changes: 4 additions & 0 deletions snippets/samples/code_samples_get_all_batches_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ $client->getBatches();
```ruby Ruby
client.batches
```

```go Go
client.GetBatches();
```
</CodeGroup>
4 changes: 4 additions & 0 deletions snippets/samples/code_samples_get_batch_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ $client->getBatch(BATCH_UID);
```ruby Ruby
client.batch(BATCH_UID)
```

```go Go
client.GetBatch(BATCH_UID);
```
</CodeGroup>
4 changes: 4 additions & 0 deletions snippets/samples/code_samples_get_embedders_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ curl \
```ruby Ruby
client.index('INDEX_NAME').embedders
```

```rust Rust
let embedders = index.get_embedders().await.unwrap();
```
</CodeGroup>
8 changes: 8 additions & 0 deletions snippets/samples/code_samples_get_facet_search_settings_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,12 @@ client.index('INDEX_UID').facet_search_setting
```go Go
client.Index("books").GetFacetSearch()
```

```rust Rust
let facet_search: bool = client
.index(INDEX_UID)
.get_facet_search()
.await
.unwrap();
```
</CodeGroup>
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,12 @@ client.index('INDEX_UID').prefix_search
```go Go
client.Index("books").GetPrefixSearch()
```

```rust Rust
let prefix_search: PrefixSearchSettings = client
.index(INDEX_UID)
.get_prefix_search()
.await
.unwrap();
```
</CodeGroup>
8 changes: 8 additions & 0 deletions snippets/samples/code_samples_get_similar_post_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,12 @@ client.Index("INDEX_NAME").SearchSimilarDocuments(&meilisearch.SimilarDocumentQu
Embedder: "default",
}, resp)
```

```rust Rust
let results = index
.similar_search("TARGET_DOCUMENT_ID", "EMBEDDER_NAME")
.execute()
.await
.unwrap();
```
</CodeGroup>
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ namespace Meilisearch_demo
```text Rust
// In your .toml file:
[dependencies]
meilisearch-sdk = "0.28.0"
meilisearch-sdk = "0.29.1"
# futures: because we want to block on futures
futures = "0.3"
# serde: required if you are going to use documents
Expand Down
3 changes: 3 additions & 0 deletions snippets/samples/code_samples_getting_started_faceting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ await client.Index("movies").UpdateFacetingAsync(faceting);
```

```rust Rust
let mut facet_sort_setting = BTreeMap::new();
facet_sort_setting.insert("*".to_string(), FacetSortValue::Count);
let mut faceting = FacetingSettings {
max_values_per_facet: 2,
sort_facet_values_by: Some(facet_sort_setting),
};

let task: TaskInfo = client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@
curl \
-X GET 'MEILISEARCH_URL/indexes/INDEX_NAME/settings/searchable-attributes'
```

```rust Rust
let searchable_attributes: Vec<String> = index
.get_searchable_attributes()
.await
.unwrap();
```
</CodeGroup>
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@ curl \
"overview"
]'
```

```rust Rust
let task = index
.set_searchable_attributes(["title", "overview"])
.await
.unwrap();
```
</CodeGroup>
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
curl \
-X GET 'MEILISEARCH_URL/tasks/TASK_UID'
```

```rust Rust
let task_status = index.get_task(&task).await.unwrap();
```
</CodeGroup>
8 changes: 8 additions & 0 deletions snippets/samples/code_samples_negative_search_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@ client.index('movies').search('-escape')
```php PHP
$client->index('movies')->search('-escape');
```

```rust Rust
let results = index.search()
.with_query("-escape")
.execute()
.await
.unwrap();
```
</CodeGroup>
8 changes: 8 additions & 0 deletions snippets/samples/code_samples_negative_search_2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@ client.index('movies').search('-"escape"')
```php PHP
$client->index('movies')->search('-"escape"');
```

```rust Rust
let results = index.search()
.with_query("-\"escape room\"")
.execute()
.await
.unwrap();
```
</CodeGroup>
16 changes: 16 additions & 0 deletions snippets/samples/code_samples_related_results_embedder_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,20 @@ curl -X PATCH 'MEILISEARCH_URL/indexes/movies/settings'
}
}'
```

```rust Rust
let embedders = HashMap::from([(
String::from("movies-text"),
Embedder {
source: EmbedderSource::OpenAi,
api_key: Some(String::from("OPENAI_API_KEY")),
model: Some(String::from("text-embedding-3-small")),
document_template: Some(String::from("A movie titled '{{doc.title}}' released in {{ doc.release_date }}. The movie genres are: {{doc.genres}}. The story is about: {{doc.overview|truncatewords: 20}}")),
..Embedder::default()
}
)]);
movies.set_embedders(&embedders)
.await
.unwrap();
```
</CodeGroup>
9 changes: 9 additions & 0 deletions snippets/samples/code_samples_related_results_search_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,13 @@ curl -X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/search' \
}
}'
```

```rust Rust
let results = movies.search()
.with_query("batman")
.with_hybrid("EMBEDDER_NAME", 0.5)
.execute()
.await
.unwrap();
```
</CodeGroup>
7 changes: 7 additions & 0 deletions snippets/samples/code_samples_related_results_similar_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@ curl \
"embedder": "EMBEDDER_NAME"
}'
```

```rust Rust
let results = movies.similar_search("192", "EMBEDDER_NAME")
.execute()
.await
.unwrap();
```
</CodeGroup>
4 changes: 4 additions & 0 deletions snippets/samples/code_samples_reset_embedders_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ curl \
```ruby Ruby
client.index('INDEX_NAME').reset_embedders
```

```rust Rust
index.reset_embedders().await.unwrap();
```
</CodeGroup>
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,12 @@ client.index('INDEX_UID').reset_facet_search_setting
```go Go
client.Index("books").ResetFacetSearch()
```

```rust Rust
let task: TaskInfo = client
.index(INDEX_UID)
.reset_facet_search()
.await
.unwrap();
```
</CodeGroup>
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,12 @@ client.index('INDEX_UID').reset_prefix_search
```go Go
client.Index("books").ResetPrefixSearch()
```

```rust Rust
let task: TaskInfo = client
.index(INDEX_UID)
.reset_prefix_search()
.await
.unwrap();
```
</CodeGroup>
10 changes: 10 additions & 0 deletions snippets/samples/code_samples_search_parameter_guide_hybrid_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,14 @@ $client->index('INDEX_NAME')->search('kitchen utensils', [
]
]);
```

```rust Rust
let results = index
.search()
.with_query("kitchen utensils")
.with_hybrid("EMBEDDER_NAME", 0.9)
.execute()
.await
.unwrap();
```
</CodeGroup>
Loading