Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #59 from honeypotio/current-location-filter
Browse files Browse the repository at this point in the history
resources/talent: filter for current_location
  • Loading branch information
RoxasShadow authored Jan 31, 2018
2 parents 49b0ec9 + 8e61533 commit 0f93f1d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/resources/talent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ impl Talent {
<Query as VectorOfTerms<String>>::build_terms(
"work_locations", &vec_from_params!(params, "work_locations")),

<Query as VectorOfTerms<String>>::build_terms(
"current_location", &vec_from_params!(params, "current_location")),

<Query as VectorOfTerms<i32>>::build_terms(
"id", &vec_from_params!(params, "ids")),

Expand Down Expand Up @@ -756,7 +759,7 @@ mod tests {
desired_work_roles_experience: vec!["2..3".to_owned(), "5".to_owned()],
professional_experience: "1..2".to_owned(),
work_locations: vec!["Berlin".to_owned()],
current_location: "Berlin".to_owned(),
current_location: "Naples".to_owned(),
work_authorization: "yes".to_owned(),
skills: vec!["JavaScript".to_owned(), "C++".to_owned(), "Ember.js".to_owned()],
summary: "C++ and frontend dev. HTML, C++, JavaScript and C#. Did I say C++?".to_owned(),
Expand Down Expand Up @@ -1098,6 +1101,15 @@ mod tests {
assert_eq!(4, results.total);
}

// filtering for current_location
{
let mut params = Map::new();
params.assign("current_location[]", Value::String("Naples".into())).unwrap();

let results = Talent::search(&mut client, &*index, &params);
assert_eq!(vec![5], results.ids());
}

// filtering for work_authorization
{
let mut params = Map::new();
Expand Down

0 comments on commit 0f93f1d

Please sign in to comment.