implement query term search