/** Triggers the writing of the postings in memory to the specified * RunWriter. If the RunWriter requires that terms are written in order, * then this will happen. * @param runWriter * @throws IOException */ public void finish(RunWriter runWriter) throws IOException { logger.debug("Writing run "+runWriter.toString()); //only sort the postings if required by the RunWriter writeToWriter(runWriter, runWriter.writeSorted() ? new TreeMap<String, Posting>(postings) : postings); logger.debug(" done"); }