Examples of restrictProperty()


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

        root.commit();

        QueryIndex index = new SolrQueryIndex(testID, server, configuration);
        FilterImpl filter = new FilterImpl(null, null);
        filter.restrictPath("somenode", Filter.PathRestriction.EXACT);
        filter.restrictProperty("foo", Operator.EQUAL, PropertyValues.newString("bar"));
        Cursor cursor = index.query(filter, store.getRoot());
        assertNotNull(cursor);
        assertTrue(cursor.hasNext());
        assertEquals("somenode", cursor.next().getPath());
        assertFalse(cursor.hasNext());
View Full Code Here

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

        IndexDefinition testDef = new IndexDefinitionImpl("solr",
                "solr", "/oak:index/solr");
        QueryIndex queryIndex = new SolrQueryIndex(testDef, server, configuration);
        FilterImpl filter = new FilterImpl(null, null);
        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());
        IndexRow next = cursor.next();
View Full Code Here

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

        IndexDefinition testDef = new IndexDefinitionImpl("solr",
                "solr", "/oak:index/solr");
        QueryIndex queryIndex = new SolrQueryIndex(testDef, server, configuration);
        FilterImpl filter = new FilterImpl(null, null);
        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertNotNull(cursor);
        assertTrue("no results found", cursor.hasNext());
        IndexRow next = cursor.next();
View Full Code Here

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

        IndexDefinition testDef = new IndexDefinitionImpl("solr",
                "solr", "/oak:index/solr");
        QueryIndex queryIndex = new SolrQueryIndex(testDef, server, configuration);
        FilterImpl filter = new FilterImpl(null, null);
        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        filter.restrictFulltextCondition("bar");
        Cursor cursor = queryIndex.query(filter, indexed);

        assertTrue(cursor.hasNext());
View Full Code Here

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

        // "rep:excerpt is not null" to let the index know that
        // we will need the excerpt
        for (ColumnImpl c : query.getColumns()) {
            if (c.getSelector() == this) {
                if (c.getColumnName().equals("rep:excerpt")) {
                    f.restrictProperty("rep:excerpt", Operator.NOT_EQUAL, null);
                }
            }
        }
       
        // all conditions can be pushed to the selectors -
View Full Code Here

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

        IndexDefinition testDef = new IndexDefinitionImpl("solr",
                "solr", "/oak:index/solr");
        QueryIndex queryIndex = new SolrQueryIndex(testDef, server, configuration);
        FilterImpl filter = new FilterImpl(null, null);
        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());
        IndexRow next = cursor.next();
View Full Code Here

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

        IndexDefinition testDef = new IndexDefinitionImpl("solr",
                "solr", "/oak:index/solr");
        QueryIndex queryIndex = new SolrQueryIndex(testDef, server, configuration);
        FilterImpl filter = new FilterImpl(null, null);
        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertNotNull(cursor);
        assertTrue("no results found", cursor.hasNext());
        IndexRow next = cursor.next();
View Full Code Here

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

        IndexDefinition testDef = new IndexDefinitionImpl("solr",
                "solr", "/oak:index/solr");
        QueryIndex queryIndex = new SolrQueryIndex(testDef, server, configuration);
        FilterImpl filter = new FilterImpl(null, null);
        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        filter.restrictFulltextCondition("bar");
        Cursor cursor = queryIndex.query(filter, indexed);

        assertTrue(cursor.hasNext());
View Full Code Here

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

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

        final OrderedPropertyIndex index = new OrderedPropertyIndex();
        final String nodeTypeName = JcrConstants.NT_BASE;
        FilterImpl filter = createFilter(indexed, nodeTypeName);
        filter.restrictProperty("somethingNotIndexed", Operator.EQUAL, PropertyValues.newLong(1L));

        List<QueryIndex.OrderEntry> sortOrder = ImmutableList.of(createOrderEntry(
            ORDERED_PROPERTY, order));

        List<IndexPlan> plans = index.getPlans(filter, sortOrder, indexed);
View Full Code Here

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

        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());
        IndexRow next = cursor.next();
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.