Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unit testing 用指数测试neo4j_Unit Testing_Nosql_Neo4j - Fatal编程技术网

Unit testing 用指数测试neo4j

Unit testing 用指数测试neo4j,unit-testing,nosql,neo4j,Unit Testing,Nosql,Neo4j,我想用nosql单元测试我的neo4j项目。只要我不需要lucene索引,这就行了。有没有办法用索引创建测试数据库? 我认为graphml不可能提供索引,因此我尝试使用如下自动索引: @Before public void startAutoIndex(){ AutoIndexer<Node> nodeAutoIndexer = graphDb.index().getNodeAutoIndexer(); nodeAutoIndexer.startAutoIndexin

我想用nosql单元测试我的neo4j项目。只要我不需要lucene索引,这就行了。有没有办法用索引创建测试数据库? 我认为graphml不可能提供索引,因此我尝试使用如下自动索引:

@Before
public void startAutoIndex(){
    AutoIndexer<Node> nodeAutoIndexer = graphDb.index().getNodeAutoIndexer();
    nodeAutoIndexer.startAutoIndexingProperty( "id" );
    nodeAutoIndexer.startAutoIndexingProperty( "refname" );
    nodeAutoIndexer.setEnabled(true);
}
@之前
公共无效startAutoIndex(){
自动索引器nodeAutoIndexer=graphDb.index().getNodeAutoIndexer();
nodeAutoIndexer.startAutoIndexingProperty(“id”);
nodeAutoIndexer.startAutoIndexingProperty(“refname”);
nodeAutoIndexer.setEnabled(true);
}
这对我不管用。 是否有其他方法实现自动索引

致意 一月

通常有两种方式

  • 您可以使用
    geoff
    xml导出格式

  • 或者使用graphml,但使用
    conf/server.properties
    文件在服务器端设置自动索引。在此处,设置以下行:

    节点自动索引=真
    节点\键\可索引=id,参照名称

  • 重新启动数据库并执行graphml导入(假设导入的节点将
    id
    refname
    作为其属性-如果需要neo4j数据库的常规id而不是唯一id,则无需将id指定为索引)