Package org.apache.jackrabbit.oak.plugins.index.p2

Examples of org.apache.jackrabbit.oak.plugins.index.p2.Property2IndexHookProvider


     * @param path the path to check.
     * @return <code>true</code> if a node type index exists; <code>false</code>
     *         otherwise.
     */
    public boolean isIndexed(String path) {
        Property2IndexLookup lookup = new Property2IndexLookup(root);
        if (lookup.isIndexed(JCR_PRIMARYTYPE, path)
                && lookup.isIndexed(JCR_MIXINTYPES, path)) {
            return true;
        }

        if (path.startsWith("/")) {
            path = path.substring(1);
View Full Code Here


                path.substring(slash));
    }

    public double getCost(Iterable<String> nodeTypes) {
        PropertyValue ntNames = PropertyValues.newName(nodeTypes);
        Property2IndexLookup lookup = new Property2IndexLookup(root);
        return lookup.getCost(JCR_PRIMARYTYPE, ntNames)
                + lookup.getCost(JCR_MIXINTYPES, ntNames);
    }
View Full Code Here

     * @param nodeTypes the names of the node types to match.
     * @return the matched paths (the result might contain duplicate entries)
     */
    public Iterable<String> query(Filter filter, Iterable<String> nodeTypes) {
        final PropertyValue ntNames = PropertyValues.newName(nodeTypes);
        Property2IndexLookup lookup = new Property2IndexLookup(root);
        return Iterables.concat(
                lookup.query(filter, JCR_PRIMARYTYPE, ntNames),
                lookup.query(filter, JCR_MIXINTYPES, ntNames));
    }
View Full Code Here

        // first check that the index content nodes exist
        checkPathExists(indexed, "oak:index", "rootIndex", ":index");
        checkPathExists(indexed, "newchild", "other", "oak:index", "subIndex",
                ":index");

        Property2IndexLookup lookup = new Property2IndexLookup(indexed);
        assertEquals(ImmutableSet.of("testRoot"), find(lookup, "foo", "abc"));

        Property2IndexLookup lookupChild = new Property2IndexLookup(indexed
                .getChildNode("newchild").getChildNode("other"));
        assertEquals(ImmutableSet.of("testChild"),
                find(lookupChild, "foo", "xyz"));
        assertEquals(ImmutableSet.of(), find(lookupChild, "foo", "abc"));
View Full Code Here

        PropertyState ps = ns.getProperty(REINDEX_PROPERTY_NAME);
        assertNotNull(ps);
        assertFalse(ps.getValue(Type.BOOLEAN).booleanValue());

        // next, lookup
        Property2IndexLookup lookup = new Property2IndexLookup(indexed);
        assertEquals(ImmutableSet.of("testRoot"), find(lookup, "foo", "abc"));
    }
View Full Code Here

        PropertyState ps = ns.getProperty(REINDEX_PROPERTY_NAME);
        assertNotNull(ps);
        assertFalse(ps.getValue(Type.BOOLEAN).booleanValue());

        // next, lookup
        Property2IndexLookup lookup = new Property2IndexLookup(indexed);
        assertEquals(ImmutableSet.of("testRoot"), find(lookup, "foo", "abc"));
    }
View Full Code Here

        PropertyState ps = ns.getProperty(REINDEX_PROPERTY_NAME);
        assertNotNull(ps);
        assertFalse(ps.getValue(Type.BOOLEAN).booleanValue());

        // next, lookup
        Property2IndexLookup lookup = new Property2IndexLookup(indexed);
        assertEquals(ImmutableSet.of("testRoot"), find(lookup, "foo", "abc"));
    }
View Full Code Here

        with(new ConflictValidatorProvider());

        with(new Property2IndexHookProvider());
        with(new AnnotatingConflictHandler());

        with(new Property2IndexProvider());
        with(new NodeTypeIndexProvider());
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.plugins.index.p2.Property2IndexHookProvider

Copyright © 2018 www.massapicom. 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.