Legacy dtSearch Manager service

The dtSearch Manager service is being deprecated in a future release. When implementing new custom functionality, use the new dtSearch Manager API. This interface is also available for use through .NET. For more information, see dtSearch Manager service.

The Relativity REST API supports operations with dtSearch saved searches though the dtSearch Manager Service. The operations available through the service are equivalent to the methods for interacting with the dtSearch DTO in the Relativity Services API. For more information, see dtSearch in the Services API documentation.

Note: You can only use the POST method when interacting with the service.

You can programmatically execute dtSearches created with the dtSearch Manager Service using the SavedSearchCondition class of the Relativity Services API or a saved search query in the REST API.

This page contains the following information:

Client code sample

The following is an example of .NET REST client for creating a dtSearch saved search. The code can be used for all dtSearch Manager Service operations with different endpoint URLs and input JSON values.

//Set up the client.
            
HttpClient httpClient = new HttpClient();
httpClient.BaseAddress = new Uri("http://localhost/");

//Set the required headers.
            
httpClient.DefaultRequestHeaders.Add("X-CSRF-Header", "-");
httpClient.DefaultRequestHeaders.Add("Authorization", "Basic c2FtcGxlYWRtaW5AcmVsYXRpdml0eS5yZXN0OlMwbTNwQHNzdzByZA==");

//Call Create for a SavedSearch.
            
string url = "Relativity.REST/api/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/Create";
StringContent content = new StringContent(CreateInputJSON, Encoding.UTF8, "application/json");
HttpResponseMessage response = httpClient.PostAsync(url, content).Result;
string result = response.Content.ReadAsStringAsync().Result;
bool success = HttpStatusCode.Created == response.StatusCode;

//Parse the result with Json.NET.
            
JObject resultObject = JObject.Parse(result);        

Create

Use this dtSearch Manager Service URL to create a dtSearch:

/Relativity.REST/api/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/CreateSingleAsync

The request must include a workspace ID and valid JSON representation of a dtSearch DTO. For more information, see Saved search object properties in JSON representations.

Note: Required dtSearch DTO properties include ArtifactTypeID, Name, SearchIndex, and Fields.

The response is an Artifact ID of the created search.

Read

Use this dtSearch Manager Service URL to read a dtSearch:

/Relativity.REST/api/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/ReadSingleAsync   

The request must include the workspace ID and the dtSearch saved search Artifact ID.

{
  "workspaceArtifactID": 1030160,
  "searchArtifactID": 1038891
}  

The response returns a JSON representation of a dtSearch DTO.

Update

Use this dtSearch Manager Service URL to update a dtSearch:

/Relativity.REST/api/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/UpdateSingleAsync

The request must include a workspace ID and a valid JSON representation of a dtSearch DTO.

Note: You must include all DTO field information in the update. You cannot update individual fields because fields left empty will be cleared on the update. All DTO fields are required except for system/user created by/created on.

The following JSON sample illustrates how to change fields and sort order of the dtSearch created in a previous example.

{
  "workspaceArtifactID": 1275698,
  "searchDTO": {
    "ArtifactID": 1038769,
    "ArtifactTypeID": 10,
    "Name": "Oil and Gas Search",
    "SearchContainer": {
      "ArtifactID": 1038762,
      "Name": "Admin Searches"
    },
    "Owner": {
      "ArtifactID": 1271248,
      "Name": "Doe, Jane"
    },
    "SearchIndex": {
      "ArtifactID": 1038690,
      "Name": "dtSearch"
    },
    "Scope": "EntireCase",
    "SearchFolders": [],
    "RequiresManualRun": false,
    "SearchCriteria": {
      "Conditions": [
        {
          "Condition": {
            "Operator": "IsAfter",
            "Month": "NotSet",
            "FieldIdentifier": {
              "Name": "Date Created"
            },
            "Value": "2014-10-05T00:00:00",
            "NotOperator": false,
            "ConditionType": "CriteriaDate"
          },
          "BooleanOperator": "And"
        },
        {
          "Condition": {
            "Operator": "IsLike",
            "FieldIdentifier": {
              "Name": "Author"
            },
            "Value": "Doe",
            "NotOperator": false,
            "ConditionType": "Criteria"
          },
          "BooleanOperator": "None"
        }
      ],
      "BooleanOperator": "None"
    },
    "Fields": [
      {
        "Name": "Doc ID Beg"
      },
      {
        "Name": "Author"
      },
      {
        "Name": "Extracted Text"
      }
    ],
    "Sorts": [
      {
        "FieldIdentifier": {
          "Name": "Doc ID Beg"
        },
        "Order": 0,
        "Direction": 1
      }
    ],
    "SortByRank": true,
    "SearchText": "jane doe oil gas",
    "FuzzinessLevel": 3,
    "EnableStemming": true
  }
}

