0
我使用批量插入方法創建neo4j圖形數據庫。加載DBpedia數據集並構建它的屬性圖。Neo4j索引不起作用
public Neo4jBatchHandler(BatchInserter db2, int indexCache, int timeout) {
this.db = db2;
this.indexCache = indexCache;
this.timeout = timeout;
BatchInserterIndexProvider indexProvider = new LuceneBatchInserterIndexProvider(
db);
index = indexProvider.nodeIndex("ttlIndex",
MapUtil.stringMap("type", "exact"));
index.setCacheCapacity("__URI__", indexCache + 1);
}
這是我用於索引的代碼。
查詢操作期間,我想使用索引可能性來提高效率。但不幸的是它不起作用。下面是我的代碼:
IndexHits<Long> hits = index.get("__URI__",
resourceName);
返回null,但我敢肯定,數據庫包含與resourceName
資源。我應該如何在這裏使用索引進行查詢?
我做了他們兩個。不幸的是,結果是一樣的。 –