Lucene Search Query on Join - 02367849

Forum for users and developers of Bullhorn's API service.

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
Posts: 41
Joined: Tue Oct 11, 2016 1:26 pm

Lucene Search Query on Join - 02367849

Post 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?"
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?
Posts: 35
Joined: Wed Jul 20, 2016 5:20 am

Re: Lucene Search Query on Join

Post 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
Posts: 5
Joined: Mon Sep 12, 2016 10:23 am

Re: Lucene Search Query on Join

Post 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'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"Katherine"&BhRestToken=XXXXXXXX-XXXX-4686-8364-89755f584b95&fields=*
I hope this helps with your queries.

Kind Regards,
Mike Cogle
Bullhorn Support
Mike Cogle | Bullhorn Support | Senior Enterprise Support Analyst
Post Reply