private String constructAnalyzedPropertyName(String pname) { if (definition.getVersion().isAtLeast(IndexFormatVersion.V2)){ return FieldNames.createAnalyzedFieldName(pname); } return pname; }
public Matcher match(String name, NodeState nodeState) { boolean result = currentInclude.match(name, nodeState, depth); if (result){ if (hasMore()){ return new Matcher(this, Status.CONTINUE, depth, nodeState, path(name)); } else { return new Matcher(this, Status.MATCH_FOUND, depth, nodeState, path(name)); } } else { return new Matcher(this, Status.FAIL, depth); } }
@Override public boolean match(String name, NodeState nodeState, int depth) { //As per JR2 the primaryType is enforced on last element //last segment -> add to collector if node type matches if (depth == maxDepth() - 1 && primaryType != null && !matchingType(primaryType, nodeState)) { return false; } return super.match(name, nodeState, depth); }
private PropertyDefinition pd(String propName){ IndexDefinition defn = new IndexDefinition(root, defnb.build(), indexPath); return defn.getApplicableIndexingRule("nt:base").getConfig(propName); } }
public void collectAggregates(NodeState root, ResultCollector collector) { if (matchingType(nodeTypeName, root)) { List<Matcher> matchers = createMatchers(); collectAggregates(root, matchers, collector); } }
private static IndexingRule getRule(IndexDefinition defn, String typeName){ return defn.getApplicableIndexingRule(asState(newNode(typeName))); }
protected static int getPropertyType(PropertyDefinition defn, String name, int defaultVal) { if (defn.isTypeDefined()) { return defn.getType(); } return defaultVal; }
/** * Returns <code>true</code> if the property with the given name is * indexed according to this rule. * * @param propertyName the name of a property. * @return <code>true</code> if the property is indexed; * <code>false</code> otherwise. */ public boolean isIndexed(String propertyName) { return getConfig(propertyName) != null; }
public void close() { resetCache(); // don't clean the persistent map on purpose, so we don't re-try // after restarting the service or so closeExecutorService(); }
@Override public void done() throws CommitFailedException { for (PropertyUpdateCallback callback : callbacks) { callback.done(); } } }
@Override public LuceneIndexDefinition.Builder reindex() { super.reindex(); return this; }
@Override public long getSize(SizePrecision precision, long max) { if (estimatedSize != 0) { return estimatedSize; } return estimatedSize = sizeEstimator.getSize(); } }
/** * Returns the property type. If no explicit type is defined the default is assumed * to be {@link PropertyType#STRING} * * @return propertyType as per javax.jcr.PropertyType */ public int getType(){ //If no explicit type is defined we assume it to be string return isTypeDefined() ? propertyType : PropertyType.STRING; }
private ExecutorService getExecutor() { if (executorService == null) { createExecutor(); } return executorService; }
public boolean hasRelativeNodeInclude(String nodePath) { for (NodeInclude ni : relativeNodeIncludes){ if (ni.matches(nodePath)){ return true; } } return false; }
private static boolean hasPatternMatcher(List<Matcher> matchers){ for (Matcher m : matchers){ if (m.isPatternBased()){ return true; } } return false; }
/** * Returns the nodeName at current depth. This should only be called * if and only if #isPatternBased is false otherwise it would throw exception */ public String getNodeName() { return currentInclude.getElementNameIfNotAPattern(depth); }
private String constructAnalyzedPropertyName(String pname) { if (definition.getVersion().isAtLeast(IndexFormatVersion.V2)){ return FieldNames.createAnalyzedFieldName(pname); } return pname; }
@Override public LuceneIndexDefinition.Builder reindex() { super.reindex(); return this; }
@Override public long getSize(SizePrecision precision, long max) { if (estimatedSize != 0) { return estimatedSize; } return estimatedSize = sizeEstimator.getSize(); } }