Search in sources :

Example 1 with TermVectorLeafReader

use of org.apache.lucene.search.highlight.TermVectorLeafReader in project lucene-solr by apache.

the class TermVectorOffsetStrategy method getOffsetsEnums.

@Override
public List<OffsetsEnum> getOffsetsEnums(IndexReader reader, int docId, String content) throws IOException {
    Terms tvTerms = reader.getTermVector(docId, field);
    if (tvTerms == null) {
        return Collections.emptyList();
    }
    LeafReader leafReader = new TermVectorLeafReader(field, tvTerms);
    docId = 0;
    return createOffsetsEnumsFromReader(leafReader, docId);
}
Also used : TermVectorLeafReader(org.apache.lucene.search.highlight.TermVectorLeafReader) LeafReader(org.apache.lucene.index.LeafReader) TermVectorLeafReader(org.apache.lucene.search.highlight.TermVectorLeafReader) Terms(org.apache.lucene.index.Terms)

Aggregations

LeafReader (org.apache.lucene.index.LeafReader)1 Terms (org.apache.lucene.index.Terms)1 TermVectorLeafReader (org.apache.lucene.search.highlight.TermVectorLeafReader)1