@Override public PropertyValue currentProperty() { String path = selector.currentPath(); if (path == null) { return null; } String name = PathUtils.getName(path); // TODO reverse namespace remapping? return PropertyValues.newName(name); }
@Override public PropertyValue currentProperty() { String path = selector.currentPath(); if (path == null) { return null; } String name = PathUtils.getName(path); // TODO reverse namespace remapping? return PropertyValues.newName(name); }
@Override public PropertyValue currentProperty() { String path = selector.currentPath(); if (path == null) { return null; } String name = PathUtils.getName(path); // TODO reverse namespace remapping? return PropertyValues.newName(name); }
/** * Returns the paths that match the given node types. * * @param filter the filter (used for logging) * @return the matched paths (the result might contain duplicate entries) */ public Iterable<String> query(Filter filter) { PropertyIndexLookup lookup = new PropertyIndexLookup(root, mountInfoProvider); return Iterables.concat( lookup.query(filter, JCR_PRIMARYTYPE, newName(filter.getPrimaryTypes())), lookup.query(filter, JCR_MIXINTYPES, newName(filter.getMixinTypes()))); }
/** * Returns the paths that match the given node types. * * @param filter the filter (used for logging) * @return the matched paths (the result might contain duplicate entries) */ public Iterable<String> query(Filter filter) { PropertyIndexLookup lookup = new PropertyIndexLookup(root, mountInfoProvider); return Iterables.concat( lookup.query(filter, JCR_PRIMARYTYPE, newName(filter.getPrimaryTypes())), lookup.query(filter, JCR_MIXINTYPES, newName(filter.getMixinTypes()))); }
/** * Returns the paths that match the given node types. * * @param filter the filter (used for logging) * @return the matched paths (the result might contain duplicate entries) */ public Iterable<String> query(Filter filter) { PropertyIndexLookup lookup = new PropertyIndexLookup(root, mountInfoProvider); return Iterables.concat( lookup.query(filter, JCR_PRIMARYTYPE, newName(filter.getPrimaryTypes())), lookup.query(filter, JCR_MIXINTYPES, newName(filter.getMixinTypes()))); }
@SuppressWarnings("Guava") private static Iterator<FulltextResultRow> mergePropertyIndexResult(IndexPlan plan, NodeState rootState, Iterator<FulltextResultRow> itr) { PlanResult pr = getPlanResult(plan); HybridPropertyIndexLookup lookup = new HybridPropertyIndexLookup(pr.indexPath, NodeStateUtils.getNode(rootState, pr.indexPath), plan.getPathPrefix(), false); PropertyIndexResult pir = pr.getPropertyIndexResult(); FluentIterable<String> paths = null; if (pir != null) { Iterable<String> queryResult = lookup.query(plan.getFilter(), pir.propertyName, pir.pr); paths = FluentIterable.from(queryResult) .transform(path -> pr.isPathTransformed() ? pr.transformPath(path) : path) .filter(notNull()); } else { checkState(pr.evaluateSyncNodeTypeRestriction()); //Either of property or nodetype should not be null Filter filter = plan.getFilter(); paths = FluentIterable.from(Iterables.concat( lookup.query(filter, JCR_PRIMARYTYPE, newName(filter.getPrimaryTypes())), lookup.query(filter, JCR_MIXINTYPES, newName(filter.getMixinTypes())))); } //No need for path restriction evaluation as thats taken care by PropertyIndex impl itself //via content mirror strategy FluentIterable<FulltextResultRow> propIndex = paths .transform(path -> new FulltextResultRow(path, 0, null, null, null)); //Property index itr should come first return Iterators.concat(propIndex.iterator(), itr); }
@SuppressWarnings("Guava") private static Iterator<FulltextResultRow> mergePropertyIndexResult(IndexPlan plan, NodeState rootState, Iterator<FulltextResultRow> itr) { PlanResult pr = getPlanResult(plan); HybridPropertyIndexLookup lookup = new HybridPropertyIndexLookup(pr.indexPath, NodeStateUtils.getNode(rootState, pr.indexPath), plan.getPathPrefix(), false); PropertyIndexResult pir = pr.getPropertyIndexResult(); FluentIterable<String> paths = null; if (pir != null) { Iterable<String> queryResult = lookup.query(plan.getFilter(), pir.propertyName, pir.pr); paths = FluentIterable.from(queryResult) .transform(path -> pr.isPathTransformed() ? pr.transformPath(path) : path) .filter(notNull()); } else { checkState(pr.evaluateSyncNodeTypeRestriction()); //Either of property or nodetype should not be null Filter filter = plan.getFilter(); paths = FluentIterable.from(Iterables.concat( lookup.query(filter, JCR_PRIMARYTYPE, newName(filter.getPrimaryTypes())), lookup.query(filter, JCR_MIXINTYPES, newName(filter.getMixinTypes())))); } //No need for path restriction evaluation as thats taken care by PropertyIndex impl itself //via content mirror strategy FluentIterable<FulltextResultRow> propIndex = paths .transform(path -> new FulltextResultRow(path, 0, null, null, null)); //Property index itr should come first return Iterators.concat(propIndex.iterator(), itr); }