added logging of searches to a reational database