Updated QueryFactory class

Minor API change relating to sorting vs ordering