Class SolrRequest<T extends SolrResponse>

    • Field Detail

      • SUPPORTED_METHODS

        public static final Set<String> SUPPORTED_METHODS
      • usev2

        protected boolean usev2
      • useBinaryV2

        protected boolean useBinaryV2
    • Method Detail

      • setUserPrincipal

        public void setUserPrincipal​(Principal userPrincipal)
      • getUserPrincipal

        public Principal getUserPrincipal()
      • setUseBinaryV2

        @Deprecated
        public SolrRequest<T> setUseBinaryV2​(boolean flag)
        Deprecated.
        use v2-native SolrRequest implementations directly instead
        If set to true use javabin instead of json (default)
      • getPreferredNodes

        public List<String> getPreferredNodes()
      • getBasicAuthUser

        public String getBasicAuthUser()
      • getBasicAuthPassword

        public String getBasicAuthPassword()
      • getPath

        public String getPath()
      • setPath

        public void setPath​(String path)
      • setResponseParser

        public void setResponseParser​(ResponseParser responseParser)
        Optionally specify how the Response should be parsed. Not all server implementations require a ResponseParser to be specified.
        Parameters:
        responseParser - The ResponseParser
      • getQueryParams

        public Set<String> getQueryParams()
        Parameter keys that are sent via the query string
      • setQueryParams

        public void setQueryParams​(Set<String> queryParams)
      • getRequestType

        public abstract String getRequestType()
        This method defines the type of this Solr request.
      • getParams

        public abstract SolrParams getParams()
      • requiresCollection

        public boolean requiresCollection()
        Determines whether this request should use or ignore any specified collections (esp. SolrClient.defaultCollection)

        Many Solr requests target a particular core or collection. But not all of them - many Solr APIs (e.g. security or other admin APIs) are agnostic of collections entirely. This method gives these requests a way to opt out of using SolrClient.defaultCollection or other specified collections.

      • getContentWriter

        public RequestWriter.ContentWriter getContentWriter​(String expectedType)
        If a request object wants to do a push write, implement this method.
        Parameters:
        expectedType - This is the type that the RequestWriter would like to get. But, it is OK to send any format
      • createResponse

        protected abstract T createResponse​(SolrClient client)
        Create a new SolrResponse to hold the response from the server
        Parameters:
        client - the SolrClient the request will be sent to
      • getCollection

        public String getCollection()
      • setBasePath

        public void setBasePath​(String path)
      • getBasePath

        public String getBasePath()
      • addHeader

        public void addHeader​(String key,
                              String value)