List of usage examples for org.apache.lucene.replicator IndexAndTaxonomyRevision IndexAndTaxonomyRevision
public IndexAndTaxonomyRevision(IndexWriter indexWriter, SnapshotDirectoryTaxonomyWriter taxoWriter) throws IOException
From source file:com.qwazr.search.bench.LuceneWithTaxonomyIndex.java
License:Apache License
@Override final synchronized public void commitAndPublish() throws IOException { final boolean hasTaxoChanges = taxonomyWriter.getIndexWriter().hasUncommittedChanges(); if (hasTaxoChanges) taxonomyWriter.commit();//from w ww . j a v a2s.com final boolean hasDataChanges = indexWriter.hasUncommittedChanges(); if (hasDataChanges) indexWriter.commit(); if (hasTaxoChanges || hasDataChanges) { searcherTaxonomyManager.maybeRefresh(); localReplicator.publish(new IndexAndTaxonomyRevision(indexWriter, taxonomyWriter)); } }