Examples of PropertyIndex


Examples of org.apache.jackrabbit.oak.plugins.index.PropertyIndex

        Assert.assertEquals("/moved/test2", index.getPath("2", mk.getHeadRevision()));
    }

    @Test
    public void copy() {
        PropertyIndex index = indexer.createPropertyIndex("id", false);

        mk.commit("/", "+ \"test\": { \"test2\": { \"id\": 2 }, \"id\": 1 }", mk.getHeadRevision(), "");
        Assert.assertEquals("/test", index.getPath("1", mk.getHeadRevision()));
        Assert.assertEquals("/test/test2", index.getPath("2", mk.getHeadRevision()));

        mk.commit("/", "* \"test\": \"copied\"", mk.getHeadRevision(), "");
        Iterator<String> it = index.getPaths("1", mk.getHeadRevision());
        Assert.assertTrue(it.hasNext());
        Assert.assertEquals("/copied", it.next());
        Assert.assertTrue(it.hasNext());
        Assert.assertEquals("/test", it.next());
        Assert.assertFalse(it.hasNext());
        it = index.getPaths("2", mk.getHeadRevision());
        Assert.assertTrue(it.hasNext());
        Assert.assertEquals("/copied/test2", it.next());
        Assert.assertTrue(it.hasNext());
        Assert.assertEquals("/test/test2", it.next());
        Assert.assertFalse(it.hasNext());
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.index.PropertyIndex

            boolean unique = false;
            if (property.endsWith("," + PropertyIndexConstants.UNIQUE)) {
                unique = true;
                property = property.substring(0, property.length() - PropertyIndexConstants.UNIQUE.length() - 1);
            }
            PropertyIndex propertyIndex = indexer.getPropertyIndex(property);
            if (propertyIndex == null) {
                throw ExceptionFactory.get("Unknown index: " + index);
            }
            if (unique) {
                String value = propertyIndex.getPath(data, revisionId);
                if (value != null) {
                    s.value(value);
                }
            } else {
                Iterator<String> it = propertyIndex.getPaths(data, revisionId);
                while (it.hasNext()) {
                    s.value(it.next());
                }
            }
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.index.old.PropertyIndex

            boolean unique = false;
            if (property.endsWith("," + PropertyIndexConstants.UNIQUE)) {
                unique = true;
                property = property.substring(0, property.length() - PropertyIndexConstants.UNIQUE.length() - 1);
            }
            PropertyIndex propertyIndex = indexer.getPropertyIndex(property);
            if (propertyIndex == null) {
                throw ExceptionFactory.get("Unknown index: " + index);
            }
            if (unique) {
                String value = propertyIndex.getPath(data, revisionId);
                if (value != null) {
                    s.value(value);
                }
            } else {
                Iterator<String> it = propertyIndex.getPaths(data, revisionId);
                while (it.hasNext()) {
                    s.value(it.next());
                }
            }
        }
View Full Code Here

Examples of org.neo4j.kernel.impl.core.PropertyIndex

    {
        Iterator<PropertyIndex> itr = MyPropertyIndex.index( key ).iterator();
        if ( !itr.hasNext() )
        {
            int id = (int) ds.nextId( PropertyIndex.class );
            PropertyIndex index = createDummyIndex( id, key );
            xaCon.getPropertyIndexConsumer().createPropertyIndex( id, key );
            return index;
        }
        return itr.next();
    }
View Full Code Here

Examples of org.neo4j.kernel.impl.core.PropertyIndex

    {
        Iterator<PropertyIndex> itr = MyPropertyIndex.index( key ).iterator();
        if ( !itr.hasNext() )
        {
            int id = (int) ds.nextId( PropertyIndex.class );
            PropertyIndex index = createDummyIndex( id, key );
            xaCon.getPropertyIndexConsumer().createPropertyIndex( id, key );
            return index;
        }
        return itr.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.