The response does not contain any data. Success or failure is indicated by the HTTP status code. For more information, see HTTP status codes.

Delete

Use this dtSearch Manager Service URL to update a dtSearch:

/Relativity.REST/api/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/DeleteSingleAsync   

The request must include the workspace ID and the dtSearch saved search Artifact ID.

{
  "workspaceArtifactID": 1030160,
  "searchArtifactID": 1038661
}  

The response does not contain any data. Success or failure is indicated by the HTTP status code. For more information, see HTTP status codes.

Query

The dtSearch Manager Service URL for querying dtSearch:

/Relativity.REST/api/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/QueryAsync

The request must include the workspace ID and the query. You can also specify the number of results to return as the optional length property.

{
  "workspaceArtifactID": 1030160,
  "query": {
    "Condition": "'Name' STARTSWITH 'My'",
    "Sorts": [
      {
        "FieldIdentifier": {
          "ArtifactID": 0,
          "ViewFieldID": 0,
          "Guids": [],
          "Name": "ArtifactID"
        },
        "Order": 0,
        "Direction": 1
      }
    ]
  },
  "length": 5
}

If more results are available than initially specified in the length property, the query returns a token value that is not null. The results can subsequently be retrieved by a call to the QuerySubsetAsync operation.

/Relativity.REST/api/Relativity.Services.Search.ISearchModule/Keyword%20Search%20Manager/QuerySubsetAsync

Note that the QuerySubsetAsync request can specify the starting index of the result subset and the number of results to be returned.

{
  "workspaceArtifactID": 1030160,
  "queryToken": "d0aff8bf-321d-4600-8240-dba2f0173b1d",
  "start": 6,
  "length": 5
}

To return all analytics saved searches in a workspace, specify an empty Condition as shown in the JSON example below. When the length parameter is not specified, its value defaults to 0, and the number of returned results defaults to the Instance setting value of PDVDefaultQueryCacheSize of 10000. For more information, see Search Relativity.

{
  "workspaceArtifactID": 1030160,
  "query":{}
}

The response returns a collection of dtSearch objects as a dtSearchQueryResultSet object.

Move

You can move an saved dtSearch to a different folder. Send a request to this dtSearch Manager service URL:

/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/MoveAsync

The request must contain the following fields:

  • workspaceArtifactID – the Artifact ID for the workspace where the saved search resides.
  • artifactID – the Artifact ID of the search.
  • destinationContainerID – the Artifact ID of the target saved search folder.

Note: You must have delete permission for saved search and search folder on the source search folder and add permissions for saved search and search folder on destination folder. If any of those is not met then a validation error is returned.

{
   "workspaceArtifactID": 1015024,
   "artifactID": 1039180,
   "destinationContainerID": 1039178
}

The response returns the following fields:

  • ProcessState - a message that indicates the current operation executing on the search being moved. The values can include:
    • Moving saved searches.
    • Error
    • Completed
  • TotalOperations - equals the sum of the number of moved objects.
  • OperationsCompleted - indicates the number of operations that have been executed.
{
   "TotalOperations": 1,
   "ProcessState": "Completed",
   "OperationsCompleted": 1
}

Note: Unlike the Services API, the dtSearch Manager Service doesn’t support use of progress indicators or cancellation tokens.

Copy

You can create a copy of an existing dtSearch saved search in the same saved search folder. Send a request to this dtSearch Manager service URL:

/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/CopySingleAsync

