dtSearch Manager (REST)

Relativity's dtSearch engine provides advanced search functionality such as proximity, stemming, fuzzy searches, and Boolean operators. For more information, see dtSearch on the Relativity Documentation site.

In order to perform a dtSearch search, you must build and activate a dtSearch index. The dtSearch Index Manager API exposes these operations, and others, letting you programmatically manage dtSearch Indexes. A sample use case for the dtSearch Manager API is creating a custom application to programmatically run through the stages of index build rather than manually performing these tasks through the Relativity UI.

You can also use the dtSearch Manager API services through the .NET interfaces. These interfaces support the same functionality as available through REST. For more information, see dtSearch Manager API.

URLs

The URLs for REST endpoints contain path parameters that you need to set before making a call:

  • Set the {versionNumber} placeholder to the version of the REST API that you want to use, using the format lowercase v and the version number, for example v1 or v2
  • Set other path parameters in the URLs to the Artifact ID of a given entity, for example setting {workspaceID} to the Artifact ID of a workspace.
  • Note: To indicate the admin-level context, set the {workspaceID} path parameter to -1.

For example, you can use the following URL to create a dtSearch:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes

Set the path parameters as follows:

  • {versionNumber} to the version of the API, such as v1
  • {workspaceID} to the Artifact ID of the workspace where the search should be added.

CRUD operations

The dtSearch Manager API supports create, read, update, and delete operations on dtSearch indexes.

Create a dtSearch index

To create a new dtSearch, send a POST request to the following URL:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes

When the request is successful, the response contains the Artifact ID of the new dtSearch index. It also returns the status code of 200.

Retrieve index metadata

You can retrieve the metadata for a dtSearch index. Send a GET request to the following URL:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/{RelativitySearchProviderID}

Update a dtSearch index

You can update the settings on a dtSearch index such as its name, order, and other fields. To update a dtSearch index, send a PUT request to the following URL:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/{RelativitySearchProviderID}

When the request is successful, it returns the status code of 200.

Delete a dtSearch index

To delete a dtSearch index, send a DELETE request to the following URL:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/{RelativitySearchProviderID}/delete-index

When the request is successful, it returns the status code of 200.

Index build operations

The dtSearch Manager API supports programmatically managing index builds, activation, and other operations performed in Relativity on the dtSearch index console. For more information, see dtSearch on the Relativity Documentation site.

Build Index: Full

You must run a full build after initially creating a dtSearch index. To run a full build of a dtSearch index, send a POST request to the following URL:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/{RelativitySearchProviderID}/full-build-index

The body of the request contains the following:

Copy
{"isActive":true}

When the request is successful, it returns the status code of 200.

Build Index: Incremental

You can run an incremental build after adding or removing documents from your search. To run an incremental build of a dtSearch index, send a POST request to the following URL:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/{RelativitySearchProviderID}/incremental-build-index

The body of the request contains the following:

Copy
{"isActive":true}

When the request is successful, it returns the status code of 200.

Build Index

You can run the following to first initiate an incremental dtSearch index build operation, if possible, or else run a full dtSearch index build operation. Send a POST request to the following URL:

Copy
<host>/Relativity.Rest/API/Relativity.Compute.DtSearchIndexes/workspace/{workspaceID}/dtSearchIndexes/{RelativitySearchProviderID}/buildIndex

The body of the request contains the following:

Copy
{"isActive":true}

When the request is successful, it returns the status code of 200.

Cancel a dtSearch index build

To cancel an index build, send a POST request to the following URL:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/{RelativitySearchProviderID}/cancel-build

When the request is successful, it returns the status code of 200.

Activate a dtSearch index

To activate a dtSearch index for searching, send a POST request to the following URL:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/{RelativitySearchProviderID}/activate-index

When the request is successful, it returns the status code of 200.

Compress a dtSearch index

You can compress a dtSearch index returning all sub-indexes with a fragmentation level greater than zero to a fragmentation level of zero. To compress an index, send a POST request to the following URL:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/{RelativitySearchProviderID}/compress-index

The body of the request contains the following:

Copy
{"isActive":true}

When the request is successful, it returns the status code of 200.

Deactivate index

To deactivate an index, send a POST request to the following URL:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/{RelativitySearchProviderID}/deactivate-index

When the request is successful, it returns the status code of 200.

Swap index

You can swap your index with a replacement index in order to use its resources while your index builds or is inactive or disabled for any reason. To swap indexes, send a POST request to the following URL:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/swap-index

The body of the request contains the following:

  • oldSearchProviderID - the ArtifactID of the dtSearch index whose resources you want to swap.
  • newSearchProviderID - the ArtifactID of the replacement dtSearch index.
Copy
{
"oldSearchProviderID":1130118,
"newSearchProviderID":1128030
}

When the request is successful, it returns the status code of 200.

Retry index build errors

To retry errors that occurred during the index build, send a POST request to the following URL: 

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/{RelativitySearchProviderID}/retry-errors

When the request is successful, it returns the status code of 200.

Track index build progress

To get the progress on an index build, send a GET request to the following URL: 

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/{RelativitySearchProviderID}/index-job-progress

Helper methods

The dtSearch Manager API provides the following helper methods for returning workspace parameters for populating dtSearch saved search properties.

Get active indexes

To get a list of active indexes for a given workspace, send a GET request to the following URL:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/index-shares

Get saved searches 

To get a list of saved searches for a given workspace, send a GET request to the following URL:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/saved-search

The response contains the following fields:

  • Name - the name of the saved search.
  • ID - the Artifact ID of the saved search.

Get index share locations 

To get a list of index share locations for a given workspace, send a GET request to the following URL:

Copy
<host>/Relativity.Rest/API/Relativity.Compute.DtSearchIndexes/workspace/{workspaceID}/dtSearchIndexes/indexshares

Get index statistics

To get statistical data for a given index, send a GET request to the following URL:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/{RelativitySearchProviderID}/index-statistics

Get document-level errors

To get a list of document-level errors that occurred during the index build, send a GET request to the following URL:

Copy
<host>/Relativity.Rest/API/relativity-dtsearch/{versionNumber}/workspaces/{workspaceID}/dtsearch-indexes/{RelativitySearchProviderID}/document-errors