Examples of existsForRelationships()


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

    @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
    @Override
View Full Code Here

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

        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));
            return (Index<T>) indexManager.forRelationships(indexName, indexConfigFor(fullText));
        }
    }
View Full Code Here

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

      Map<String, Object> props = new HashMap<String, Object>();
    props.put("name", "test");
      Relationship rel = this.restAPI.createRelationship(refNode, node, Type.TEST, props );
    this.restAPI.createIndex(Relationship.class, "indexName", LuceneIndexImplementation.FULLTEXT_CONFIG);
    IndexManager index = getRestGraphDb().index();
        assertTrue(index.existsForRelationships("indexName"));
  }
 
  @Test
  public void testIndexForRelationships(){
    RestIndexManager index = (RestIndexManager) getRestGraphDb().index();
View Full Code Here

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

    @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
    @SuppressWarnings("unchecked")
View Full Code Here

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

                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))
                    return (Index<T>) checkAndGetExistingIndex(indexName, indexType, indexManager.forRelationships(indexName));
                return (Index<T>) indexManager.forRelationships(indexName, indexConfigFor(indexType));
            }
        } finally {
            tx.success();tx.close();
View Full Code Here

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

        GraphDatabaseService graphDb = new EmbeddedGraphDatabase( path );
        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();
View Full Code Here

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

                matches.add( hit );
            }
        }
        for ( String indexName : search.getRelationshipIndexNames() )
        {
            if ( !indexManager.existsForRelationships( indexName ) )
            {
                continue;
            }
            Index<Relationship> relIndex = indexManager.forRelationships( indexName );
            IndexHits<Relationship> hits;
View Full Code Here

Examples of org.neo4j.rest.graphdb.index.RestIndexManager.existsForRelationships()

 
  @Test
  public void testIndexForRelationships(){
    RestIndexManager index = (RestIndexManager) getRestGraphDb().index();
         Index<Relationship> testIndex = index.forRelationships("indexName");
         assertTrue(index.existsForRelationships("indexName"));
  }
 
  @Test
  public void testGetIndexForRelationships(){
    RestIndexManager index = (RestIndexManager) getRestGraphDb().index();
View Full Code Here

Examples of org.neo4j.rest.graphdb.index.RestIndexManager.existsForRelationships()

 
  @Test
  public void testCreateRestAPIIndexForRelationships(){   
    this.restAPI.createIndex(Relationship.class, "indexName", LuceneIndexImplementation.FULLTEXT_CONFIG);
    RestIndexManager index = (RestIndexManager) getRestGraphDb().index();
        assertTrue(index.existsForRelationships("indexName"));
  }
 
 
  @Test
  public void testForDoubleCreatedIndexForRelationshipsWithSameParams() {
View Full Code Here

Examples of org.neo4j.rest.graphdb.index.RestIndexManager.existsForRelationships()

  public void testCreateIndexWithSameNameButDifferentType(){
    this.restAPI.createIndex(Relationship.class, "indexName", LuceneIndexImplementation.FULLTEXT_CONFIG);
    this.restAPI.createIndex(Node.class, "indexName", LuceneIndexImplementation.FULLTEXT_CONFIG);
    RestIndexManager index = (RestIndexManager) getRestGraphDb().index();
    assertTrue(index.existsForNodes("indexName"));
    assertTrue(index.existsForRelationships("indexName"));
  }

    @Test
    public void testCreateNodeUniquely() {
        final RestIndex<Node> index = restAPI.createIndex(Node.class, "unique-node", LuceneIndexImplementation.EXACT_CONFIG);
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.