Implementing eager loading for search queries