org.apache.solr.request
Class SolrQueryResponse

java.lang.Object
  extended by org.apache.solr.request.SolrQueryResponse

public class SolrQueryResponse
extends java.lang.Object

SolrQueryResponse is used by a query handler to return the response to a query request.

Note On Returnable Data...
A SolrQueryResponse may contain the following types of Objects generated by the SolrRequestHandler that processed the request.

Since:
solr 0.9
Version:
$Id: SolrQueryResponse.java 501512 2007-01-30 18:36:32Z yonik $
Author:
yonik

Field Summary
protected  java.util.Set<java.lang.String> defaultReturnFields
           
protected  long endtime
          The endtime of the request in milliseconds.
protected  java.lang.Exception err
           
protected  NamedList values
          Container for user defined values
 
Constructor Summary
SolrQueryResponse()
           
 
Method Summary
 void add(java.lang.String name, java.lang.Object val)
          Appends a named value to the list of named values to be returned.
 long getEndTime()
          Get the time in milliseconds when the response officially finished.
 java.lang.Exception getException()
          Returns an Exception if there was a fatal error in processing the request.
 java.util.Set<java.lang.String> getReturnFields()
          Gets the document field names of fields to return by default when returning DocLists
 NamedList getValues()
          Gets data to be returned in this response
 void setAllValues(NamedList nameValuePairs)
          Sets data to be returned in this response
 long setEndTime()
          Stop the timer for how long this query took.
 long setEndTime(long endtime)
          Set the in milliseconds when the response officially finished.
 void setException(java.lang.Exception e)
          Causes an error to be returned instead of the results.
 void setReturnFields(java.util.Set<java.lang.String> fields)
          Sets the document field names of fields to return by default when returning DocLists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

values

protected NamedList values
Container for user defined values

See Also:
getValues(), add(java.lang.String, java.lang.Object), setAllValues(org.apache.solr.util.NamedList), Note on Returnable Data

defaultReturnFields

protected java.util.Set<java.lang.String> defaultReturnFields

err

protected java.lang.Exception err

endtime

protected long endtime
The endtime of the request in milliseconds. Used to calculate query time.

See Also:
setEndTime(long), getEndTime()
Constructor Detail

SolrQueryResponse

public SolrQueryResponse()
Method Detail

getValues

public NamedList getValues()
Gets data to be returned in this response

See Also:
Note on Returnable Data

setAllValues

public void setAllValues(NamedList nameValuePairs)
Sets data to be returned in this response

See Also:
Note on Returnable Data

setReturnFields

public void setReturnFields(java.util.Set<java.lang.String> fields)
Sets the document field names of fields to return by default when returning DocLists


getReturnFields

public java.util.Set<java.lang.String> getReturnFields()
Gets the document field names of fields to return by default when returning DocLists


add

public void add(java.lang.String name,
                java.lang.Object val)
Appends a named value to the list of named values to be returned.

Parameters:
name - the name of the value - may be null if unnamed
val - the value to add - also may be null since null is a legal value
See Also:
Note on Returnable Data

setException

public void setException(java.lang.Exception e)
Causes an error to be returned instead of the results.


getException

public java.lang.Exception getException()
Returns an Exception if there was a fatal error in processing the request. Returns null if the request succeeded.


getEndTime

public long getEndTime()
Get the time in milliseconds when the response officially finished.


setEndTime

public long setEndTime()
Stop the timer for how long this query took.

See Also:
setEndTime(long)

setEndTime

public long setEndTime(long endtime)
Set the in milliseconds when the response officially finished.

See Also:
setEndTime()


Copyright © 2006 - 2008 The Apache Software Foundation