Implement query searching.