Package org.apache.solr.client.solrj.request

# Class QueryRequest

java.lang.Object
org.apache.solr.client.solrj.SolrRequest<QueryResponse>
org.apache.solr.client.solrj.request.CollectionRequiringSolrRequest<QueryResponse>
org.apache.solr.client.solrj.request.QueryRequest

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `DirectJsonQueryRequest`, `JsonQueryRequest`

public class QueryRequest extends CollectionRequiringSolrRequest<QueryResponse>
For use with Solr's `SearchHandler`, generally at "/select". For other handlers, try `GenericSolrRequest`.

Since:
  solr 1.3
See Also:
  - Serialized Form

## Nested Class Summary

## Nested classes/interfaces inherited from class org.apache.solr.client.solrj.SolrRequest

`SolrRequest.ApiVersion, SolrRequest.METHOD, SolrRequest.SolrClientContext, SolrRequest.SolrRequestType`

## Field Summary

### Fields inherited from class org.apache.solr.client.solrj.SolrRequest

`SUPPORTED_METHODS`

## Constructor Summary

Constructors
Constructor
Description
`QueryRequest()`
`QueryRequest(SolrParams q)`
`QueryRequest(SolrParams q, SolrRequest.METHOD method)`

## Method Summary

Modifier and Type
Method
Description
`protected QueryResponse`
`createResponse(NamedList<Object> namedList)`
Create a new SolrResponse to hold the response from the server.
`SolrParams`
`getParams()`
The parameters for this request; never null.
`String`
`getPath()`
Use the params 'QT' parameter if it exists

### Methods inherited from class org.apache.solr.client.solrj.request.CollectionRequiringSolrRequest

`requiresCollection`

### Methods inherited from class org.apache.solr.client.solrj.SolrRequest

`addHeader, addHeaders, getApiVersion, getBasicAuthPassword, getBasicAuthUser, getCollection, getContentStreams, getContentWriter, getHeaders, getMethod, getPreferredNodes, getQueryParams, getRequestType, getResponseParser, getStreamingResponseCallback, getUserPrincipal, process, process, processWithBaseUrl, setBasicAuthCredentials, setMethod, setPath, setPreferredNodes, setQueryParams, setRequestType, setResponseParser, setStreamingResponseCallback, setUserPrincipal`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### QueryRequest

public QueryRequest()

### QueryRequest

public QueryRequest(SolrParams q)

### QueryRequest

public QueryRequest(SolrParams q, SolrRequest.METHOD method)

## Method Details

### getPath

public String getPath()
Use the params 'QT' parameter if it exists

Overrides:
  `getPath` in class `SolrRequest<QueryResponse>`

### createResponse

protected QueryResponse createResponse(NamedList<Object> namedList)
Description copied from class: `SolrRequest`
Create a new SolrResponse to hold the response from the server. If the response extends `SolrResponse`, then there's no need to use the arguments, as `SolrResponse.setResponse(NamedList)` will be called right after this method.

Specified by:
  `createResponse` in class `SolrRequest<QueryResponse>`
Parameters:
  `namedList` - from `SolrClient.request(SolrRequest, String)`.

### getParams

public SolrParams getParams()
Description copied from class: `SolrRequest`
The parameters for this request; never null. The runtime type may be mutable but modifications may not affect this `SolrRequest` instance, as it may return a new instance here every time. If the subclass specifies the response type as `ModifiableSolrParams`, then one can expect it to change this request. If the subclass has a setter then one can expect this method to return the value set.

Specified by:
  `getParams` in class `SolrRequest<QueryResponse>`