List of usage examples for org.apache.lucene.codecs.blocktree BlockTreeTermsWriter BlockTreeTermsWriter
public BlockTreeTermsWriter(SegmentWriteState state, PostingsWriterBase postingsWriter, int minItemsInBlock, int maxItemsInBlock) throws IOException
From source file:com.lucure.core.codec.LucurePostingsFormat.java
License:Apache License
@Override public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException { PostingsWriterBase postingsWriter = new Lucene41PostingsWriter(state); boolean success = false; try {//from w w w.j a v a 2s .c om FieldsConsumer ret = new BlockTreeTermsWriter(state, postingsWriter, minTermBlockSize, maxTermBlockSize); success = true; return new LucureMergingFieldsConsumer(ret); } finally { if (!success) { IOUtils.closeWhileHandlingException(postingsWriter); } } }
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 a va 2 s . c o m*/ FieldsConsumer ret = new BlockTreeTermsWriter(state, postingsWriter, minTermBlockSize, maxTermBlockSize); success = true; return ret; } finally { if (!success) { IOUtils.closeWhileHandlingException(postingsWriter); } } }
From source file:com.sindicetech.siren.index.codecs.siren10.Siren10PostingsFormat.java
License:Open Source License
@Override public FieldsConsumer fieldsConsumer(final SegmentWriteState state) throws IOException { final PostingsWriterBase postingsWriter = new Siren10PostingsWriter(state, this.getFactory()); boolean success = false; try {/*w w w .java2s . com*/ final FieldsConsumer ret = new BlockTreeTermsWriter(state, postingsWriter, BlockTreeTermsWriter.DEFAULT_MIN_BLOCK_SIZE, BlockTreeTermsWriter.DEFAULT_MAX_BLOCK_SIZE); success = true; return ret; } finally { if (!success) { postingsWriter.close(); } } }