Fix for complex search

errant SQL for complex search resolved