public void updateTimestamp( boolean save, Date timestamp ) throws IOException { this.timestamp = timestamp; if ( save ) { IndexUtils.updateTimestamp( indexDirectory, getTimestamp() ); } }
public void updateTimestamp( boolean save, Date timestamp ) throws IOException { this.timestamp = timestamp; if ( save ) { IndexUtils.updateTimestamp( indexDirectory, getTimestamp() ); } }
public void updateTimestamp( boolean save, Date timestamp ) throws IOException { this.timestamp = timestamp; if ( save ) { IndexUtils.updateTimestamp( indexDirectory, getTimestamp() ); } }
public synchronized void close( boolean deleteFiles ) throws IOException { if ( indexDirectory != null ) { IndexUtils.updateTimestamp( indexDirectory, getTimestamp() ); closeReaders(); if ( deleteFiles ) { deleteIndexFiles( true ); } indexDirectory.close(); } indexDirectory = null; }
public synchronized void close( boolean deleteFiles ) throws IOException { if ( indexDirectory != null ) { IndexUtils.updateTimestamp( indexDirectory, getTimestamp() ); closeReaders(); if ( deleteFiles ) { deleteIndexFiles( true ); } indexDirectory.close(); } indexDirectory = null; }
public synchronized void close( boolean deleteFiles ) throws IOException { if ( indexDirectory != null ) { IndexUtils.updateTimestamp( indexDirectory, getTimestamp() ); closeReaders(); if ( deleteFiles ) { deleteIndexFiles( true ); } indexDirectory.close(); } indexDirectory = null; }
public IndexDataReadResult readIndex( IndexWriter w, IndexingContext context ) throws IOException { long timestamp = readHeader(); Date date = null; if ( timestamp != -1 ) { date = new Date( timestamp ); IndexUtils.updateTimestamp( w.getDirectory(), date ); } int n = 0; Document doc; while ( ( doc = readDocument() ) != null ) { w.addDocument( IndexUtils.updateDocument( doc, context, false ) ); n++; } w.commit(); w.forceMerge(1); w.commit(); IndexDataReadResult result = new IndexDataReadResult(); result.setDocumentCount( n ); result.setTimestamp( date ); return result; }
IndexUtils.updateTimestamp( w.getDirectory(), date );
public static void copyDirectory( Directory source, Directory target ) throws IOException { //FIXME: check if this copies too much, Lucene 4 has no filter for lucene files //Directory.copy( source, target, false ); for ( String file : source.listAll() ) { target.copyFrom( source, file, file, IOContext.DEFAULT ); } copyFile( source, target, IndexingContext.INDEX_UPDATER_PROPERTIES_FILE ); copyFile( source, target, IndexingContext.INDEX_PACKER_PROPERTIES_FILE ); Date ts = getTimestamp( source ); updateTimestamp( target, ts ); }
public static void copyDirectory( Directory source, Directory target ) throws IOException { //FIXME: check if this copies too much, Lucene 4 has no filter for lucene files //Directory.copy( source, target, false ); for ( String file : source.listAll() ) { target.copyFrom( source, file, file, IOContext.DEFAULT ); } copyFile( source, target, IndexingContext.INDEX_UPDATER_PROPERTIES_FILE ); copyFile( source, target, IndexingContext.INDEX_PACKER_PROPERTIES_FILE ); Date ts = getTimestamp( source ); updateTimestamp( target, ts ); }
public static void copyDirectory( Directory source, Directory target ) throws IOException { //FIXME: check if this copies too much, Lucene 4 has no filter for lucene files //Directory.copy( source, target, false ); for (String file : source.listAll()) { source.copy(target, file, file, IOContext.DEFAULT); } copyFile( source, target, IndexingContext.INDEX_UPDATER_PROPERTIES_FILE ); copyFile( source, target, IndexingContext.INDEX_PACKER_PROPERTIES_FILE ); Date ts = getTimestamp( source ); updateTimestamp( target, ts ); }
IndexUtils.updateTimestamp( w.getDirectory(), date );