/** * Unpack index data using specified Lucene Index writer * * @param is an input stream to unpack index data from * @param w a writer to save index data * @param ics a collection of index creators for updating unpacked documents. */ public static IndexDataReadResult unpackIndexData( final InputStream is, final Directory d, final IndexingContext context ) throws IOException { NexusIndexWriter w = new NexusIndexWriter( d, new NexusAnalyzer(), true ); try { IndexDataReader dr = new IndexDataReader( is ); return dr.readIndex( w, context ); } finally { IndexUtils.close( w ); } }
/** * Unpack index data using specified Lucene Index writer * * @param is an input stream to unpack index data from * @param w a writer to save index data * @param ics a collection of index creators for updating unpacked documents. */ public static IndexDataReadResult unpackIndexData( final InputStream is, final Directory d, final IndexingContext context ) throws IOException { NexusIndexWriter w = new NexusIndexWriter( d, new NexusAnalyzer(), true ); try { IndexDataReader dr = new IndexDataReader( is ); return dr.readIndex( w, context ); } finally { IndexUtils.close( w ); } }
/** * Unpack index data using specified Lucene Index writer * * @param is an input stream to unpack index data from * @param w a writer to save index data * @param ics a collection of index creators for updating unpacked documents. */ public static Date unpackIndexData( final InputStream is, final Directory d, final IndexingContext context ) throws IOException { NexusIndexWriter w = new NexusIndexWriter( d, new NexusAnalyzer(), true ); try { IndexDataReader dr = new IndexDataReader( is ); IndexDataReadResult result = dr.readIndex( w, context ); return result.getTimestamp(); } finally { IndexUtils.close( w ); } }