Examples of forNodes()


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

    @Test
    public void testLoadIndex() {
        db.beginTx();
        Map<String, String> config = TimelineNodeIndex.CONFIG;
        IndexManager indexMan = db.index();
        Index<Node> index = indexMan.forNodes("timeline1", config);
        assertNotNull(index);

    }

    @Test
View Full Code Here

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

        db.beginTx();
        Map<String, String> config = new HashMap<String, String>(TimelineNodeIndex.CONFIG);
        final Node startNode = ReferenceNodes.getReferenceNode(db);
        config.put(TimelineNodeIndex.START_NODE_ID, String.valueOf(startNode.getId()));
        IndexManager indexMan = db.index();
        Index<Node> index = indexMan.forNodes("timeline1", config);
        final Timeline timeline = ((TimelineNodeIndex) index).getTimeline();
        assertEquals(startNode, timeline.getUnderlyingNode());
        assertNotNull(index);

    }
View Full Code Here

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

    @Test
    public void testAddToIndex() throws Exception {
        Transaction tx = db.beginTx();
        Map<String, String> config = TimelineNodeIndex.CONFIG;
        IndexManager indexMan = db.index();
        Index<Node> index = indexMan.forNodes("timeline1", config);
        assertNotNull(index);
        Node n1 = db.createNode();
        n1.setProperty("time", 123);
        index.add(n1, "timestamp", 123L);
        Node n2 = db.createNode();
View Full Code Here

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

        IndexManager indexManager = graph.index();
        result.put("node-indexes", Arrays.asList(indexManager.nodeIndexNames()));
        result.put("relationship-indexes", Arrays.asList(indexManager.relationshipIndexNames()));
        try {
            for (String ix : indexManager.nodeIndexNames()) {
                final Index<Node> index = indexManager.forNodes(ix);
                getMutableIndex(index).delete();
            }
            for (String ix : indexManager.relationshipIndexNames()) {
                final RelationshipIndex index = indexManager.forRelationships(ix);
                getMutableIndex(index).delete();
View Full Code Here

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

        try {
            final IndexManager indexManager = db.index();
            Node[] nodes = new Node[max];
            for (int i = 0; i < max; i++) {
                nodes[i] = db.createNode();
                final Index<Node> index = indexManager.forNodes("node_index_" + String.valueOf(i % 5));
                index.add(nodes[i],"ID",i);
            }
            Random random = new Random();
            for (int i = 0; i < max * 2; i++) {
                int from = random.nextInt(max);
View Full Code Here

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

    private void generateIndex(final Parameter<Object, Object>... indexParameters) {
        final IndexManager manager = this.graph.getRawGraph().index();
        if (Vertex.class.isAssignableFrom(this.indexClass)) {
            if (indexParameters.length > 0)
                this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forNodes(this.indexName, generateParameterMap(indexParameters));
            else
                this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forNodes(this.indexName);
        } else {
            if (indexParameters.length > 0)
                this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forRelationships(this.indexName, generateParameterMap(indexParameters));
View Full Code Here

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

        final IndexManager manager = this.graph.getRawGraph().index();
        if (Vertex.class.isAssignableFrom(this.indexClass)) {
            if (indexParameters.length > 0)
                this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forNodes(this.indexName, generateParameterMap(indexParameters));
            else
                this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forNodes(this.indexName);
        } else {
            if (indexParameters.length > 0)
                this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forRelationships(this.indexName, generateParameterMap(indexParameters));
            else
                this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forRelationships(this.indexName);
View Full Code Here

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

    private void generateIndex(final Parameter<Object, Object>... indexParameters) {
        this.graph.autoStartTransaction(true);
        final IndexManager manager = this.graph.getRawGraph().index();
        if (Vertex.class.isAssignableFrom(this.indexClass)) {
            if (indexParameters.length > 0)
                this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forNodes(this.indexName, generateParameterMap(indexParameters));
            else
                this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forNodes(this.indexName);
        } else {
            if (indexParameters.length > 0)
                this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forRelationships(this.indexName, generateParameterMap(indexParameters));
View Full Code Here

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

        final IndexManager manager = this.graph.getRawGraph().index();
        if (Vertex.class.isAssignableFrom(this.indexClass)) {
            if (indexParameters.length > 0)
                this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forNodes(this.indexName, generateParameterMap(indexParameters));
            else
                this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forNodes(this.indexName);
        } else {
            if (indexParameters.length > 0)
                this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forRelationships(this.indexName, generateParameterMap(indexParameters));
            else
                this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forRelationships(this.indexName);
View Full Code Here

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

    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
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.