remove unnecessary double counting queryset

When search field is left blank the original version counts twice almost the same queryset - it can differ only by sorting, which is irrelevant when getting count. This patch removes this inefficiency.