# Class: ReindexClient

## ReindexClient

## Constructor

#### new ReindexClient(jiraClient)

Used to access Jira REST endpoints in '/rest/api/2/reindex'

##### Parameters:

Name | Type | Description
--- | --- | ---
`jiraClient` | JiraClient |

Source:
  - api/reindex.js, line 5

### Methods

#### doReindex(opts, callback)

Kicks off a reindex. Need Admin permissions to perform this reindex.

##### Parameters:

Name | Type | Description
--- | --- | ---

`opts`

The request options sent to the Jira API.

###### Properties

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`type` | string | <optional> |  | Case insensitive String indicating type of reindex. If omitted, then defaults to BACKGROUND_PREFERRED
`indexComments` | boolean | <optional> | false | Indicates that comments should also be reindexed. Not relevant for foreground reindex, where comments are always reindexed.
`indexChangeHistory` | boolean | <optional> | false | Indicates that changeHistory should also be reindexed. Not relevant for foreground reindex, where changeHistory is always reindexed.

`callback` |  | Called when the reindex has been started.

Source:
  - api/reindex.js, line 14

#### getReindex(opts, callback)

Gets information on the system reindexes. If a reindex is currently taking place then information about this reindex is returned. If there is no active index task, then returns information about the latest reindex task run, otherwise returns a 404 indicating that no reindex has taken place.

##### Parameters:

Name | Type | Description
--- | --- | ---

`opts`

The request options sent to the Jira API.

###### Properties

Name | Type | Attributes | Description
--- | --- | --- | ---
`taskId` |  | <optional> | The id of an indexing task you wish to obtain details on. If omitted, then defaults to the standard behaviour and returns information on the active reindex task, or the last task to run if no reindex is taking place. . If there is no reindexing task with that id then a 404 is returned.

`callback` |  | Called when the reindex data has been retrieved.

Source:
  - api/reindex.js, line 44