Package org.neo4j.rest.graphdb.index

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


 
  @Test
  public void testIndexForNodes(){
    RestIndexManager index = (RestIndexManager) getRestGraphDb().index();
         Index<Node> testIndex = index.forNodes("indexName");
         assertTrue(index.existsForNodes("indexName"));
  }
 
  @Test
  public void testGetIndexForNodes(){
    RestIndexManager index = (RestIndexManager) getRestGraphDb().index();
View Full Code Here


 
  @Test
  public void testCreateRestAPIIndexForNodes(){   
    this.restAPI.createIndex(Node.class, "indexName", LuceneIndexImplementation.FULLTEXT_CONFIG);
    RestIndexManager index = (RestIndexManager) getRestGraphDb().index();
        assertTrue(index.existsForNodes("indexName"));
  }
 
 
  @Test
  public void testForDoubleCreatedIndexForNodesWithSameParams() {
View Full Code Here

  @Test
  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() {
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
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
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.