[PDT-5578] Fix bug when querying for an object without any items in the i...

...ndex