The request must contain the following fields:

  • workspaceArtifactID – the Artifact ID for the workspace where the saved search resides.
  • artifactID – the Artifact ID of the search
{
   "workspaceArtifactID": 1015024,
   "searchArtifactID": 1036361
}

This creates a copy of an existing search in the same location. The name of the copy is based on the name of the original with an incremented number in brackets, for example Smith Case Documents (2).

The response returns the saved search reference object the with following fields:

  • ArtifactID - the Artifact ID of the copy.
  • Name - the name of the copy.
{
    "ArtifactID": 1041178,
    "Name": "Smith Case Documents (2)"
}

Helper operations

The dtSearch Manager Service provides the following helper operations for retrieving search properties:

GetEmailToLinkUrlAsync

The dtSearch Manager Service URL for retrieving an email link to dtSearch results:

/Relativity.REST/api/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/GetEmailToLinkUrlAsync

Note: In order for GetEmailToLinkUrlAsync to return results, the EmailLinkURLOverride instance setting option must be enabled. For more information, see Instance settings' descriptions on the Relativity Documentation site.

The request must include the workspace ID and the search artifact ID.

{
  "workspaceArtifactID": 1030160,
  "searchArtifactID": 1039106
}

The response is the string value of the email link.

"mailto:?subject=Relativity%20Review%20-%20Integration%20Tests%20-%20My%20New%20dtSearch%20With%20Two%20Conditions&body=http%3a%2f%2fmyhost%2frelativity%2fsearchlink.aspx%3fSelectedSearchArtifactID%3d1039106%26AppID%3d1275015"

GetFieldsForCriteriaConditionAsync

The dtSearch Manager Service URL for retrieving all workspace fields available to the user that can be included in a saved search conditions criteria:

/Relativity.REST/api/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/GetFieldsForCriteriaConditionAsync

The request must include the workspace ID and the search artifact type ID.

{
  "workspaceArtifactID": 1275015,
  "artifactTypeID": 10
}

Note: Currently only Document can be specified as the artifact type.

The response is a collection of Field objects. For more information about Field object properties, see JSON representations.

GetFieldsForObjectCriteriaCollectionAsync

The dtSearch Manager Service URL for retrieving all workspace fields available to the user that can be specified as a subcondition for a given field in batch and multi-object field conditions .

/Relativity.REST/api/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/GetFieldsForObjectCriteriaCollectionAsync

The request must include the workspace ID, a multi-object Field, and the search artifact type ID.

{
  "workspaceArtifactID": 1275015,
   "field":{"Name": "Batch"},
  "artifactTypeID": 10
}

The response is a collection of Field objects. For more information about Field object properties, see JSON representations.

[
  {
    "ArtifactID": 1035250,
    "ViewFieldID": 1000422,
    "Guids": [
      "d7a9d9fd-68fc-4c85-ad44-ba524a0ca872"
    ],
    "Name": "Batch"
  },
  {
    "ArtifactID": 1035251,
    "ViewFieldID": 1000423,
    "Guids": [
      "8c3ea95d-6c72-4463-8696-1b6859c0e00e"
    ],
    "Name": "Batch::Batch Set"
  },
  {
    "ArtifactID": 1035252,
    "ViewFieldID": 1000424,
    "Guids": [
      "3e62303c-b955-4a93-b82a-894ce40b5563"
    ],
    "Name": "Batch::Assigned To"
  },
  {
    "ArtifactID": 1035253,
    "ViewFieldID": 1000425,
    "Guids": [
      "70e1751f-4f6b-4c1d-abd7-8a6328750175"
    ],
    "Name": "Batch::Status"
  }
]

GetFieldsForSearchResultViewAsync

The dtSearch Manager Service URL:

/Relativity.REST/api/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/GetFieldsForSearchResultViewAsync

If the request includes the workspace ID and the artifact type ID, the service returns all workspace fields available to the user as a collection of Field objects in the FieldsNotIncluded property.

{
  "workspaceArtifactID": 1030160,
  "artifactTypeID": 10
}

If the request includes the workspace ID, the artifact type ID, and the Artifact ID of a dtSearch saved search, the service returns the fields included in the specified search as a collection of Field objects in the FieldsIncluded property. Workspace fields available to be included in the search are returned in the FieldsNotIncluded property.

