Package org.apache.solr.response
Class TabularResponseWriter
- java.lang.Object
-
- org.apache.solr.response.TextResponseWriter
-
- org.apache.solr.response.TabularResponseWriter
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,PushWriter
,TextWriter
public abstract class TabularResponseWriter extends TextResponseWriter
Base response writer for table-oriented data
-
-
Field Summary
-
Fields inherited from class org.apache.solr.response.TextResponseWriter
cal, doIndent, level, req, returnFields, rsp, schema, writer
-
-
Constructor Summary
Constructors Constructor Description TabularResponseWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse resp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<String>
getFields()
Returns fields to be returned in the responseboolean
shouldSkipField(String field)
Returns true if field needs to be skipped else falsevoid
writeArray(String name, Iterator<?> val, boolean raw)
void
writeDate(String name, Date val)
void
writeEndDocumentList()
void
writeMap(String name, Map<?,?> val, boolean excludeOuter, boolean isFirstVal)
void
writeNamedList(String name, NamedList<?> val)
void
writeResponse(Object responseObj)
void
writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore, Boolean numFoundExact)
-
Methods inherited from class org.apache.solr.response.TextResponseWriter
close, decLevel, doIndent, getWriter, incLevel, level, setIndent, setLevel, shouldWriteRaw, writeDocuments, writeSolrDocument, writeSolrDocumentList, writeVal
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.common.util.TextWriter
indent, indent, writeArray, writeArray, writeBool, writeBool, writeBool, writeByteArr, writeDate, writeDouble, writeDouble, writeFloat, writeFloat, writeInt, writeInt, writeIterator, writeIterator, writeLong, writeLong, writeMap, writeMap, writeNull, writeNumber, writeStr, writeStrRaw, writeVal
-
-
-
-
Constructor Detail
-
TabularResponseWriter
public TabularResponseWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse resp)
-
-
Method Detail
-
getFields
public Collection<String> getFields()
Returns fields to be returned in the response
-
shouldSkipField
public boolean shouldSkipField(String field)
Returns true if field needs to be skipped else false- Parameters:
field
- name of the field- Returns:
- boolean value
-
writeResponse
public void writeResponse(Object responseObj) throws IOException
- Throws:
IOException
-
writeNamedList
public void writeNamedList(String name, NamedList<?> val) throws IOException
- Throws:
IOException
-
writeStartDocumentList
public void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore, Boolean numFoundExact) throws IOException
- Specified by:
writeStartDocumentList
in classTextResponseWriter
- Throws:
IOException
-
writeEndDocumentList
public void writeEndDocumentList() throws IOException
- Specified by:
writeEndDocumentList
in classTextResponseWriter
- Throws:
IOException
-
writeMap
public void writeMap(String name, Map<?,?> val, boolean excludeOuter, boolean isFirstVal)
-
writeArray
public void writeArray(String name, Iterator<?> val, boolean raw) throws IOException
- Throws:
IOException
-
writeDate
public void writeDate(String name, Date val) throws IOException
- Throws:
IOException
-
-