private IndexPlan getIndexPlan(Filter filter, OakSolrConfiguration configuration, LMSEstimator estimator, List<OrderEntry> sortOrder, String path) { if (getMatchingFilterRestrictions(filter, configuration) > 0) { IndexPlan indexPlan = planBuilder(filter) .setEstimatedEntryCount(estimator.estimate(filter)) .setSortOrder(sortOrder) .setPlanName(path) .setPathPrefix(getPathPrefix(path)) .build(); log.debug("index plan {}", indexPlan); return indexPlan; } else { return null; } }
private IndexPlan getIndexPlan(Filter filter, OakSolrConfiguration configuration, LMSEstimator estimator, List<OrderEntry> sortOrder, String path) { if (getMatchingFilterRestrictions(filter, configuration) > 0) { IndexPlan indexPlan = planBuilder(filter) .setEstimatedEntryCount(estimator.estimate(filter)) .setSortOrder(sortOrder) .setPlanName(path) .setPathPrefix(getPathPrefix(path)) .build(); log.debug("index plan {}", indexPlan); return indexPlan; } else { return null; } }
void addPlan(String name, long cost, boolean supportsPathRestriction) { plans.add(new IndexPlan.Builder() .setCostPerEntry(1) .setCostPerExecution(1) .setEstimatedEntryCount(cost) .setSupportsPathRestriction(supportsPathRestriction) .setPlanName(name) .build()); }
@Nullable private IndexPlan.Builder defaultPlan() { // With OAK-7947 lucene indexes return a non-null index node to delay reading index files // While IndexNode could have a status check method but for now we are using this work-around // to check null on {@code getIndexStatistics()} as proxy indicator // (this could be avoided by returning lazy statistics) if (indexNode.getIndexStatistics() == null) { return null; } return new IndexPlan.Builder() .setCostPerExecution(definition.getCostPerExecution()) .setCostPerEntry(definition.getCostPerEntry()) .setFulltextIndex(definition.isFullTextEnabled()) .setIncludesNodeData(false) // we should not include node data .setFilter(filter) .setPathPrefix(getPathPrefix()) .setSupportsPathRestriction(definition.evaluatePathRestrictions()) .setDelayed(true) //Lucene is always async .setDeprecated(definition.isDeprecated()) .setAttribute(FulltextIndex.ATTR_PLAN_RESULT, result) .setEstimatedEntryCount(estimatedEntryCount()) .setPlanName(indexPath); }