diff --git a/.code-samples.meilisearch.yaml b/.code-samples.meilisearch.yaml index 404f7b6c..b3ed1dab 100644 --- a/.code-samples.meilisearch.yaml +++ b/.code-samples.meilisearch.yaml @@ -263,7 +263,18 @@ search_parameter_guide_crop_1: |- let results: SearchResults = client.index("movies").search() .with_query("shifu") .with_attributes_to_crop(Selectors::Some(&[("overview", None)])) - .with_crop_length(10) + .with_crop_length(5) + .execute() + .await + .unwrap(); + + // Get the formatted results + let formatted_results: Vec<&Movie> = results.hits.iter().map(|r| r.formatted_result.as_ref().unwrap()).collect(); +search_parameter_guide_crop_marker_1: |- + let results: SearchResults = client.index("movies").search() + .with_query("shifu") + .with_attributes_to_crop(Selectors::Some(&[("overview", None)])) + .with_crop_marker("[…]") .execute() .await .unwrap(); @@ -278,6 +289,18 @@ search_parameter_guide_highlight_1: |- .await .unwrap(); + // Get the formatted results + let formatted_results: Vec<&Movie> = results.hits.iter().map(|r| r.formatted_result.as_ref().unwrap()).collect(); +search_parameter_guide_highlight_tag_1: |- + let results: SearchResults = client.index("movies").search() + .with_query("winter feast") + .with_attributes_to_highlight(Selectors::Some(&["overview"])) + .with_highlight_pre_tag("") + .with_highlight_post_tag("") + .execute() + .await + .unwrap(); + // Get the formatted results let formatted_results: Vec<&Movie> = results.hits.iter().map(|r| r.formatted_result.as_ref().unwrap()).collect(); search_parameter_guide_matches_1: |-