我已經將freebase轉儲導入到neo4j。但目前我正面臨着由於db的大小而得到查詢的問題。雖然導入我剛剛創建節點索引並索引URI屬性索引爲每個節點。對於每個節點,我都添加了多個屬性,如label_en,type_content_type_en。在neo4j節點屬性值上添加索引
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添加節點i增加了財產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上的。