Skip to content

Commit 90a153c

Browse files
authored
Remove _md code samples for Mintlify migration (#661)
* Remove _md code samples for Mintlify migration * Apply suggestions from code review
1 parent 3e56072 commit 90a153c

File tree

1 file changed

+13
-31
lines changed

1 file changed

+13
-31
lines changed

.code-samples.meilisearch.yaml

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,8 +1045,8 @@ primary_field_guide_add_document_primary_key: |-
10451045
], Some("reference_number"))
10461046
.await
10471047
.unwrap();
1048-
getting_started_add_documents_md: |-
1049-
```toml
1048+
getting_started_add_documents: |-
1049+
// In your .toml file:
10501050
[dependencies]
10511051
meilisearch-sdk = "0.28.0"
10521052
# futures: because we want to block on futures
@@ -1057,9 +1057,8 @@ getting_started_add_documents_md: |-
10571057
serde_json = "1.0"
10581058
```
10591059
1060-
Documents in the Rust library are strongly typed.
1061-
1062-
```rust
1060+
// In your .rs file:
1061+
// Documents in the Rust library are strongly typed
10631062
#[derive(Serialize, Deserialize)]
10641063
struct Movie {
10651064
id: i64,
@@ -1069,23 +1068,17 @@ getting_started_add_documents_md: |-
10691068
release_date: i64,
10701069
genres: Vec<String>
10711070
}
1072-
```
10731071
1074-
You will often need this `Movie` struct in other parts of this documentation. (you will have to change it a bit sometimes)
1075-
You can also use schemaless values, by putting a `serde_json::Value` inside your own struct like this:
1076-
1077-
```rust
1072+
// You will often need this `Movie` struct in other parts of this documentation. (you will have to change it a bit sometimes)
1073+
// You can also use schemaless values, by putting a `serde_json::Value` inside your own struct like this:
10781074
#[derive(Serialize, Deserialize)]
10791075
struct Movie {
10801076
id: i64,
10811077
#[serde(flatten)]
10821078
value: serde_json::Value,
10831079
}
1084-
```
10851080
1086-
Then, add documents into the index:
1087-
1088-
```rust
1081+
// Then, add documents into the index:
10891082
use meilisearch_sdk::{
10901083
indexes::*,
10911084
client::*,
@@ -1099,7 +1092,7 @@ getting_started_add_documents_md: |-
10991092
fn main() { block_on(async move {
11001093
let client = Client::new("http://localhost:7700", Some("aSampleMasterKey"));
11011094
1102-
// reading and parsing the file
1095+
// Reading and parsing the file
11031096
let mut file = File::open("movies.json")
11041097
.unwrap();
11051098
let mut content = String::new();
@@ -1109,19 +1102,15 @@ getting_started_add_documents_md: |-
11091102
let movies_docs: Vec<Movie> = serde_json::from_str(&content)
11101103
.unwrap();
11111104
1112-
// adding documents
1105+
// Adding documents
11131106
client
11141107
.index("movies")
11151108
.add_documents(&movies_docs, None)
11161109
.await
11171110
.unwrap();
11181111
})}
1119-
```
1120-
1121-
[About this SDK](https://github.com/meilisearch/meilisearch-rust/)
1122-
getting_started_search_md: |-
1123-
You can build a `SearchQuery` and execute it later:
1124-
```rust
1112+
getting_started_search: |-
1113+
// You can build a `SearchQuery` and execute it later:
11251114
let query: SearchQuery = SearchQuery::new(&movies)
11261115
.with_query("botman")
11271116
.build();
@@ -1131,29 +1120,22 @@ getting_started_search_md: |-
11311120
.execute_query(&query)
11321121
.await
11331122
.unwrap();
1134-
```
11351123
1136-
You can build a `SearchQuery` and execute it directly:
1137-
```rust
1124+
// You can build a `SearchQuery` and execute it directly:
11381125
let results: SearchResults<Movie> = SearchQuery::new(&movies)
11391126
.with_query("botman")
11401127
.execute()
11411128
.await
11421129
.unwrap();
1143-
```
11441130
1145-
You can search in an index directly:
1146-
```rust
1131+
// You can search in an index directly:
11471132
let results: SearchResults<Movie> = client
11481133
.index("movies")
11491134
.search()
11501135
.with_query("botman")
11511136
.execute()
11521137
.await
11531138
.unwrap();
1154-
```
1155-
1156-
[About this SDK](https://github.com/meilisearch/meilisearch-rust/)
11571139
getting_started_update_ranking_rules: |-
11581140
let ranking_rules = [
11591141
"exactness",

0 commit comments

Comments
 (0)