fix for empty document as query field value
removed use of java7 Integer.compare
Merge pull request #7 from renej-github/master

fix for empty document as query field value