Package org.neo4j.graphdb.index

Examples of org.neo4j.graphdb.index.IndexManager.forNodes()


    @Test
    public void removeFromIndex()
    {
        IndexManager index = graphDb.index();
        Index<Node> actors = index.forNodes( "actors" );
        Node bellucci = actors.get( "name", "Monica Bellucci" ).getSingle();
        assertNotNull( bellucci );

        // START SNIPPET: removeNodeFromIndex
        // completely remove bellucci from the actors index
View Full Code Here


    @Test
    public void update()
    {
        IndexManager index = graphDb.index();
        Index<Node> actors = index.forNodes( "actors" );

        // START SNIPPET: update
        // create a node with a property
        Node fishburn = graphDb.createNode();
        fishburn.setProperty( "name", "Fishburn" );
View Full Code Here

    @Test
    public void doQueriesForNodes()
    {
        IndexManager index = graphDb.index();
        Index<Node> actors = index.forNodes( "actors" );
        Index<Node> movies = index.forNodes( "movies" );
        Set<String> found = new HashSet<String>();
        @SuppressWarnings( "serial" ) Set<String> expectedActors = new HashSet<String>()
        {
            {
View Full Code Here

    @Test
    public void doQueriesForNodes()
    {
        IndexManager index = graphDb.index();
        Index<Node> actors = index.forNodes( "actors" );
        Index<Node> movies = index.forNodes( "movies" );
        Set<String> found = new HashSet<String>();
        @SuppressWarnings( "serial" ) Set<String> expectedActors = new HashSet<String>()
        {
            {
                add( "Monica Bellucci" );
View Full Code Here

    public void doQueriesForRelationships()
    {
        IndexManager index = graphDb.index();
        RelationshipIndex roles = index.forRelationships( "roles" );
        Index<Node> actors = graphDb.index().forNodes( "actors" );
        Index<Node> movies = index.forNodes( "movies" );

        Node reeves = actors.get( "name", "Keanu Reeves" ).getSingle();
        Node theMatrix = movies.get( "title", "The Matrix" ).getSingle();

        // START SNIPPET: queryForRelationships
View Full Code Here

    @Test
    public void fulltext()
    {
        // START SNIPPET: fulltext
        IndexManager index = graphDb.index();
        Index<Node> fulltextMovies = index.forNodes( "movies-fulltext",
                MapUtil.stringMap( "provider", "lucene", "type", "fulltext" ) );
        // END SNIPPET: fulltext

        Index<Node> movies = index.forNodes( "movies" );
        Node theMatrix = movies.get( "title", "The Matrix" ).getSingle();
View Full Code Here

        IndexManager index = graphDb.index();
        Index<Node> fulltextMovies = index.forNodes( "movies-fulltext",
                MapUtil.stringMap( "provider", "lucene", "type", "fulltext" ) );
        // END SNIPPET: fulltext

        Index<Node> movies = index.forNodes( "movies" );
        Node theMatrix = movies.get( "title", "The Matrix" ).getSingle();
        Node theMatrixReloaded = movies.get( "title", "The Matrix Reloaded" ).getSingle();

        // START SNIPPET: fulltext
        fulltextMovies.add( theMatrix, "title", "The Matrix" );
View Full Code Here

        try
        {
            IndexManager indexManager = graphDb.index();
            Assert.assertFalse( indexManager.existsForRelationships( indexName ) );
            Assert.assertTrue( indexManager.existsForNodes( indexName ) );
            Assert.assertNotNull( indexManager.forNodes( indexName ) );
            Index<Node> nodes = graphDb.index().forNodes( indexName );
            Assert.assertTrue( nodes.get( "name", "test" ).hasNext() );
            tx.success();
            tx.finish();
        }
View Full Code Here

        {
            if ( !indexManager.existsForNodes( indexName ) )
            {
                continue;
            }
            Index<Node> nodeIndex = indexManager.forNodes( indexName );
            Iterable<Node> hits;
            switch ( search.getMode() )
            {
            case EXACT_MATCH:
                hits = nodeIndex.get( search.getKey(), search.getValueOrQuery() );
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.