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

# Class DirectJsonQueryRequest

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
org.apache.solr.client.solrj.request.json.DirectJsonQueryRequest

All Implemented Interfaces:
  `Serializable`

public class DirectJsonQueryRequest extends QueryRequest
Represents a query using the JSON Query DSL

This class doesn't construct the request body itself. It uses a provided String without any modification. Often used in combination with the JSON DSL's macro expansion capabilities. The JSON body can contain template parameters which are replaced with values fetched from the `SolrParams` used by this request. For a more flexible, guided approach to constructing JSON DSL requests, see `JsonQueryRequest`.

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
`DirectJsonQueryRequest(String jsonString)`
`DirectJsonQueryRequest(String jsonString, SolrParams params)`

## Method Summary

Modifier and Type
Method
Description
`RequestWriter.ContentWriter`
`getContentWriter(String expectedType)`
If a request object wants to do a push write, implement this method.

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

`createResponse, getParams, getPath`

### 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, 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

### DirectJsonQueryRequest

public DirectJsonQueryRequest(String jsonString)

### DirectJsonQueryRequest

public DirectJsonQueryRequest(String jsonString, SolrParams params)

## Method Details

### getContentWriter

public RequestWriter.ContentWriter getContentWriter(String expectedType)
Description copied from class: `SolrRequest`
If a request object wants to do a push write, implement this method.

Overrides:
  `getContentWriter` in class `SolrRequest<QueryResponse>`
Parameters:
  `expectedType` - This is the type that the RequestWriter would like to get. But, it is OK to send any format