Examples of indexFor()


Examples of org.neo4j.graphdb.schema.Schema.indexFor()

    @Test
    public void shouldReturnResultsLabeledIndexOnVertexWithHasHas() {
        this.g.tx().readWrite();
        final Schema schema = this.g.getBaseGraph().schema();
        schema.indexFor(DynamicLabel.label("Person")).on("name").create();
        this.g.tx().commit();
        this.g.addVertex(T.label, "Person", "name", "marko");
        this.g.addVertex(T.label, "Person", "name", "marko");
        this.g.tx().commit();
        assertEquals(2, this.g.V().has(T.label, "Person").has("name", "marko").count().next(), 0);
View Full Code Here

Examples of org.neo4j.graphdb.schema.Schema.indexFor()

    @Test
    public void shouldEnsureColonedKeyIsTreatedAsNormalKey() {
        this.g.tx().readWrite();
        final Schema schema = this.g.getBaseGraph().schema();
        schema.indexFor(DynamicLabel.label("Person")).on("name").create();
        this.g.tx().commit();
        this.g.addVertex(T.label, "Person", "name", "marko");
        this.g.addVertex(T.label, "Person", "name", "marko");
        this.g.tx().commit();
        assertEquals(2, this.g.V().has(T.label, "Person").has("name", "marko").count().next(), 0);
View Full Code Here

Examples of org.neo4j.graphdb.schema.Schema.indexFor()

    @Test
    public void shouldReturnResultsUsingLabeledIndexOnVertexWithHasHasHas() {
        this.g.tx().readWrite();
        final Schema schema = this.g.getBaseGraph().schema();
        schema.indexFor(DynamicLabel.label("Person")).on("name").create();
        this.g.tx().commit();
        this.g.addVertex(T.label, "Person", "name", "marko", "color", "blue");
        this.g.addVertex(T.label, "Person", "name", "marko", "color", "green");
        this.g.tx().commit();
        assertEquals(1, this.g.V().has(T.label, "Person").has("name", "marko").has("color", "blue").count().next(), 0);
View Full Code Here

Examples of org.neo4j.graphdb.schema.Schema.indexFor()

    @Test
    public void shouldReturnResultsUsingLabeledIndexOnVertexWithColonFails() {
        this.g.tx().readWrite();
        final Schema schema = this.g.getBaseGraph().schema();
        schema.indexFor(DynamicLabel.label("Person")).on("name").create();
        this.g.tx().commit();
        this.g.addVertex(T.label, "Person", "name", "marko");
        this.g.addVertex(T.label, "Person", "name", "marko");
        this.g.tx().commit();
        assertNotEquals(2l, this.g.V().has("Person:name", "marko").count().next().longValue());
View Full Code Here

Examples of org.neo4j.graphdb.schema.Schema.indexFor()

    @Test
    public void shouldDoLabelAndIndexSearch() {
        g.tx().readWrite();

        final Schema schema = g.getBaseGraph().schema();
        schema.indexFor(DynamicLabel.label("Person")).on("name").create();
        this.g.tx().commit();

        this.g.addVertex(T.label, "Person", "name", "marko");
        this.g.addVertex(T.label, "Person", "name", "john");
        this.g.addVertex(T.label, "Person", "name", "pete");
View Full Code Here

Examples of org.neo4j.graphdb.schema.Schema.indexFor()

    @Test
    public void shouldDoLabelAndLegacyIndexSearch() {
        g.tx().readWrite();

        final Schema schema = g.getBaseGraph().schema();
        schema.indexFor(DynamicLabel.label("Person")).on("name").create();

        final AutoIndexer<Node> nodeAutoIndexer = this.g.getBaseGraph().index().getNodeAutoIndexer();
        nodeAutoIndexer.startAutoIndexingProperty("name");

        this.g.tx().commit();
View Full Code Here

Examples of org.neo4j.graphdb.schema.Schema.indexFor()

    public void shouldSupportVertexPropertyToVertexMappingOnIndexCalls() {
        // todo: review this feature check - this test does a lot of stuff - maybe losing some important assertions this way
        if (g.features().vertex().supportsMultiProperties()) {
            g.tx().readWrite();
            final Schema schema = g.getBaseGraph().schema();
            schema.indexFor(DynamicLabel.label("person")).on("name").create();
            schema.indexFor(DynamicLabel.label("name")).on(T.value.getAccessor()).create();
            this.g.tx().commit();

            final Vertex a = g.addVertex(T.label, "person", "name", "marko", "age", 34);
            a.property("name", "okram");
View Full Code Here

Examples of org.neo4j.graphdb.schema.Schema.indexFor()

        // todo: review this feature check - this test does a lot of stuff - maybe losing some important assertions this way
        if (g.features().vertex().supportsMultiProperties()) {
            g.tx().readWrite();
            final Schema schema = g.getBaseGraph().schema();
            schema.indexFor(DynamicLabel.label("person")).on("name").create();
            schema.indexFor(DynamicLabel.label("name")).on(T.value.getAccessor()).create();
            this.g.tx().commit();

            final Vertex a = g.addVertex(T.label, "person", "name", "marko", "age", 34);
            a.property("name", "okram");
            a.property("name", "marko a. rodriguez");
View Full Code Here

Examples of org.neo4j.graphdb.schema.Schema.indexFor()

    @Test
    public void shouldDoLabelsNameSpaceBehavior() {
        g.tx().readWrite();

        final Schema schema = g.getBaseGraph().schema();
        schema.indexFor(DynamicLabel.label("Person")).on("name").create();
        schema.indexFor(DynamicLabel.label("Product")).on("name").create();
        schema.indexFor(DynamicLabel.label("Corporate")).on("name").create();

        this.g.tx().commit();
        this.g.addVertex(T.label, "Person", "name", "marko");
View Full Code Here

Examples of org.neo4j.graphdb.schema.Schema.indexFor()

    public void shouldDoLabelsNameSpaceBehavior() {
        g.tx().readWrite();

        final Schema schema = g.getBaseGraph().schema();
        schema.indexFor(DynamicLabel.label("Person")).on("name").create();
        schema.indexFor(DynamicLabel.label("Product")).on("name").create();
        schema.indexFor(DynamicLabel.label("Corporate")).on("name").create();

        this.g.tx().commit();
        this.g.addVertex(T.label, "Person", "name", "marko");
        this.g.addVertex(T.label, "Person", "name", "john");
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.