Search in sources :

Example 1 with Lucene50PostingsReader

use of org.apache.lucene.codecs.lucene50.Lucene50PostingsReader 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 2 with Lucene50PostingsReader

use of org.apache.lucene.codecs.lucene50.Lucene50PostingsReader 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 3 with Lucene50PostingsReader

use of org.apache.lucene.codecs.lucene50.Lucene50PostingsReader 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)

Example 4 with Lucene50PostingsReader

use of org.apache.lucene.codecs.lucene50.Lucene50PostingsReader 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 5 with Lucene50PostingsReader

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

the class LuceneVarGapDocFreqInterval method fieldsProducer.

@Override
public FieldsProducer fieldsProducer(SegmentReadState state) throws IOException {
    PostingsReaderBase postings = new Lucene50PostingsReader(state);
    TermsIndexReaderBase indexReader;
    boolean success = false;
    try {
        indexReader = new VariableGapTermsIndexReader(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) Lucene50PostingsReader(org.apache.lucene.codecs.lucene50.Lucene50PostingsReader) BlockTermsReader(org.apache.lucene.codecs.blockterms.BlockTermsReader) VariableGapTermsIndexReader(org.apache.lucene.codecs.blockterms.VariableGapTermsIndexReader) TermsIndexReaderBase(org.apache.lucene.codecs.blockterms.TermsIndexReaderBase)

Aggregations

FieldsProducer (org.apache.lucene.codecs.FieldsProducer)7 PostingsReaderBase (org.apache.lucene.codecs.PostingsReaderBase)7 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 Random (java.util.Random)1 BlockTreeTermsReader (org.apache.lucene.codecs.blocktree.BlockTreeTermsReader)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