Package org.neo4j.graphdb.index

Examples of org.neo4j.graphdb.index.BatchInserterIndexProvider.shutdown()


        Map<String, Object> properties = MapUtil.map( "name", "Keanu Reeves" );
        long node = inserter.createNode( properties );
        actors.add( node, properties );

        // Make sure to shut down the index provider
        indexProvider.shutdown();
        inserter.shutdown();
        // END SNIPPET: batchInsert
    }
}
View Full Code Here


                inserter );
        BatchInserterIndex index = provider.nodeIndex( "users",
                LuceneIndexImplementation.EXACT_CONFIG );
        long id = inserter.createNode( null );
        index.add( id, map( "name", "Joe", "other", "Schmoe" ) );
        provider.shutdown();
        provider = new LuceneBatchInserterIndexProvider(
                inserter );
        index = provider.nodeIndex( "users",
                LuceneIndexImplementation.EXACT_CONFIG );
        index.add( id, map( "name", "Joe", "other", "Schmoe" ) );
View Full Code Here

        provider = new LuceneBatchInserterIndexProvider(
                inserter );
        index = provider.nodeIndex( "users",
                LuceneIndexImplementation.EXACT_CONFIG );
        index.add( id, map( "name", "Joe", "other", "Schmoe" ) );
        provider.shutdown();
        inserter.shutdown();
    }
   
    @Test
    public void testSome() throws Exception
View Full Code Here

        assertContains( index.query( "name:Joe0 AND other:Schmoe" ),
                ids.get( 0 ) );

        assertContains( index.query( "name", "Joe*" ),
                ids.values().toArray( new Long[ids.size()] ) );
        provider.shutdown();
        inserter.shutdown();

        GraphDatabaseService db = new EmbeddedGraphDatabase( path );
        assertTrue( db.index().existsForNodes( "users" ) );
        Index<Node> dbIndex = db.index().forNodes( "users" );
View Full Code Here

        index.add( id3, map( "name", new String[] { "What Ever", "Anything" } ) );
        index.flush();
        assertContains( index.get( "name", "What Ever" ), id3 );
        assertContains( index.get( "name", "Anything" ), id3 );

        provider.shutdown();
        inserter.shutdown();

        GraphDatabaseService db = new EmbeddedGraphDatabase( path );
        Index<Node> dbIndex = db.index().forNodes( name );
        Node node1 = db.getNodeById( id1 );
View Full Code Here

        assertEquals(
                String.format( "Should return relationship id" ),
                new Long( relationshipId ),
                edgesIndex.query( "EDGE_TYPE", EdgeType.KNOWS.name() ).getSingle() );

        indexProvider.shutdown();
        inserter.shutdown();
    }
   
    @Test
    public void triggerNPEAfterFlush()
View Full Code Here

        long node = inserter.createNode( map );
        index.add( node, map );
        index.flush();
        assertContains( index.get( "name", "Something" ), node );
       
        provider.shutdown();
        inserter.shutdown();
    }
   
    @Test
    public void testNumericValues()
View Full Code Here

        long node2 = inserter.createNode( null );
        index.add( node2, map( "number", numeric( 21 ) ) );
        assertContains( index.query( "number",
                newIntRange( "number", 21, 50, true, true ) ), node1, node2 );
       
        provider.shutdown();
        inserter.shutdown();
       
        GraphDatabaseService db = new EmbeddedGraphDatabase( path );
        Node n1 = db.getNodeById( node1 );
        Node n2 = db.getNodeById( node2 );
View Full Code Here

        index.flush();
       
        assertEquals( 1, index.get( "key", 123L ).size() );
        assertEquals( 1, index.get( "key", "123" ).size() );
       
        provider.shutdown();
        inserter.shutdown();
    }

    private enum EdgeType implements RelationshipType
    {
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.