【发布时间】:2014-09-11 02:40:26
【问题描述】:
我已将 freebase 转储导入 neo4j。但是由于数据库的大小,目前我面临获取查询的问题。导入时,我刚刚创建了节点索引并索引了 URI 属性以索引每个节点。对于每个节点,我添加了多个属性,例如 label_en、type_content_type_en。
props.put(URI_PROPERTY, subject.stringValue());
Long subjectNode = db.createNode(props);
tmpIndex.put(subject.stringValue(), subjectNode);
nodeIndex.add(subjectNode, props);
现在我的密码查询是这样的。哪些正在超时。我无法在 label_en 属性上添加索引。有人可以帮忙吗?
match (n)-[r*0..1]->(a) where n.label_en=~'Hibernate.*' return n, a
更新
BatchInserter db = BatchInserters.inserter("ttl.db", config);
BatchInserterIndexProvider indexProvider = new LuceneBatchInserterIndexProvider(db);
BatchInserterIndex index = indexProvider.nodeIndex("ttlIndex", MapUtil.stringMap("type", "exact"));
问题:当我在 nodeindex 中添加节点时,我添加了属性 URI
props.put(URI_PROPERTY, subject.stringValue());
Long subjectNode = db.createNode(props);
nodeIndex.add(subjectNode, props);
稍后在代码中,我向节点添加了另一个属性(命名为 label_en)。但我没有添加或更新 nodeindex。因此,据我了解,lucene 没有索引 label_en 属性。我的图表已经构建好了,所以我正在尝试在我的节点的 label_en 属性上添加索引,因为我的查询位于 label_en 上。
【问题讨论】:
标签: neo4j