Map<Long, JTweet> replyMap = new LinkedHashMap<Long, JTweet>();
SearchResponse rsp = query(query);
SearchHits docs = rsp.getHits();
for (SearchHit sd : docs) {
JTweet tw = readDoc(sd.getId(), sd.getVersion(), sd.getSource());
replyMap.put(tw.getTwitterId(), tw);
}
for (JTweet inReplSolrTweet : replyMap.values()) {
if (JTweet.isDefaultInReplyId(inReplSolrTweet.getInReplyTwitterId()))
continue;
JTweet origTw = tweets.get(inReplSolrTweet.getInReplyTwitterId());
if (origTw != null && addReplyNoTricks(origTw, inReplSolrTweet)) {
updatedTweets.add(origTw);
updatedTweets.add(inReplSolrTweet);
}
}