Package org.apache.jackrabbit.oak.spi

Examples of org.apache.jackrabbit.oak.spi.QueryIndex


        if (mk != this.mk) {
            return Collections.emptyList();
        }
        ArrayList<QueryIndex> list = new ArrayList<QueryIndex>();
        for (Index index : indexes.values()) {
            QueryIndex qi = null;
            if (index instanceof PropertyIndex) {
                qi = new PropertyContentIndex(mk, (PropertyIndex) index);
            } else if (index instanceof PrefixIndex) {
                // TODO support prefix indexes?
            }
View Full Code Here


        q.prepare();
        return q.executeQuery(mk.getHeadRevision());
    }

    public QueryIndex getBestIndex(FilterImpl filter) {
        QueryIndex best = null;
        double bestCost = Double.MAX_VALUE;
        for (QueryIndex index : getIndexes()) {
            double cost = index.getCost(filter);
            if (cost < bestCost) {
                best = index;
View Full Code Here

        q.prepare();
        return q.executeQuery(mk.getHeadRevision());
    }

    public QueryIndex getBestIndex(FilterImpl filter) {
        QueryIndex best = null;
        double bestCost = Double.MAX_VALUE;
        for (QueryIndex index : getIndexes()) {
            double cost = index.getCost(filter);
            if (cost < bestCost) {
                best = index;
View Full Code Here

        Tree tree = root.getTree("/");

        tree.setProperty("foo", MemoryValueFactory.INSTANCE.createValue("bar"));
        root.commit(DefaultConflictHandler.OURS);

        QueryIndex index = new LuceneIndex(store, "jcr:system", "oak:lucene");
        FilterImpl filter = new FilterImpl(null);
        filter.restrictPath("/", Filter.PathRestriction.EXACT);
        filter.restrictProperty(
                "foo",
                Operator.EQUAL,
                MemoryValueFactory.INSTANCE.createValue("bar"));
        Cursor cursor = index.query(filter, null);
        assertTrue(cursor.next());
        assertEquals("/", cursor.currentPath());
        assertFalse(cursor.next());
    }
View Full Code Here

    public List<QueryIndex> getQueryIndexes(MicroKernel mk) {
        init();
        if (queryIndexList == null) {
            queryIndexList = new ArrayList<QueryIndex>();
            for (Index index : indexes.values()) {
                QueryIndex qi = null;
                if (index instanceof PropertyIndex) {
                    qi = new PropertyContentIndex((PropertyIndex) index);
                } else if (index instanceof PrefixIndex) {
                    // TODO support prefix indexes?
                }
View Full Code Here

    public List<QueryIndex> getQueryIndexes(MicroKernel mk) {
        init();
        if (queryIndexList == null) {
            queryIndexList = new ArrayList<QueryIndex>();
            for (Index index : indexes.values()) {
                QueryIndex qi = null;
                if (index instanceof PropertyIndex) {
                    qi = new PropertyContentIndex((PropertyIndex) index);
                } else if (index instanceof PrefixIndex) {
                    // TODO support prefix indexes?
                }
View Full Code Here

        Tree tree = root.getTree("/");

        tree.setProperty("foo", MemoryValueFactory.INSTANCE.createValue("bar"));
        root.commit(DefaultConflictHandler.OURS);

        QueryIndex index = new LuceneIndex(store, indexInfo);
        FilterImpl filter = new FilterImpl(null);
        filter.restrictPath("/", Filter.PathRestriction.EXACT);
        filter.restrictProperty(
                "foo",
                Operator.EQUAL,
                MemoryValueFactory.INSTANCE.createValue("bar"));
        Cursor cursor = index.query(filter, null);
        assertTrue(cursor.next());
        assertEquals("/", cursor.currentPath());
        assertFalse(cursor.next());
    }
View Full Code Here

        q.prepare();
        return q.executeQuery(mk.getHeadRevision());
    }

    public QueryIndex getBestIndex(FilterImpl filter) {
        QueryIndex best = null;
        double bestCost = Double.MAX_VALUE;
        for (QueryIndex index : getIndexes()) {
            double cost = index.getCost(filter);
            if (cost < bestCost) {
                best = index;
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.spi.QueryIndex

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.