move search to query