{
  "workspaceArtifactID": 1030160,
  "artifactTypeID": 10,
  "searchArtifactID": 1039076
}

GetSearchIncludesAsync

To return all relational fields available to the user in the workspace, use this dtSearch Manager Service URL:

/Relativity.REST/api/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/GetSearchIncludesAsync

The request must include a workspace ID.

{
  "workspaceArtifactID": 1030160
}

The response includes a collection of Field objects.

[
  {
    "ArtifactID": 0,
    "ViewFieldID": 0,
    "Guids": [],
    "Name": ""
  },
  {
    "ArtifactID": 1035456,
    "ViewFieldID": 1000643,
    "Guids": [
      "14ffb8be-42d1-419e-b72c-645484a78a83"
    ],
    "Name": "Include Conversation Family"
  },
  {
    "ArtifactID": 1003669,
    "ViewFieldID": 1000188,
    "Guids": [
      "a426bc5e-3420-47b4-a293-4c4848a237d7"
    ],
    "Name": "Include Duplicates"
  },
  {
    "ArtifactID": 1036396,
    "ViewFieldID": 1000671,
    "Guids": [
      "c0aa4323-45d5-4db3-bf00-71094792901b"
    ],
    "Name": "Include Emailset"
  },
  {
    "ArtifactID": 1036394,
    "ViewFieldID": 1000670,
    "Guids": [
      "ff4e3c74-d1e0-4c0c-bb58-b50dd7ee8dfa"
    ],
    "Name": "Include EquiSet"
  },
  {
    "ArtifactID": 1003671,
    "ViewFieldID": 1000190,
    "Guids": [
      "1f036749-a691-4aa8-8cf7-5eeb80c36caf"
    ],
    "Name": "Include Family"
  }
]

GetSearchIndexesAsync

To return all dtSearch indexes available to the user for a given workspace, use this dtSearch Manager Service URL:

//Relativity.REST/api/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/GetSearchIndexesAsync

The request must include a workspace ID.

{
  "workspaceArtifactID": 1030160
}

The response includes a collection of index objects.

[
  {
    "ArtifactID": 1038684,
    "Name": "Salt vs Pepper case index"
  },
  {
    "ArtifactID": 1039332,
    "Name": "Oil and gas correspondence index"
  }
]

GetSearchOwnersAsync

To return all users in the workspace with permissions to view saved searches, use this dtSearch Manager Service URL:

/Relativity.REST/api/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/GetSearchIncludesAsync

The request must include a workspace ID.

{
  "workspaceArtifactID": 1030160
}

The response includes a collection of User objects.

[
  {
    "ArtifactID": 0,
    "Name": "Public, Joe"
  },
  {
    "ArtifactID": 9,
    "Name": "Admin, Relativity"
  },
  {
    "ArtifactID": 1000000392,
    "Name": "Admin, Relativity"
  },
  {
    "ArtifactID": 1271248,
    "Name": "Doe, Jane"
  }
]

GetAccessStatusAsync

The GetAccessStatusAsync endpoint returns the information about the user‘s ability to access the saved search.

To return the access status, use this dtSearch Manager Service URL:

/Relativity.REST/api/Relativity.Services.Search.ISearchModule/dtSearch%20Manager/GetAccessStatusAsync

The request must include these fields:

  • workspaceArtifactID – the Artifact ID for the workspace where the folder resides.
  • artifactID – the Artifact ID of the keyword search.
  • ancestorArtifactIDs – a an empty of Artifact IDs representing the folder path where the search resides.
{
    "workspaceArtifactID": 1015024,
    "artifactID": 1038050,
    "ancestorArtifactIDs":[1036361, 1035243]        
}

The response returns an access status object with the following fields:

  • Exists – indicates whether the folder exists relative to the specified folder path.
  • CanView – indicates whether the user has view permissions to the search.
  • CanAccessSearchProvider – indicates whether the user has view permissions to the search provider used in the search.
  • CanViewCriteriaFields – indicates whether the user has view permissions to all of the fields used in the search.
{
    "Exists": true,
    "CanView": true,
    "CanAccessSearchProvider": false,
    "CanViewCriteriaFields": false
}