Can you post the xpath query you are using, there may be an issue there. For example using jcr:like instead of jcr:contains can cause the behavior you are describing. When you say client side code do you mean browser code, or that it's confidential so you can't post it?