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

# Class FieldAnalysisRequest

java.lang.Object
org.apache.solr.client.solrj.SolrRequest<FieldAnalysisResponse>
org.apache.solr.client.solrj.request.CollectionRequiringSolrRequest<FieldAnalysisResponse>
org.apache.solr.client.solrj.request.FieldAnalysisRequest

All Implemented Interfaces:
  `Serializable`

public class FieldAnalysisRequest extends CollectionRequiringSolrRequest<FieldAnalysisResponse>
A request for the org.apache.solr.handler.FieldAnalysisRequestHandler.

Since:
  solr.14
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
`FieldAnalysisRequest()`
Constructs a new FieldAnalysisRequest with a default uri of "/fieldanalysis".
`FieldAnalysisRequest(String uri)`
Constructs a new FieldAnalysisRequest with a given uri.

## Method Summary

Modifier and Type
Method
Description
`FieldAnalysisRequest`
`addFieldName(String fieldName)`
Adds the given field name for analysis.
`FieldAnalysisRequest`
`addFieldType(String fieldTypeName)`
Adds the given field type for analysis.
`protected FieldAnalysisResponse`
`createResponse(NamedList<Object> namedList)`
Create a new SolrResponse to hold the response from the server.
`List<String>`
`getFieldNames()`
Returns a list of field names the analysis should be performed on.
`List<String>`
`getFieldTypes()`
Returns a list of field types the analysis should be performed on.
`String`
`getFieldValue()`
Returns the field value that will be analyzed when this request is processed.
`SolrParams`
`getParams()`
The parameters for this request; never null.
`String`
`getQuery()`
Returns the query that will be analyzed.
`boolean`
`isShowMatch()`
Returns whether index time tokens that match query time tokens should be marked as a "match".
`FieldAnalysisRequest`
`setFieldNames(List<String> fieldNames)`
Sets the field names on which the analysis should be performed.
`FieldAnalysisRequest`
`setFieldTypes(List<String> fieldTypes)`
Sets the field types on which analysis should be performed.
`FieldAnalysisRequest`
`setFieldValue(String fieldValue)`
Sets the field value to be analyzed.
`FieldAnalysisRequest`
`setQuery(String query)`
Sets the query to be analyzed.
`FieldAnalysisRequest`
`setShowMatch(boolean showMatch)`
Sets whether index time tokens that match query time tokens should be marked as a "match".

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

### FieldAnalysisRequest

public FieldAnalysisRequest()
Constructs a new FieldAnalysisRequest with a default uri of "/fieldanalysis".

### FieldAnalysisRequest

public FieldAnalysisRequest(String uri)
Constructs a new FieldAnalysisRequest with a given uri.

Parameters:
  `uri` - the uri of the request handler.

## Method Details

### createResponse

protected FieldAnalysisResponse 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<FieldAnalysisResponse>`
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<FieldAnalysisResponse>`

### setFieldValue

public FieldAnalysisRequest setFieldValue(String fieldValue)
Sets the field value to be analyzed.

Parameters:
  `fieldValue` - The field value to be analyzed.
Returns:
  This FieldAnalysisRequest (fluent interface support).

### getFieldValue

public String getFieldValue()
Returns the field value that will be analyzed when this request is processed.

Returns:
  The field value that will be analyzed when this request is processed.

### setQuery

public FieldAnalysisRequest setQuery(String query)
Sets the query to be analyzed. May be `null` indicated that no query analysis should take place.

Parameters:
  `query` - The query to be analyzed.
Returns:
  This FieldAnalysisRequest (fluent interface support).

### getQuery

public String getQuery()
Returns the query that will be analyzed. May return `null` indicating that no query analysis will be performed.

Returns:
  The query that will be analyzed. May return `null` indicating that no query analysis will be performed.

### setShowMatch

public FieldAnalysisRequest setShowMatch(boolean showMatch)
Sets whether index time tokens that match query time tokens should be marked as a "match". By default, this is set to `false`. Obviously, this flag is ignored if when the query is set to `null`.

Parameters:
  `showMatch` - Sets whether index time tokens that match query time tokens should be marked as a "match".
Returns:
  This FieldAnalysisRequest (fluent interface support).

### isShowMatch

public boolean isShowMatch()
Returns whether index time tokens that match query time tokens should be marked as a "match".

Returns:
  Whether index time tokens that match query time tokens should be marked as a "match".
See Also:
  - `setShowMatch(boolean)`

### addFieldName

public FieldAnalysisRequest addFieldName(String fieldName)
Adds the given field name for analysis.

Parameters:
  `fieldName` - A field name on which the analysis should be performed.
Returns:
  this FieldAnalysisRequest (fluent interface support).

### setFieldNames

public FieldAnalysisRequest setFieldNames(List<String> fieldNames)
Sets the field names on which the analysis should be performed.

Parameters:
  `fieldNames` - The field names on which the analysis should be performed.
Returns:
  this FieldAnalysisRequest (fluent interface support).

### getFieldNames

public List<String> getFieldNames()
Returns a list of field names the analysis should be performed on. May return `null` indicating that no analysis will be performed on field names.

Returns:
  The field names the analysis should be performed on.

### addFieldType

public FieldAnalysisRequest addFieldType(String fieldTypeName)
Adds the given field type for analysis.

Parameters:
  `fieldTypeName` - A field type name on which analysis should be performed.
Returns:
  This FieldAnalysisRequest (fluent interface support).

### setFieldTypes

public FieldAnalysisRequest setFieldTypes(List<String> fieldTypes)
Sets the field types on which analysis should be performed.

Parameters:
  `fieldTypes` - The field type names on which analysis should be performed.
Returns:
  This FieldAnalysisRequest (fluent interface support).

### getFieldTypes

public List<String> getFieldTypes()
Returns a list of field types the analysis should be performed on. May return `null` indicating that no analysis will be performed on field types.

Returns:
  The field types the analysis should be performed on.