Example usage for org.apache.lucene.replicator IndexAndTaxonomyRevision IndexAndTaxonomyRevision

List of usage examples for org.apache.lucene.replicator IndexAndTaxonomyRevision IndexAndTaxonomyRevision

Introduction

In this page you can find the example usage for org.apache.lucene.replicator IndexAndTaxonomyRevision IndexAndTaxonomyRevision.

Prototype

public IndexAndTaxonomyRevision(IndexWriter indexWriter, SnapshotDirectoryTaxonomyWriter taxoWriter)
        throws IOException 

Source Link

Document

Constructor over the given IndexWriter .

Usage

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));
    }
}