Package org.neo4j.graphdb.index

Examples of org.neo4j.graphdb.index.IndexManager


     */
    @Test
    @Ignore("slow")
    public void testAddPerformance() {
        Map<String, String> config = SpatialIndexProvider.SIMPLE_POINT_CONFIG;
        IndexManager indexMan = db.index();
        Index<Node> index;

        Transaction tx = db.beginTx();
        index = indexMan.forNodes("pointslayer", config);
        try {
            Random r = new Random();
            final int stepping = 1000;
            long start = System.currentTimeMillis();
            long previous = start;
View Full Code Here


    }

    @Test
    public void testUpdate() {
        Map<String, String> config = SpatialIndexProvider.SIMPLE_POINT_CONFIG;
        IndexManager indexMan = db.index();
        Index<Node> index;

        Transaction tx = db.beginTx();
        index = indexMan.forNodes("pointslayer", config);
        Node n1 = db.createNode();
        n1.setProperty("lat", (double) 56.2);
        n1.setProperty("lon", (double) 15.3);
        index.add(n1, "dummy", "value");
View Full Code Here

    @Test
    public void testCreateFulltextIndex() {
        Map<String,String> config=new HashMap<String, String>();
        config.put("provider", "lucene");
        config.put("type","fulltext");
        final IndexManager indexManager = getRestGraphDb().index();
        final Index<Node> index = indexManager.forNodes("fulltext", config);
        final Map<String, String> config2 = indexManager.getConfiguration(index);
        Assert.assertEquals("provider", config.get("provider"), config2.get("provider"));
        Assert.assertEquals("type", config.get("type"), config2.get("type"));
    }
View Full Code Here

        result.put("relationships", relationships);

    }

    private void clearIndex(Map<String, Object> result) {
        IndexManager indexManager = graph.index();
        result.put("node-indexes", Arrays.asList(indexManager.nodeIndexNames()));
        result.put("relationship-indexes", Arrays.asList(indexManager.relationshipIndexNames()));
        for (String ix : indexManager.nodeIndexNames()) {
            deleteIndex(indexManager.forNodes(ix));
        }
        for (String ix : indexManager.relationshipIndexNames()) {
            deleteIndex(indexManager.forRelationships(ix));
        }
    }
View Full Code Here

        result.put("relationships", relationships);

    }

    private void clearIndex(Map<String, Object> result) {
        IndexManager indexManager = graph.index();
        result.put("node-indexes", Arrays.asList(indexManager.nodeIndexNames()));
        result.put("relationship-indexes", Arrays.asList(indexManager.relationshipIndexNames()));
        for (String ix : indexManager.nodeIndexNames()) {
            indexManager.forNodes(ix).delete();
        }
        for (String ix : indexManager.relationshipIndexNames()) {
            indexManager.forRelationships(ix).delete();
        }
    }
View Full Code Here

             if (this.referenceNode == null) {
                 referenceNode = this.graphDb.createNode();
             }

             //create the index for all characters that are considered good guys (sorry cypher)
             IndexManager index = this.graphDb.index();
             Index<Node> goodGuys = index.forNodes("heroes");
             //create persons collection node
             Node persons = this.graphDb.createNode();
             persons.setProperty("type", "Persons Collection");
             //create heroes collection node
             Node heroes = this.graphDb.createNode();
View Full Code Here

         this.restAPI.createIndex(Node.class, "indexName", LuceneIndexImplementation.FULLTEXT_CONFIG);
  }
 
  @Test
  public void testGetIndexByIndexForNodesCreationViaRestAPI(){
    IndexManager index = getRestGraphDb().index();
      Index<Node> testIndex = index.forNodes("indexName");
      Assert.assertEquals(testIndex.getName(), this.restAPI.getIndex("indexName").getName());
  }
View Full Code Here

      Node node = getRestGraphDb().createNode();
      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"));
  }
View Full Code Here

         this.restAPI.createIndex(Relationship.class, "indexName", LuceneIndexImplementation.FULLTEXT_CONFIG);
  }
 
  @Test
  public void testGetIndexByIndexForRelationshipsCreationViaRestAPI(){
    IndexManager index = getRestGraphDb().index();
      Index<Relationship> testIndex = index.forRelationships("indexName");
      Assert.assertEquals(testIndex.getName(), this.restAPI.getIndex("indexName").getName());
  }
View Full Code Here

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

TOP

Related Classes of org.neo4j.graphdb.index.IndexManager

Copyright © 2018 www.massapicom. 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.