Examples of restrictPath()


Examples of org.apache.jackrabbit.oak.query.index.FilterImpl.restrictPath()

        NodeState indexed = HOOK.processCommit(before, after, CommitInfo.EMPTY);

        QueryIndex queryIndex = new LuceneIndex(analyzer, null);
        FilterImpl filter = createFilter(NT_BASE);
        filter.restrictPath("/", Filter.PathRestriction.EXACT);
        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertTrue(cursor.hasNext());
        assertEquals("/", cursor.next().getPath());
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl.restrictPath()

        IndexTracker tracker = new IndexTracker();
        tracker.update(indexed);
        QueryIndex queryIndex = new LuceneIndex(tracker, analyzer, null);
        FilterImpl filter = createFilter(NT_BASE);
        filter.restrictPath("/", Filter.PathRestriction.EXACT);
        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertTrue(cursor.hasNext());
        assertEquals("/", cursor.next().getPath());
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl.restrictPath()

        tree.addChild("someothernode");
        root.commit();

        QueryIndex index = new SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(mock(SelectorImpl.class), "", new QueryEngineSettings());
        filter.restrictPath("/somenode", Filter.PathRestriction.EXACT);
        Cursor cursor = index.query(filter, store.getRoot());
        assertCursor(cursor, "/somenode");
    }

    @Test
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl.restrictPath()

        someothernode.addChild("someotherchild");
        root.commit();

        QueryIndex index = new SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(mock(SelectorImpl.class), "", new QueryEngineSettings());
        filter.restrictPath("/somenode", Filter.PathRestriction.DIRECT_CHILDREN);
        Cursor cursor = index.query(filter, store.getRoot());
        assertCursor(cursor, "/somenode/child1", "/somenode/child2");
    }

    @Test
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl.restrictPath()

        someothernode.addChild("someotherchild");
        root.commit();

        QueryIndex index = new SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(mock(SelectorImpl.class), "", new QueryEngineSettings());
        filter.restrictPath("/somenode", Filter.PathRestriction.ALL_CHILDREN);
        Cursor cursor = index.query(filter, store.getRoot());
        assertCursor(
                cursor, "/somenode", "/somenode/child1",
                "/somenode/child2", "/somenode/child2/descendant");
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl.restrictPath()

        NodeState indexed = hook.processCommit(before, after, CommitInfo.EMPTY);

        QueryIndex queryIndex = new SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(mock(SelectorImpl.class), "", new QueryEngineSettings());
        filter.restrictPath("/newnode", Filter.PathRestriction.EXACT);
        filter.restrictProperty("prop", Operator.EQUAL,
                PropertyValues.newString("val"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertNotNull(cursor);
        assertTrue("no results found", cursor.hasNext());
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl.restrictPath()

        SolrServer solrServer = mock(SolrServer.class);
        OakSolrConfiguration configuration = new DefaultSolrConfiguration();
        SolrQueryIndex solrQueryIndex = new SolrQueryIndex("solr", solrServer, configuration);

        FilterImpl filter = new FilterImpl(selector, "select * from [nt:base] as a where isdescendantnode(a, '/test')", new QueryEngineSettings());
        filter.restrictPath("/test", Filter.PathRestriction.ALL_CHILDREN);
        double cost = solrQueryIndex.getCost(filter, root);
        assertTrue(Double.POSITIVE_INFINITY == cost);
    }

    @Test
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl.restrictPath()

            }
        };
        SolrQueryIndex solrQueryIndex = new SolrQueryIndex("solr", solrServer, configuration);

        FilterImpl filter = new FilterImpl(selector, "select * from [nt:base] as a where isdescendantnode(a, '/test')", new QueryEngineSettings());
        filter.restrictPath("/test", Filter.PathRestriction.ALL_CHILDREN);
        double cost = solrQueryIndex.getCost(filter, root);
        assertTrue(10 == cost);
    }

    @Test
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl.restrictPath()

        NodeState after = builder.getNodeState();

        NodeState indexed = HOOK.processCommit(before, after, CommitInfo.EMPTY);

        FilterImpl f = createFilter(indexed, NT_BASE);
        f.restrictPath("/path1", Filter.PathRestriction.ALL_CHILDREN);

        // Query the index
        PropertyIndexLookup lookup = new PropertyIndexLookup(indexed);
        double cost;
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl.restrictPath()

        NodeState after = builder.getNodeState();

        NodeState indexed = HOOK.processCommit(before, after, CommitInfo.EMPTY);

        FilterImpl f = createFilter(indexed, NT_BASE);
        f.restrictPath("/a", Filter.PathRestriction.ALL_CHILDREN);

        // Query the index
        PropertyIndexLookup lookup = new PropertyIndexLookup(indexed);
        assertEquals(ImmutableSet.of("a"), find(lookup, "foo", "abc", f));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.