Examples of existsForNodes()


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

    }

    @Override
    public <T extends PropertyContainer> Index<T> getIndex(String indexName) {
        IndexManager indexManager = delegate.index();
        if (indexManager.existsForNodes(indexName)) return (Index<T>) indexManager.forNodes(indexName);
        if (indexManager.existsForRelationships(indexName)) return (Index<T>) indexManager.forRelationships(indexName);
        throw new IllegalArgumentException("Index "+indexName+" does not exist.");
    }

    // TODO handle existing indexes
View Full Code Here

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

    // TODO handle existing indexes
    @Override
    public <T extends PropertyContainer> Index<T> createIndex(Class<T> type, String indexName, boolean fullText) {
        IndexManager indexManager = delegate.index();
        if (isNode(type)) {
            if (indexManager.existsForNodes(indexName))
                return (Index<T>) checkAndGetExistingIndex(indexName, fullText, indexManager.forNodes(indexName));
            return (Index<T>) indexManager.forNodes(indexName, indexConfigFor(fullText));
        } else {
            if (indexManager.existsForRelationships(indexName))
                return (Index<T>) checkAndGetExistingIndex(indexName, fullText, indexManager.forRelationships(indexName));
View Full Code Here

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

            System.out.println("testInvalidConfig: invalid index creation failed, good, let the tx rollback");
        }
        tx.close();
        System.out.println("testInvalidConfig: tx done.");
        // Assert index isn't referenced in the manager
        assertFalse("Index should not exist", indexMan.existsForNodes("layer1"));
    }

    /*
    * Test the deletion of indexes
    */
 
View Full Code Here

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

            e.printStackTrace();
        }
        // Request deletion
        index.delete();
        // Assert deletion
        assertFalse(indexMan.existsForNodes("layer1"));
        // TODO: we should probably check the internal structure was also cleanly deleted
    }

    @Test
    public void testNodeIndex() throws SyntaxException, Exception {
View Full Code Here

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

     }
  
    @Test
      public void checkForIndex() throws Exception {
        IndexManager index = getRestGraphDb().index();
        assertTrue(index.existsForNodes("heroes"));
      }
   
    @Test
      public void useTrinityIndex() throws Exception {
        IndexManager index = getRestGraphDb().index();            
View Full Code Here

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

          
           @Test
           public void checkForIndex() throws Exception {
               IndexManager index = graphDb.index();
               assertTrue(index.existsForNodes("heroes"));
           }
          
           @Test
           public void checkForHeroesCollection() throws Exception {
               Node heroesCollectionNode = mdg.getHeroesCollectionNode();
View Full Code Here

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

    @SuppressWarnings("unchecked")
    @Override
    public <T extends PropertyContainer> Index<T> getIndex(String indexName) {
        IndexManager indexManager = delegate.index();
        if (indexManager.existsForNodes(indexName)) return (Index<T>) indexManager.forNodes(indexName);
        if (indexManager.existsForRelationships(indexName)) return (Index<T>) indexManager.forRelationships(indexName);
        throw new NoSuchIndexException(indexName);
    }

    // TODO handle existing indexes
View Full Code Here

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

    public <T extends PropertyContainer> Index<T> createIndex(Class<T> type, String indexName, IndexType indexType) {
        Transaction tx = delegate.beginTx();
        try {
            IndexManager indexManager = delegate.index();
            if (isNode(type)) {
                if (indexManager.existsForNodes(indexName))
                    return (Index<T>) checkAndGetExistingIndex(indexName, indexType, indexManager.forNodes(indexName));
                Index<Node> index = indexManager.forNodes(indexName, indexConfigFor(indexType));
                return (Index<T>) index;
            } else {
                if (indexManager.existsForRelationships(indexName))
View Full Code Here

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

    @Test
    public void checkIfIndexExists()
    {
        // START SNIPPET: checkIfExists
        IndexManager index = graphDb.index();
        boolean indexExists = index.existsForNodes( "actors" );
        // END SNIPPET: checkIfExists
        assertTrue( indexExists );
    }

    @Test
View Full Code Here

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

        Transaction tx = graphDb.beginTx();
        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
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.