我想用nosql单元测试我的neo4j项目。只要我不需要lucene索引,它就能正常工作。有没有办法创建一个带有索引的测试数据库?我认为graphml没有提供索引的可能性,所以我尝试使用自动索引,如下所示:
@Before
public void startAutoIndex(){
AutoIndexer<Node> nodeAutoIndexer = graphDb.index().getNodeAutoIndexer();
nodeAutoIndexer.startAutoIndexingProperty( "id" );
nodeAutoIndexer.startAutoIndexingProperty( "refname" );
nodeAutoIndexer.setEnabled(true);
}这对我不起作用。有没有其他方法来实现自动索引?
向Jan致以最良好的问候
发布于 2013-01-22 16:10:17
一般来说,有两种方式。
geoff xml导出格式conf/server.properties文件在服务器端设置自动索引。在这里,设置以下行:node_auto_indexing=true
node_keys_indexable=id,重新命名
重新启动数据库并执行neo4j导入(假设导入的节点具有id和refname作为其属性-以防您需要neo4j数据库的常规id,而不是唯一的id,则无需将id指定为索引)。
https://stackoverflow.com/questions/14439103
复制相似问题