private void closeReaders() throws CorruptIndexException, IOException { if ( searcherManager != null ) { searcherManager.close(); searcherManager = null; } if ( indexWriter != null ) { indexWriter.close(); indexWriter = null; } }
/** * Returns new IndexWriterConfig instance * * @since 5.1 */ protected IndexWriterConfig getWriterConfig() { return NexusIndexWriter.defaultConfig(); }
protected void openAndWarmup() throws IOException { // IndexWriter (close) if ( indexWriter != null ) { indexWriter.close(); indexWriter = null; } if ( searcherManager != null ) { searcherManager.close(); searcherManager = null; } this.indexWriter = new NexusIndexWriter( getIndexDirectory(), getWriterConfig() ); this.indexWriter.commit(); // LUCENE-2386 this.searcherManager = new SearcherManager( indexWriter, false, new NexusIndexSearcherFactory( this ) ); }
/** * 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 ); } }
protected void openAndWarmup() throws IOException { // IndexWriter (close) if ( indexWriter != null ) { indexWriter.close(); indexWriter = null; } if ( searcherManager != null ) { searcherManager.close(); searcherManager = null; } this.indexWriter = new NexusIndexWriter( getIndexDirectory(), getWriterConfig() ); this.indexWriter.commit(); // LUCENE-2386 this.searcherManager = new SearcherManager( indexWriter, false, new NexusIndexSearcherFactory( this ) ); }
w = new NexusIndexWriter( directory, new NexusAnalyzer(), false ); w = new NexusIndexWriter( directory, new NexusAnalyzer(), false );
protected void openAndWarmup() throws IOException { // IndexWriter (close) if ( indexWriter != null ) { indexWriter.close(); indexWriter = null; } if ( searcherManager != null ) { searcherManager.close(); searcherManager = null; } this.indexWriter = new NexusIndexWriter( getIndexDirectory(), getWriterConfig() ); this.indexWriter.commit(); // LUCENE-2386 this.searcherManager = new SearcherManager( indexWriter, false, new NexusIndexSearcherFactory( this ) ); }
/** * 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 ); } }
/** * Returns new IndexWriterConfig instance * * @since 5.1 */ protected IndexWriterConfig getWriterConfig() { return NexusIndexWriter.defaultConfig(); }
private void closeReaders() throws CorruptIndexException, IOException { if ( searcherManager != null ) { searcherManager.close(); searcherManager = null; } if ( indexWriter != null ) { indexWriter.close(); indexWriter = null; } }
w = new NexusIndexWriter( directory, new NexusAnalyzer(), false ); w = new NexusIndexWriter( directory, new NexusAnalyzer(), false );
/** * Returns new IndexWriterConfig instance * * @since 5.1 */ protected IndexWriterConfig getWriterConfig() { return NexusIndexWriter.defaultConfig(); }
private void closeReaders() throws CorruptIndexException, IOException { if ( searcherManager != null ) { searcherManager.close(); searcherManager = null; } if ( indexWriter != null ) { indexWriter.close(); indexWriter = null; } }
/** * 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 ); } }
w = new NexusIndexWriter( directory, new NexusAnalyzer(), false ); w = new NexusIndexWriter( directory, new NexusAnalyzer(), false );