Skip to content
Merged
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
8 changes: 4 additions & 4 deletions examples/cli-app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ async fn build_index() {
// serialize the string to clothes objects
let clothes: Vec<Clothes> = serde_json::from_str(content).unwrap();

//create displayed attributes
// create displayed attributes
let displayed_attributes = ["article", "cost", "size", "pattern"];

// Create ranking rules
let ranking_rules = ["words", "typo", "attribute", "exactness", "cost:asc"];

//create searchable attributes
// create searchable attributes
let searchable_attributes = ["seaon", "article", "size", "pattern"];

// create the synonyms hashmap
Expand All @@ -82,14 +82,14 @@ async fn build_index() {
synonyms.insert("sweat pants", vec!["joggers", "gym pants"]);
synonyms.insert("t-shirt", vec!["tees", "tshirt"]);

//create the settings struct
// create the settings struct
let settings = Settings::new()
.with_ranking_rules(ranking_rules)
.with_searchable_attributes(searchable_attributes)
.with_displayed_attributes(displayed_attributes)
.with_synonyms(synonyms);

//add the settings to the index
// add the settings to the index
let result = CLIENT
.index("clothes")
.set_settings(&settings)
Expand Down
2 changes: 1 addition & 1 deletion examples/web_app/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Build your front-end page in Rust with WebAssembly

> **Note**
> It is not possible to run Meilisearch in the browser without a server. This demo uses the Rust SDK in a browser using WASM, and communicate with a Meilisearch instance that is running on a remote server.
> It is not possible to run Meilisearch in the browser without a server. This demo uses the Rust SDK in a browser using WASM, and communicates with a Meilisearch instance that is running on a remote server.

This example is a clone of [crates.meilisearch.com](https://crates.meilisearch.com), but the front-end is written in Rust!
The Rust source files are compiled into WebAssembly and so can be readable by the browsers.
Expand Down
Loading