// Create the optimizer for the query engine ...
IndexPlanners indexPlanners = IndexPlanners.withProviders(plannersByProviderName);
Optimizer optimizer = optimizer();
if (optimizer == null) {
// Create a single indexing rule that will use the index planner from all the providers ...
final OptimizerRule indexingRule = AddIndexes.with(indexPlanners);
// Create the optimizer that will add the providers' indexes using the same IndexingRule instance
optimizer = new RuleBasedOptimizer() {
@Override
protected void populateIndexingRules( LinkedList<OptimizerRule> ruleStack,
PlanHints hints ) {