public static Map<String,DocumentPartitioner> removeDocumentPartitioners(Document document){
  Map<String,DocumentPartitioner> partitioners=new HashMap<String,DocumentPartitioner>();
  String[] partitionings=document.getPartitionings();
  for (int i=0; i < partitionings.length; i++) {
    DocumentPartitioner partitioner=document.getDocumentPartitioner(partitionings[i]);
    if (partitioner != null) {
      document.setDocumentPartitioner(partitionings[i],null);
      partitioner.disconnect();
      partitioners.put(partitionings[i],partitioner);
    }
  }
  return partitioners;
}

public static Map < String , DocumentPartitioner > removeDocumentPartitioners ( Document document ) { Map < String , DocumentPartitioner > partitioners = new HashMap < String , DocumentPartitioner > ( ) ; String [ ] partitionings = document . getPartitionings ( ) ; for ( int i = 0 ; i < partitionings . length ; i ++ ) { DocumentPartitioner partitioner = document . getDocumentPartitioner ( partitionings [ i ] ) ; if ( partitioner != null ) { document . setDocumentPartitioner ( partitionings [ i ] , null ) ; partitioner . disconnect ( ) ; partitioners . put ( partitionings [ i ] , partitioner ) ; } } return partitioners ; }
removes all connected document partitioners from the given document and stores them under their partitioning name in a map . this map is returned . after this method has been called the given document is no longer connected to any document partitioner .
