Package org.neo4j.rest.graphdb.index

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


    }

    private void removeFromIndexes(Relationship relationship) {
        final RestIndexManager indexManager = index();
        for (String indexName : indexManager.relationshipIndexNames()) {
            indexManager.forRelationships(indexName).remove(relationship);
        }
    }
}
View Full Code Here


    }

    private void removeFromIndexes(Relationship relationship) {
        final RestIndexManager indexManager = index();
        for (String indexName : indexManager.relationshipIndexNames()) {
            indexManager.forRelationships(indexName).remove(relationship);
        }
    }
}
View Full Code Here

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

  }
 
  @Test
  public void testGetIndexForRelationships(){
    RestIndexManager index = (RestIndexManager) getRestGraphDb().index();
      Index<Relationship> testIndex = index.forRelationships("indexName");
      Assert.assertEquals(testIndex.getName(), this.restAPI.getIndex("indexName").getName());     
  }
 
  @Test
  public void testCreateRestAPIIndexForRelationships(){   
View Full Code Here

 
  @Test
  public void testForDoubleCreatedIndexForRelationshipsWithSameParamsWithoutFullText() {
    this.restAPI.createIndex(Relationship.class, "indexName", LuceneIndexImplementation.EXACT_CONFIG);   
    RestIndexManager index = (RestIndexManager) getRestGraphDb().index();
         Index<Relationship> testIndex = index.forRelationships("indexName");      
  }
 
  @Test (expected = IllegalArgumentException.class)
  public void testForDoubleCreatedIndexForRelationshipsWithEmptyParams() {
    this.restAPI.createIndex(Relationship.class, "indexName", LuceneIndexImplementation.FULLTEXT_CONFIG);
View Full Code Here

 
  @Test (expected = IllegalArgumentException.class)
  public void testForDoubleCreatedIndexForRelationshipsWithEmptyParams() {
    this.restAPI.createIndex(Relationship.class, "indexName", LuceneIndexImplementation.FULLTEXT_CONFIG);
    RestIndexManager index = (RestIndexManager) getRestGraphDb().index();
         Index<Relationship> testIndex = index.forRelationships("indexName", new HashMap<String, String>());      
  }
 
  @Test (expected = IllegalArgumentException.class)
  public void testForDoubleCreatedIndexForRelationshipsWithEmptyParamsReversed() {
    RestIndexManager index = (RestIndexManager) getRestGraphDb().index();
View Full Code Here

  }
 
  @Test (expected = IllegalArgumentException.class)
  public void testForDoubleCreatedIndexForRelationshipsWithEmptyParamsReversed() {
    RestIndexManager index = (RestIndexManager) getRestGraphDb().index();
         Index<Relationship> testIndex = index.forRelationships("indexName", new HashMap<String, String>());  
    this.restAPI.createIndex(Relationship.class, "indexName", LuceneIndexImplementation.FULLTEXT_CONFIG);      
  }
 
  @Test (expected = IllegalArgumentException.class)
  public void testForDoubleCreatedIndexForRelationshipsWithDifferentParamsViaREST() {
View Full Code Here

  public void testForDoubleCreatedIndexForRelationshipsWithDifferentParams() {
    this.restAPI.createIndex(Relationship.class, "indexName", LuceneIndexImplementation.FULLTEXT_CONFIG);
    HashMap<String, String> config = new HashMap<String, String>();
    config.put("test", "value");
    RestIndexManager index = (RestIndexManager) getRestGraphDb().index();
         Index<Relationship> testIndex = index.forRelationships("indexName", config);  
  }
 
  @Test (expected = IllegalArgumentException.class)
  public void testForDoubleCreatedIndexForRelationshipsWithDifferentParamsReversed() {   
    HashMap<String, String> config = new HashMap<String, String>();
View Full Code Here

  @Test (expected = IllegalArgumentException.class)
  public void testForDoubleCreatedIndexForRelationshipsWithDifferentParamsReversed() {   
    HashMap<String, String> config = new HashMap<String, String>();
    config.put("test", "value");
    RestIndexManager index = (RestIndexManager) getRestGraphDb().index();
         Index<Relationship> testIndex = index.forRelationships("indexName", config)
         this.restAPI.createIndex(Relationship.class, "indexName", LuceneIndexImplementation.FULLTEXT_CONFIG);
  }
 
  @Test
  public void testGetIndexByIndexForRelationshipsCreationViaRestAPI(){
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.