Class SimpleTextFieldsWriter

java.lang.Object
org.apache.lucene.codecs.FieldsConsumer
org.apache.lucene.codecs.simpletext.SimpleTextFieldsWriter
All Implemented Interfaces:
Closeable, AutoCloseable

class SimpleTextFieldsWriter extends FieldsConsumer
  • Field Details

  • Constructor Details

  • Method Details

    • write

      public void write(Fields fields, NormsProducer norms) throws IOException
      Description copied from class: FieldsConsumer
      Write all fields, terms and postings. This the "pull" API, allowing you to iterate more than once over the postings, somewhat analogous to using a DOM API to traverse an XML tree.

      Notes:

      • You must compute index statistics, including each Term's docFreq and totalTermFreq, as well as the summary sumTotalTermFreq, sumTotalDocFreq and docCount.
      • You must skip terms that have no docs and fields that have no terms, even though the provided Fields API will expose them; this typically requires lazily writing the field or term until you've actually seen the first term or document.
      • The provided Fields instance is limited: you cannot call any methods that return statistics/counts; you cannot pass a non-null live docs when pulling docs/positions enums.
      Specified by:
      write in class FieldsConsumer
      Throws:
      IOException
    • write

      public void write(FieldInfos fieldInfos, Fields fields) throws IOException
      Throws:
      IOException
    • write

      private void write(String s) throws IOException
      Throws:
      IOException
    • write

      private void write(BytesRef b) throws IOException
      Throws:
      IOException
    • newline

      private void newline() throws IOException
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in class FieldsConsumer
      Throws:
      IOException