diff --git a/src/resources/talent.rs b/src/resources/talent.rs index 7f5f94e..f490248 100644 --- a/src/resources/talent.rs +++ b/src/resources/talent.rs @@ -239,7 +239,7 @@ impl Talent { "current_location", &vec_from_params!(params, "current_location")), >::build_terms( - "id", &vec_from_params!(params, "ids")), + "id", &vec_from_params!(params, "bookmarked_talents")), Talent::visibility_filters(epoch, i32_vec_from_params!(params, "presented_talents"), @@ -256,7 +256,10 @@ impl Talent { "blocked_companies", &company_id), >::build_terms( - "id", &vec_from_params!(params, "contacted_talents")) + "id", &vec_from_params!(params, "contacted_talents")), + + >::build_terms( + "id", &vec_from_params!(params, "ignored_talents")), ].into_iter() .flat_map(|x| x) .collect::>()) @@ -1065,6 +1068,16 @@ mod tests { assert_eq!(vec![1, 4], results.ids()); } + // Ignoring some talents + { + let mut params = Map::new(); + params.assign("keywords", Value::String("database admin".to_owned())).unwrap(); + params.assign("ignored_talents[]", Value::U64(1)).unwrap(); + + let results = Talent::search(&mut client, &*index, ¶ms); + assert_eq!(vec![4], results.ids()); + } + // highlight { let mut params = Map::new(); @@ -1087,14 +1100,14 @@ mod tests { // filtering for given bookmarks (ids) { let mut params = Map::new(); - params.assign("ids[]", Value::U64(2)).unwrap(); - params.assign("ids[]", Value::U64(4)).unwrap(); - params.assign("ids[]", Value::U64(1)).unwrap(); - params.assign("ids[]", Value::U64(3)).unwrap(); - params.assign("ids[]", Value::U64(5)).unwrap(); - params.assign("ids[]", Value::U64(6)).unwrap(); - params.assign("ids[]", Value::U64(7)).unwrap(); - params.assign("ids[]", Value::U64(8)).unwrap(); + params.assign("bookmarked_talents[]", Value::U64(2)).unwrap(); + params.assign("bookmarked_talents[]", Value::U64(4)).unwrap(); + params.assign("bookmarked_talents[]", Value::U64(1)).unwrap(); + params.assign("bookmarked_talents[]", Value::U64(3)).unwrap(); + params.assign("bookmarked_talents[]", Value::U64(5)).unwrap(); + params.assign("bookmarked_talents[]", Value::U64(6)).unwrap(); + params.assign("bookmarked_talents[]", Value::U64(7)).unwrap(); + params.assign("bookmarked_talents[]", Value::U64(8)).unwrap(); let results = Talent::search(&mut client, &*index, ¶ms); assert_eq!(vec![4, 5, 2, 1], results.ids());