Page 1 of 1

How do I Query my JobOrder Skills for "C#"

Posted: Tue Jul 15, 2014 5:48 pm
by jpsignups
I am having difficulty querying my Job Orders with the skill C#. I am able to query every other skill, so it seems the # symbol is the problem.

Here is my REST url:

.../search/JobOrder?query=(isOpen:1 AND isDeleted:0 AND isPublic:1) AND (customTextBlock2:\"c#*\")&fields=id,publicDescription,title,customTextBlock2,skills(id,name)&count=20&start=0&BhRestToken=XXXXXXXX"

I receive an error
The remote server returned an error: (412) Precondition Failed.

I assume there must be a minimum number of characters required for the search because passing in c? or c* doesn't error but returns no results either.

Thanks in advance

Re: How do I Query my JobOrder Skills for "C#"

Posted: Mon Jul 21, 2014 8:57 am
by SO-BHSupport
Hi JP,

So the issue here I believe is how you have used your brackets. I personally find encoded REST statements perform best and most consistently (especially when using #'s or similar). The best way to do this is to use a website like: http://meyerweb.com/eric/tools/dencoder/ to encode your statements.

So the decoded statement we are looking for should look like:
customTextBlock2:(C#)

This will return accurate results, so think of the brackets as double quotes for all intents and purposes.

Here is the full statement I was running (encoded):

...search/JobOrder?query=customTextBlock2%3A(C%23)&fields=*&sort=id&count=100&start=0&BhRestToken=30565d1c-df8b-4a2b-a906-55646abeb0f2

It would also be worth putting a statement in to not bring back those with a Status of Archive as this generally can confuse our users (as these are "soft deleted" records which won't return in their search unless specifically looked for).

Hope this helps, any other problems please don't hesitate to get in contact!

Kind regards,

Simon O'Keeffe