Page 1 of 1

Lucene Search Query on Join - 02367849

Posted: Thu Nov 03, 2016 1:08 am
by Kazemi
We're looking to fetch placements for candidates with a certain value on a given field. For example, all placements for candidates with first name "Bob".

This works: "/search/Placement?query=candidate.id:(1234)"
This does not: "/search/Placement?query=candidate.firstName:(Bob)"

Is this because the "firstName" field is not indexed? Is it possible to perform such queries?

Re: Lucene Search Query on Join

Posted: Fri Nov 04, 2016 5:32 am
by lokuber
Maybe your query is badly formated, try adding proper quotes and encode it with functions like http_build_query() (PHP)
Here's an exemple in PHP :

Code: Select all

$url = self::$url . 'search/Placement?';
$params = array(
	 'query'		  => "candidate.firstName:'" . $whatever_firstName . "~'";, // I use fuzzy search in Lucene but you can do as you want
	 'BhRestToken' => self::$session,
	 'useV2'		  => 'true',
	 'fields' 	  => '*', 
);
$response = get($url, http_build_query($params)); // Fake function but you get it
I know that the search/Candidate entity supports such queries but I don't know much about the Placement entity. Check the response code you get

Re: Lucene Search Query on Join

Posted: Mon Nov 07, 2016 12:44 pm
by MikeCogle
Hi Kazemi,

This is Mike from Bullhorn Support. Using the /search function I've been able to query on the name field, but this will return candidate records which have "bob" as a first name OR as a last name. From my testing, it doesn't look like we have the ability to filter specifically by candidate.firstName from within the placement /search call.

Though our /query call does support more fields, and I've been able to use this to successfully limit this to just the firstName.

I've provided examples of how you can do this with both /search and /query below (Though I used "Katherine" as I didn't have any bobs!)

Query (which can drill down to first, or last name)

Code: Select all

https://restX.bullhornstaffing.com/rest-services/XXXXX/query/Placement?where=candidate.firstName='Katherine'&BhRestToken=XXXXXXXX-XXXX-4686-8364-89755f584b95&fields=*
Search (which, as far as I can see, cannot drill down to just first name, but can filter on just "name")

Code: Select all

https://restX.bullhornstaffing.com/rest-services/XXXXX/search/Placement?query=candidate.name:"Katherine"&BhRestToken=XXXXXXXX-XXXX-4686-8364-89755f584b95&fields=*
I hope this helps with your queries.

Kind Regards,
Mike Cogle
Bullhorn Support