private static String extractUuidFromFilter(Filter filter) { Filter.PropertyRestriction restriction = filter .getPropertyRestriction("jcr:uuid"); return restriction.first.toString(); }
&& (filter.getPropertyRestriction(NATIVE_SOLR_QUERY) != null || filter.getPropertyRestriction(NATIVE_LUCENE_QUERY) != null || configuration.useForPropertyRestrictions()) && !hasIgnoredProperties(filter.getPropertyRestrictions(), configuration)) {
private static String extractUuidFromFilter(Filter filter) { Filter.PropertyRestriction restriction = filter .getPropertyRestriction("jcr:uuid"); return restriction.first.toString(); }
&& (filter.getPropertyRestriction(NATIVE_SOLR_QUERY) != null || filter.getPropertyRestriction(NATIVE_LUCENE_QUERY) != null || configuration.useForPropertyRestrictions()) && !hasIgnoredProperties(filter.getPropertyRestrictions(), configuration)) {
private static String extractUuidFromFilter(Filter filter) { Filter.PropertyRestriction restriction = filter .getPropertyRestriction("jcr:uuid"); return restriction.first.toString(); }
@Test public void oak4170() throws ParseException { String sql2 = "select * from [nt:unstructured] where CONTAINS([jcr:content/metadata/comment], 'december')"; Filter f = createFilterSQL(sql2); String plan = f.toString(); // with the "property is not null" restriction, it would be: // assertEquals("Filter(query=select * from [nt:unstructured] " + // "where CONTAINS([jcr:content/metadata/comment], 'december') " + // "fullText=jcr:content/metadata/comment:\"december\", " + // "path=*, property=[jcr:content/metadata/comment=[is not null]])", plan); assertEquals("Filter(query=select * from [nt:unstructured] " + "where CONTAINS([jcr:content/metadata/comment], 'december') " + "fullText=jcr:content/metadata/comment:\"december\", " + "path=*)", plan); assertEquals(f.getPropertyRestrictions().toString(), 0, f.getPropertyRestrictions().size()); f.getPropertyRestriction("jcr:content/metadata/comment"); }
private static boolean wrongIndex(Filter filter) { // skip index if "option(index ...)" doesn't match PropertyRestriction indexName = filter.getPropertyRestriction(IndexConstants.INDEX_NAME_OPTION); if (indexName != null && indexName.first != null) { // index name specified: just verify this, and ignore tags return !"nodetype".equals(indexName.first.getValue(Type.STRING)); } PropertyRestriction indexTag = filter.getPropertyRestriction(IndexConstants.INDEX_TAG_OPTION); // index tag specified (the nodetype index doesn't support tags) return indexTag != null && indexTag.first != null; }
private static boolean wrongIndex(Filter filter) { // skip index if "option(index ...)" doesn't match PropertyRestriction indexName = filter.getPropertyRestriction(IndexConstants.INDEX_NAME_OPTION); if (indexName != null && indexName.first != null) { // index name specified: just verify this, and ignore tags return !"nodetype".equals(indexName.first.getValue(Type.STRING)); } PropertyRestriction indexTag = filter.getPropertyRestriction(IndexConstants.INDEX_TAG_OPTION); // index tag specified (the nodetype index doesn't support tags) return indexTag != null && indexTag.first != null; }
private static boolean wrongIndex(Filter filter) { // skip index if "option(index ...)" doesn't match PropertyRestriction indexName = filter.getPropertyRestriction(IndexConstants.INDEX_NAME_OPTION); if (indexName != null && indexName.first != null) { // index name specified: just verify this, and ignore tags return !"nodetype".equals(indexName.first.getValue(Type.STRING)); } PropertyRestriction indexTag = filter.getPropertyRestriction(IndexConstants.INDEX_TAG_OPTION); // index tag specified (the nodetype index doesn't support tags) return indexTag != null && indexTag.first != null; }
@Override public double getCost(Filter filter, NodeState rootState) { if (filter.getPropertyRestriction("jcr:uuid") != null) { return 1; } return Double.MAX_VALUE; }
private boolean canEvalNodeNameRestriction(IndexingRule indexingRule) { PropertyRestriction pr = filter.getPropertyRestriction(QueryConstants.RESTRICTION_LOCAL_NAME); if (pr == null){ return false; } return indexingRule.isNodeNameIndexed(); }
@Override public void collect(Filter filter) { uuid = null; Filter.PropertyRestriction restriction = filter .getPropertyRestriction("jcr:uuid"); if (restriction == null || restriction.isLike || !restriction.firstIncluding || !restriction.lastIncluding || !restriction.first.equals(restriction.last)) { init = true; return; } uuid = restriction.first.toString(); super.collect(filter); }
@Override public void collect(Filter filter) { uuid = null; Filter.PropertyRestriction restriction = filter .getPropertyRestriction("jcr:uuid"); if (restriction == null || restriction.isLike || !restriction.firstIncluding || !restriction.lastIncluding || !restriction.first.equals(restriction.last)) { init = true; return; } uuid = restriction.first.toString(); super.collect(filter); }
@Override public void collect(Filter filter) { uuid = null; Filter.PropertyRestriction restriction = filter .getPropertyRestriction("jcr:uuid"); if (restriction == null || restriction.isLike || !restriction.firstIncluding || !restriction.lastIncluding || !restriction.first.equals(restriction.last)) { init = true; return; } uuid = restriction.first.toString(); super.collect(filter); }
private static boolean wrongIndex(ChildNodeEntry entry, Filter filter) { PropertyRestriction indexName = filter.getPropertyRestriction(IndexConstants.INDEX_NAME_OPTION); boolean wrong = false; if (indexName != null && indexName.first != null) { PropertyRestriction indexTag = filter.getPropertyRestriction(IndexConstants.INDEX_TAG_OPTION); if (indexTag != null && indexTag.first != null) {
PropertyRestriction indexName = filter.getPropertyRestriction(IndexConstants.INDEX_NAME_OPTION); boolean wrong = false; if (indexName != null && indexName.first != null) { PropertyRestriction indexTag = filter.getPropertyRestriction(IndexConstants.INDEX_TAG_OPTION); if (indexTag != null && indexTag.first != null) {
private IndexPlan.Builder getNativeFunctionPlanBuilder(String indexingRuleBaseNodeType) { boolean canHandleNativeFunction = true; PropertyValue pv = filter.getPropertyRestriction(definition.getFunctionName()).first; String query = pv.getValue(Type.STRING);
private List<String> query(Filter filter, String propertyName, String propertyRestrictionName) { HybridPropertyIndexLookup lookup = new HybridPropertyIndexLookup(indexPath, builder.getNodeState()); Iterable<String> paths = lookup.query(filter, propertyName, filter.getPropertyRestriction(propertyRestrictionName)); return ImmutableList.copyOf(paths); }
@Ignore("OAK-4170") @Test public void fulltext() throws Exception { Filter f = createFilterSQL("select * from [nt:unstructured] where CONTAINS([jcr:content/metadata/comment], 'december')"); assertNotNull(f.getPropertyRestriction("jcr:content/metadata/comment")); } }
@Override public Cursor query(Filter filter, NodeState rootState) { Filter.PropertyRestriction pr = filter.getPropertyRestriction("jcr:uuid"); if (pr != null) { NodeBuilder nb = rootState.builder(); //Fake the index type by reverting to "property" for final evaluation nb.child("oak:index").child("uuid").setProperty("type", PropertyIndexEditorProvider.TYPE); rootState = nb.getNodeState(); PropertyIndexLookup pil = new PropertyIndexLookup(rootState); return Cursors.newPathCursor(pil.query(filter, "jcr:uuid", pr.first), new QueryEngineSettings()); } return null; }