[Search] Use xrange when dealing with potentially large ranges

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
[Search] remove unused "import datetime"

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>