Class SolrQueryRequestBase

  • All Implemented Interfaces:
    Closeable, AutoCloseable, SolrQueryRequest
    Direct Known Subclasses:

    public abstract class SolrQueryRequestBase
    extends Object
    implements SolrQueryRequest, Closeable
    Base implementation of SolrQueryRequest that provides some convenience methods for accessing parameters, and manages an IndexSearcher reference.

    The close() method must be called on any instance of this class once it is no longer in use.

    • Field Detail

      • origParams

        protected final org.apache.solr.common.params.SolrParams origParams
      • params

        protected org.apache.solr.common.params.SolrParams params
      • streams

        protected Iterable<org.apache.solr.common.util.ContentStream> streams
      • startTime

        protected final long startTime
    • Constructor Detail

      • SolrQueryRequestBase

        public SolrQueryRequestBase​(SolrCore core,
                                    org.apache.solr.common.params.SolrParams params,
                                    RTimerTree requestTimer)
      • SolrQueryRequestBase

        public SolrQueryRequestBase​(SolrCore core,
                                    org.apache.solr.common.params.SolrParams params)
    • Method Detail

      • getParams

        public org.apache.solr.common.params.SolrParams getParams()
        Description copied from interface: SolrQueryRequest
        returns the current request parameters
        Specified by:
        getParams in interface SolrQueryRequest
      • getOriginalParams

        public org.apache.solr.common.params.SolrParams getOriginalParams()
        Description copied from interface: SolrQueryRequest
        Returns the original request parameters. As this does not normally include configured defaults it's more suitable for logging.
        Specified by:
        getOriginalParams in interface SolrQueryRequest
      • setParams

        public void setParams​(org.apache.solr.common.params.SolrParams params)
        Description copied from interface: SolrQueryRequest
        Change the parameters for this request. This does not affect the original parameters returned by getOriginalParams()
        Specified by:
        setParams in interface SolrQueryRequest
      • getStartTime

        public long getStartTime()
        Description copied from interface: SolrQueryRequest
        The start time of this request in milliseconds. Use this only if you need the absolute system time at the start of the request, getRequestTimer() provides a more accurate mechanism for timing purposes.
        Specified by:
        getStartTime in interface SolrQueryRequest
      • getTracer

        public io.opentracing.Tracer getTracer()
        Description copied from interface: SolrQueryRequest
        Distributed tracing Tracer. Never null but might implement NoopTracer.
        Specified by:
        getTracer in interface SolrQueryRequest
      • getSpan

        public io.opentracing.Span getSpan()
        Description copied from interface: SolrQueryRequest
        The distributed tracing Span for the request itself; never null. This is useful for adding tags or updating the operation name of the request span. If you need the current span, which might not necessarily be the request span, do this instead: tracer.activeSpan().
        Specified by:
        getSpan in interface SolrQueryRequest
      • close

        public void close()
        Frees resources associated with this request, this method must be called when the object is no longer in use.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface SolrQueryRequest
      • getContentStreams

        public Iterable<org.apache.solr.common.util.ContentStream> getContentStreams()
        A Collection of ContentStreams passed to the request
        Specified by:
        getContentStreams in interface SolrQueryRequest
      • setContentStreams

        public void setContentStreams​(Iterable<org.apache.solr.common.util.ContentStream> s)
      • getJSON

        public Map<String,​Object> getJSON()
        Description copied from interface: SolrQueryRequest
        Returns any associated JSON (or null if none) in deserialized generic form. Java classes used to represent the JSON are as follows: Map, List, String, Long, Double, Boolean
        Specified by:
        getJSON in interface SolrQueryRequest
      • getCommands

        public List<org.apache.solr.common.util.CommandOperation> getCommands​(boolean validateInput)
        Description copied from interface: SolrQueryRequest
        Only for v2 API if the request contains a command payload, it's parsed and returned as a list of CommandOperation objects
        Specified by:
        getCommands in interface SolrQueryRequest
        validateInput - , If true it is validated against the json schema spec
      • getSpec

        protected org.apache.solr.common.util.ValidatingJsonMap getSpec()
      • getValidators

        protected Map<String,​org.apache.solr.common.util.JsonSchemaValidator> getValidators()