embeddedTime = System.currentTimeMillis() - embeddedTime;
Set<String> refreshedIndexes = new HashSet<String>();
refreshTime = System.currentTimeMillis();
for (IndexAction action : actions) {
if (action.getIndex() != null &&
<BUG>!refreshedIndexes.contains(action.getIndex().getIndexName())){
</BUG>
refreshedIndexes.add(action.getIndex().getIndexName());
action.getIndex().refresh();
refreshes.add(action.getIndex().getIndexName());

embeddedTime = System.currentTimeMillis() - embeddedTime;
Set<String> refreshedIndexes = new HashSet<String>();
refreshTime = System.currentTimeMillis();
for (IndexAction action : actions) {
if (action.getIndex() != null &&
!refreshedIndexes.contains(action.getIndex().getIndexName())) {
refreshedIndexes.add(action.getIndex().getIndexName());
action.getIndex().refresh();
refreshes.add(action.getIndex().getIndexName());
