apps.core.search_indexes: Optimize index queries.