Search in sources :

Example 1 with PostingsReaderBase

use of org.apache.lucene.codecs.PostingsReaderBase in project lucene-solr by apache.

the class LuceneFixedGap method fieldsProducer.

@Override
public FieldsProducer fieldsProducer(SegmentReadState state) throws IOException {
    PostingsReaderBase postings = new Lucene50PostingsReader(state);
    TermsIndexReaderBase indexReader;
    boolean success = false;
    try {
        indexReader = new FixedGapTermsIndexReader(state);
        success = true;
    } finally {
        if (!success) {
            postings.close();
        }
    }
    success = false;
    try {
        FieldsProducer ret = new BlockTermsReader(indexReader, postings, state);
        success = true;
        return ret;
    } finally {
        if (!success) {
            try {
                postings.close();
            } finally {
                indexReader.close();
            }
        }
    }
}
Also used : FieldsProducer(org.apache.lucene.codecs.FieldsProducer) PostingsReaderBase(org.apache.lucene.codecs.PostingsReaderBase) FixedGapTermsIndexReader(org.apache.lucene.codecs.blockterms.FixedGapTermsIndexReader) Lucene50PostingsReader(org.apache.lucene.codecs.lucene50.Lucene50PostingsReader) BlockTermsReader(org.apache.lucene.codecs.blockterms.BlockTermsReader) TermsIndexReaderBase(org.apache.lucene.codecs.blockterms.TermsIndexReaderBase)

Example 2 with PostingsReaderBase

use of org.apache.lucene.codecs.PostingsReaderBase in project lucene-solr by apache.

the class IDVersionPostingsFormat method fieldsProducer.

@Override
public FieldsProducer fieldsProducer(SegmentReadState state) throws IOException {
    PostingsReaderBase postingsReader = new IDVersionPostingsReader();
    boolean success = false;
    try {
        FieldsProducer ret = new VersionBlockTreeTermsReader(postingsReader, state);
        success = true;
        return ret;
    } finally {
        if (!success) {
            IOUtils.closeWhileHandlingException(postingsReader);
        }
    }
}
Also used : FieldsProducer(org.apache.lucene.codecs.FieldsProducer) PostingsReaderBase(org.apache.lucene.codecs.PostingsReaderBase)

Example 3 with PostingsReaderBase

use of org.apache.lucene.codecs.PostingsReaderBase in project lucene-solr by apache.

the class FSTOrdPostingsFormat method fieldsProducer.

@Override
public FieldsProducer fieldsProducer(SegmentReadState state) throws IOException {
    PostingsReaderBase postingsReader = new Lucene50PostingsReader(state);
    boolean success = false;
    try {
        FieldsProducer ret = new FSTOrdTermsReader(state, postingsReader);
        success = true;
        return ret;
    } finally {
        if (!success) {
            IOUtils.closeWhileHandlingException(postingsReader);
        }
    }
}
Also used : FieldsProducer(org.apache.lucene.codecs.FieldsProducer) PostingsReaderBase(org.apache.lucene.codecs.PostingsReaderBase) Lucene50PostingsReader(org.apache.lucene.codecs.lucene50.Lucene50PostingsReader)

Example 4 with PostingsReaderBase

use of org.apache.lucene.codecs.PostingsReaderBase in project lucene-solr by apache.

the class FSTPostingsFormat method fieldsProducer.

@Override
public FieldsProducer fieldsProducer(SegmentReadState state) throws IOException {
    PostingsReaderBase postingsReader = new Lucene50PostingsReader(state);
    boolean success = false;
    try {
        FieldsProducer ret = new FSTTermsReader(state, postingsReader);
        success = true;
        return ret;
    } finally {
        if (!success) {
            IOUtils.closeWhileHandlingException(postingsReader);
        }
    }
}
Also used : FieldsProducer(org.apache.lucene.codecs.FieldsProducer) PostingsReaderBase(org.apache.lucene.codecs.PostingsReaderBase) Lucene50PostingsReader(org.apache.lucene.codecs.lucene50.Lucene50PostingsReader)

Example 5 with PostingsReaderBase

use of org.apache.lucene.codecs.PostingsReaderBase in project lucene-solr by apache.

the class BlockTreeOrdsPostingsFormat method fieldsProducer.

@Override
public FieldsProducer fieldsProducer(SegmentReadState state) throws IOException {
    PostingsReaderBase postingsReader = new Lucene50PostingsReader(state);
    boolean success = false;
    try {
        FieldsProducer ret = new OrdsBlockTreeTermsReader(postingsReader, state);
        success = true;
        return ret;
    } finally {
        if (!success) {
            IOUtils.closeWhileHandlingException(postingsReader);
        }
    }
}
Also used : FieldsProducer(org.apache.lucene.codecs.FieldsProducer) PostingsReaderBase(org.apache.lucene.codecs.PostingsReaderBase) Lucene50PostingsReader(org.apache.lucene.codecs.lucene50.Lucene50PostingsReader)

Aggregations

FieldsProducer (org.apache.lucene.codecs.FieldsProducer)9 PostingsReaderBase (org.apache.lucene.codecs.PostingsReaderBase)9 Lucene50PostingsReader (org.apache.lucene.codecs.lucene50.Lucene50PostingsReader)7 BlockTermsReader (org.apache.lucene.codecs.blockterms.BlockTermsReader)4 TermsIndexReaderBase (org.apache.lucene.codecs.blockterms.TermsIndexReaderBase)4 VariableGapTermsIndexReader (org.apache.lucene.codecs.blockterms.VariableGapTermsIndexReader)3 FixedGapTermsIndexReader (org.apache.lucene.codecs.blockterms.FixedGapTermsIndexReader)2 BlockTreeTermsReader (org.apache.lucene.codecs.blocktree.BlockTreeTermsReader)2 Random (java.util.Random)1 OrdsBlockTreeTermsReader (org.apache.lucene.codecs.blocktreeords.OrdsBlockTreeTermsReader)1 FSTOrdTermsReader (org.apache.lucene.codecs.memory.FSTOrdTermsReader)1 FSTTermsReader (org.apache.lucene.codecs.memory.FSTTermsReader)1 ChecksumIndexInput (org.apache.lucene.store.ChecksumIndexInput)1