Class TermVectorAccessor


  • public class TermVectorAccessor
    extends Object
    Transparent access to the vector space model, either via TermFreqVector or by resolving it from the inverted index.

    Resolving a term vector from a large index can be a time consuming process.

    Warning! This class is not thread safe!

    • Constructor Detail

      • TermVectorAccessor

        public TermVectorAccessor()
    • Method Detail

      • accept

        public void accept​(IndexReader indexReader,
                           int documentNumber,
                           String fieldName,
                           TermVectorMapper mapper)
                    throws IOException
        Visits the TermVectorMapper and populates it with terms available for a given document, either via a vector created at index time or by resolving them from the inverted index.
        Parameters:
        indexReader - Index source
        documentNumber - Source document to access
        fieldName - Field to resolve
        mapper - Mapper to be mapped with data
        Throws:
        IOException