Example usage for org.apache.lucene.codecs.lucene50 Lucene50PostingsWriter Lucene50PostingsWriter

List of usage examples for org.apache.lucene.codecs.lucene50 Lucene50PostingsWriter Lucene50PostingsWriter

Introduction

In this page you can find the example usage for org.apache.lucene.codecs.lucene50 Lucene50PostingsWriter Lucene50PostingsWriter.

Prototype

public Lucene50PostingsWriter(SegmentWriteState state) throws IOException 

Source Link

Document

Creates a postings writer

Usage

From source file:com.rocana.lucene.codec.v1.RocanaLucene50PostingsFormat.java

License:Apache License

@Override
public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
    PostingsWriterBase postingsWriter = new Lucene50PostingsWriter(state);

    boolean success = false;
    try {//from w w  w  .j ava  2s  .  com
        FieldsConsumer ret = new BlockTreeTermsWriter(state, postingsWriter, minTermBlockSize,
                maxTermBlockSize);
        success = true;
        return ret;
    } finally {
        if (!success) {
            IOUtils.closeWhileHandlingException(postingsWriter);
        }
    }
}