Class TextResponseWriter

java.lang.Object
org.apache.solr.response.TextResponseWriter
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.solr.common.PushWriter, org.apache.solr.common.util.TextWriter
Direct Known Subclasses:
JSONWriter, SchemaXmlWriter, TabularResponseWriter, XMLWriter

public abstract class TextResponseWriter extends Object implements org.apache.solr.common.util.TextWriter
Base class for text-oriented response writers.
  • Field Details

    • writer

      protected final org.apache.solr.common.util.FastWriter writer
    • schema

      protected final IndexSchema schema
    • req

      protected final SolrQueryRequest req
    • rsp

      protected final SolrQueryResponse rsp
    • returnFields

      protected ReturnFields returnFields
    • level

      protected int level
    • doIndent

      protected boolean doIndent
    • cal

      protected Calendar cal
  • Constructor Details

  • Method Details

    • shouldWriteRaw

      protected final boolean shouldWriteRaw(String fname, ReturnFields returnFields)
      NOTE: strict object equality check against rawReturnFields; see javadocs for NO_RAW_FIELDS
    • close

      public void close() throws IOException
      done with this ResponseWriter... make sure any buffers are flushed to writer
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • doIndent

      public boolean doIndent()
      Specified by:
      doIndent in interface org.apache.solr.common.util.TextWriter
    • getWriter

      public Writer getWriter()
      returns the Writer that the response is being written to
      Specified by:
      getWriter in interface org.apache.solr.common.util.TextWriter
    • setLevel

      public void setLevel(int level)
    • level

      public int level()
      Specified by:
      level in interface org.apache.solr.common.util.TextWriter
    • incLevel

      public int incLevel()
      Specified by:
      incLevel in interface org.apache.solr.common.util.TextWriter
    • decLevel

      public int decLevel()
      Specified by:
      decLevel in interface org.apache.solr.common.util.TextWriter
    • setIndent

      public TextResponseWriter setIndent(boolean doIndent)
      Specified by:
      setIndent in interface org.apache.solr.common.util.TextWriter
    • writeVal

      public final void writeVal(String name, Object val, boolean raw) throws IOException
      Specified by:
      writeVal in interface org.apache.solr.common.util.TextWriter
      Throws:
      IOException
    • writeStartDocumentList

      public abstract void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore, Boolean numFoundExact) throws IOException
      Throws:
      IOException
    • writeSolrDocument

      public abstract void writeSolrDocument(String name, org.apache.solr.common.SolrDocument doc, ReturnFields fields, int idx) throws IOException
      Throws:
      IOException
    • writeEndDocumentList

      public abstract void writeEndDocumentList() throws IOException
      Throws:
      IOException
    • writeSolrDocumentList

      public final void writeSolrDocumentList(String name, org.apache.solr.common.SolrDocumentList docs, ReturnFields fields) throws IOException
      Throws:
      IOException
    • writeDocuments

      public final void writeDocuments(String name, ResultContext res) throws IOException
      Throws:
      IOException