BatchInserterIndex を使用して大量のデータを Neo4j DB に取り込みます。バッチ中に TimelineIndex (Lucene) にノードを追加するつもりです。さて、通常の方法では、TimelineIndex はインデックスに追加するのに (node, long) かかります。内部でキー「timestamp」を使用している可能性があります。(githubのLuceneTimeline.javaで確認)
私の問題は、ノードを TL インデックスに挿入できるが、通常の Java API を使用してそれらを取得できないことです。常に、timelineIndex.getFirst() を null として返します。以下のようにインデックスを初期化しました。
通常のアクセス方法
TimelineIndex<Node> timelineIndex = new LuceneTimeline<Node>(graphDB, indexMgr.forNodes("airing-timeline")); //graphDb initialised properly earlier.
timelineIndex.add(node, 1234560000L);
バッチ取り込み
BatchInserterIndex timelineIndex = indexProvider.nodeIndex("airing-timeline", MapUtil.stringMap("type", "exact")); //Initialised just like regular way
Map<String, Object> timelineIndexPropertiesMap = new HashMap<String, Object>();
timelineIndexPropertiesMap.put("timestamp", 1234560000L); //Checked the code of LuceneTimeline.java and found this internal property for timeline
timelineIndex.query("*:*").size(); // return 0 (zero)
timelineIndex.add(airing_node_id, timelineIndexPropertiesMap);
timelineIndex.query("*:*").size(); // return 1 (one)
現在、timelineIndex.getFirst() を使用してバッチ インサーターによって追加されたデータを取得しようとすると、常に null が返されます。しかし、SAME DB に通常の方法で追加されたノードは、適切な値を返します。
どこが間違っていますか?