Package org.neo4j.rest.graphdb.index

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


 
  @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

  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

    @Override
    @SuppressWarnings("unchecked")
    public <T extends PropertyContainer> RestIndex<T> getIndex(String indexName) {
        final RestIndexManager index = this.index();
        if (index.existsForNodes(indexName)) return (RestIndex<T>) index.forNodes(indexName);
        if (index.existsForRelationships(indexName)) return (RestIndex<T>) index.forRelationships(indexName);
        throw new IllegalArgumentException("Index " + indexName + " does not yet exist");
    }

    @Override
    @SuppressWarnings("unchecked")
View Full Code Here

    @Override
    @SuppressWarnings("unchecked")
    public <T extends PropertyContainer> RestIndex<T> getIndex(String indexName) {
        final RestIndexManager index = this.index();
        if (index.existsForNodes(indexName)) return (RestIndex<T>) index.forNodes(indexName);
        if (index.existsForRelationships(indexName)) return (RestIndex<T>) index.forRelationships(indexName);
        throw new IllegalArgumentException("Index " + indexName + " does not yet exist");
    }

    @Override
    @SuppressWarnings("unchecked")
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.