Convert query duration to timedelta
Improve search exception handling
Add more search tests