Neo4j和spring-data-neo4j - 导入大型数据集

时间:2014-03-12 20:19:12

标签: neo4j spring-data-neo4j

我正在使用Neo4j数据库和spring-data-neo4j。现在,我想导入相当大的数据集,因此我研究了批量插入的neo4j功能。

经过我的研究,我发现了:

  1. BatchInserter用于嵌入式数据库:http://docs.neo4j.org/chunked/stable/batchinsert.html和使用它的Michael Hunger项目:https://github.com/jexp/batch-import/
  2. REST Batch端点:http://docs.neo4j.org/chunked/stable/rest-api-batch-ops.html允许在单个请求中发送多个操作(因此在一个事务中执行多个操作)。
  3. 现在,我想知道是否有可能以某种方式使用spring-data-neo4j的存储库功能进行批量插入,因为即使save(Iterable<U> entities)中的方法AbstractGraphRepository只是遍历每个元素并调用save代表一个实体:

    @Override
    @Transactional
    public <U extends T> Iterable<U> save(Iterable<U> entities) {
        for (U entity : entities) {
            save(entity);
        }
        return entities;
    }
    

1 个答案:

答案 0 :(得分:1)

目前批量插入没有官方支持。

但你可以尝试这样的事情:http://code.paananen.fi/2012/04/05/neo4j-batchinserter-and-spring-data-for-neo4j/

它正在使用3.0之前的SDN版本

相关问题