public void removeDocuments(List<Query> queries){
  IndexWriter writer=getWriter();
  for (  Query query : queries) {
    try {
      writer.deleteDocuments(query);
    }
 catch (    Exception e) {
      e.printStackTrace();
      closeWriter(writer);
      throw new RuntimeException(e);
    }
  }
  closeWriter(writer);
}

public void removeDocuments ( List < Query > queries ) { IndexWriter writer = getWriter ( ) ; for ( Query query : queries ) { try { writer . deleteDocuments ( query ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; closeWriter ( writer ) ; throw new RuntimeException ( e ) ; } } closeWriter ( writer ) ; }
removes the indexes of the documents .
