Skip to content

Commit

Permalink
changed some rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
NoodleSamaChan committed Jul 2, 2024
1 parent 979d460 commit 968dfab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
9 changes: 9 additions & 0 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,15 @@ search_parameter_guide_show_ranking_score_1: |-
.execute()
.await
.unwrap();
search_parameter_guide_show_ranking_score_details_1: |-
let results: SearchResults<Movie> = client
.index("movies")
.search()
.with_query("dragon")
.with_show_ranking_score_details(true)
.execute()
.await
.unwrap();
search_parameter_guide_matching_strategy_1: |-
let results: SearchResults<Movie> = client
.index("movies")
Expand Down
25 changes: 10 additions & 15 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -838,17 +838,17 @@ impl<Http: HttpClient> Index<Http> {
.await
}

/// Get [separator token](https://www.meilisearch.com/docs/reference/api/settings#separator-tokens) of the [Index].
/// Get [separator token](https://www.meilisearch.com/docs/reference/api/settings#separator-tokens) of the [Index].
///
/// ```
/// # use meilisearch_sdk::{client::*, indexes::*};
/// # client.create_index("get_separator_tokens", None).await.unwrap().wait_for_completion(&client, None, None).await.unwrap();
/// #
/// # let MEILISEARCH_URL = option_env!("MEILISEARCH_URL").unwrap_or("http://localhost:7700");
/// # let MEILISEARCH_API_KEY = option_env!("MEILISEARCH_API_KEY").unwrap_or("masterKey");
/// #
/// # tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap().block_on(async {
/// let client = Client::new(MEILISEARCH_URL, Some(MEILISEARCH_API_KEY)).unwrap();
/// # client.create_index("get_separator_tokens", None).await.unwrap().wait_for_completion(&client, None, None).await.unwrap();
/// let index = client.index("get_separator_tokens");
///
/// let separator_tokens = index.get_separator_tokens().await.unwrap();
Expand Down Expand Up @@ -2108,7 +2108,7 @@ impl<Http: HttpClient> Index<Http> {
}

/// Reset [search cutoff](https://www.meilisearch.com/docs/reference/api/settings#search-cutoff) settings of the [Index].
///
///
/// # Example
///
/// ```
Expand Down Expand Up @@ -2448,6 +2448,7 @@ mod tests {
assert_eq!(expected, res);
}

#[meilisearch_test]
async fn test_get_separator_tokens(index: Index) {
let separator: Vec<&str> = vec![];
let res = index.get_separator_tokens().await.unwrap();
Expand All @@ -2457,15 +2458,12 @@ mod tests {

#[meilisearch_test]
async fn test_set_separator_tokens(client: Client, index: Index) {
let expected: Vec<String> = vec!["@".to_string(), "#".to_string()];
let expected: Vec<String> = vec!["#".to_string(), "@".to_string()];

let task_info = index
.set_separator_tokens(&expected)
.await
.unwrap();
let task_info = index.set_separator_tokens(&expected).await.unwrap();
client.wait_for_task(task_info, None, None).await.unwrap();

let mut res = index.get_separator_tokens().await.unwrap();
let res = index.get_separator_tokens().await.unwrap();

assert_eq!(expected, res);
}
Expand Down Expand Up @@ -2505,15 +2503,12 @@ mod tests {

#[meilisearch_test]
async fn test_set_non_separator_tokens(client: Client, index: Index) {
let expected: Vec<String> = vec![ "@".to_string(), "#".to_string()];
let expected: Vec<String> = vec!["#".to_string(), "@".to_string()];

let task_info = index
.set_non_separator_tokens(&expected)
.await
.unwrap();
let task_info = index.set_non_separator_tokens(&expected).await.unwrap();
client.wait_for_task(task_info, None, None).await.unwrap();

let mut res = index.get_non_separator_tokens().await.unwrap();
let res = index.get_non_separator_tokens().await.unwrap();

assert_eq!(expected, res);
}
Expand Down

0 comments on commit 968dfab

Please sign in to comment.