Merge branch 'stable-2.10'
* stable-2.10: Remove uneeded dependency in ChangesCollection Delete a change from the index when it is not in the DB Change-Id: I02a4773dd581c29704a7cc45c5225258d657f836
This commit is contained in:
		@@ -164,13 +164,27 @@ class SolrChangeIndex implements ChangeIndex, LifecycleListener {
 | 
			
		||||
    String id = cd.getId().toString();
 | 
			
		||||
    try {
 | 
			
		||||
      if (cd.change().getStatus().isOpen()) {
 | 
			
		||||
        openIndex.deleteById(id);
 | 
			
		||||
        commit(openIndex);
 | 
			
		||||
        delete(id, openIndex);
 | 
			
		||||
      } else {
 | 
			
		||||
        closedIndex.deleteById(id);
 | 
			
		||||
        commit(closedIndex);
 | 
			
		||||
        delete(id, closedIndex);
 | 
			
		||||
      }
 | 
			
		||||
    } catch (OrmException | SolrServerException e) {
 | 
			
		||||
    } catch (OrmException e) {
 | 
			
		||||
      throw new IOException(e);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @Override
 | 
			
		||||
  public void delete(int id) throws IOException {
 | 
			
		||||
    String idString = Integer.toString(id);
 | 
			
		||||
    delete(idString, openIndex);
 | 
			
		||||
    delete(idString, closedIndex);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private void delete(String id, CloudSolrServer index) throws IOException {
 | 
			
		||||
    try {
 | 
			
		||||
      index.deleteById(id);
 | 
			
		||||
      commit(index);
 | 
			
		||||
    } catch (SolrServerException e) {
 | 
			
		||||
      throw new IOException(e);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user