Package org.neo4j.graphdb.index

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


            assertNotNull(index);

            //Try loading the same index with a different config
            boolean exceptionThrown = false;
            try {
                index = indexMan.forNodes("layer2", config);
            } catch (IllegalArgumentException iae) {
                exceptionThrown = true;
            }
            assertTrue(exceptionThrown);
View Full Code Here


                exceptionThrown = true;
            }
            assertTrue(exceptionThrown);

            config = SpatialIndexProvider.SIMPLE_WKT_CONFIG;
            index = indexMan.forNodes("layer2", config);
            assertNotNull(index);

            config = SpatialIndexProvider.SIMPLE_WKB_CONFIG;
            index = indexMan.forNodes("layer3", config);
            assertNotNull(index);
View Full Code Here

            config = SpatialIndexProvider.SIMPLE_WKT_CONFIG;
            index = indexMan.forNodes("layer2", config);
            assertNotNull(index);

            config = SpatialIndexProvider.SIMPLE_WKB_CONFIG;
            index = indexMan.forNodes("layer3", config);
            assertNotNull(index);
            tx.success();
        }
    }
View Full Code Here

        System.out.println("testInvalidConfig: Begun transaction");

        // Try to create the index, ignore IllegalArgumentException to continue
        IndexManager indexMan = db.index();
        try {
            Index<Node> index = indexMan.forNodes("layer1", config);
            System.out.println("testInvalidConfig: invalid index requested, did not throw exception.");
            tx.success();    // Won't happen currently
        } catch (IllegalArgumentException e) {
            // Bail out
            tx.failure();
View Full Code Here

    //TODO: fix this, issue #70
    public void testDeleteIndex() {
        // Create an index
        Map<String, String> config = SpatialIndexProvider.SIMPLE_POINT_CONFIG;
        IndexManager indexMan = db.index();
        Index<Node> index = indexMan.forNodes("layer1", config);
        assertNotNull(index);
        Transaction transaction = db.beginTx();

        Node node = null;
        try {
View Full Code Here

    public void testNodeIndex() throws SyntaxException, Exception {
        Map<String, String> config = SpatialIndexProvider.SIMPLE_POINT_CONFIG;
        IndexManager indexMan = db.index();
        Index<Node> index;
        Transaction tx = db.beginTx();
        index = indexMan.forNodes("layer1", config);
        assertNotNull(index);
        ExecutionEngine engine = new ExecutionEngine(db);
        ExecutionResult result1 = engine.execute("create (malmo{name:'Malmö',lat:56.2, lon:15.3})-[:TRAIN]->(stockholm{name:'Stockholm',lat:59.3,lon:18.0}) return malmo");
        Node malmo = (Node) result1.iterator().next().get("malmo");
        index.add(malmo, "dummy", "value");
View Full Code Here

        Map<String, String> config = SpatialIndexProvider.SIMPLE_WKT_CONFIG;
        IndexManager indexMan = db.index();
        Index<Node> index;
        Transaction tx;
        tx = db.beginTx();
        index = indexMan.forNodes("layer2", config);
        Node batman = db.createNode();
        String wktPoint = "POINT(41.14 37.88 )";
        batman.setProperty("wkt", wktPoint);
        String batman1 = "batman";
        batman.setProperty("name", batman1);
View Full Code Here

    public void testWithinDistanceIndexViaCypher() {
        Map<String, String> config = SpatialIndexProvider.SIMPLE_WKT_CONFIG;
        IndexManager indexMan = db.index();
        Index<Node> index;
        try (Transaction tx = db.beginTx()) {
            index = indexMan.forNodes("layer3", config);
            Node robin = db.createNode();
            robin.setProperty("wkt", "POINT(44.44 33.33)");
            robin.setProperty("name", "robin");
            index.add(robin, "dummy", "value");
View Full Code Here

        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

        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

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.