Searching and Paging
18 minute read
For information on Nuix search query syntax and fields, refer to How to Search.
Simple Search
The simplest way to search a case is using the synchronous GET
endpoint.
If you do not supply any query string parameters, the endpoint will return a list of GUIDs and the default maximum number
of records per page. The following example response has been truncated for brevity.
curl --location --request GET 'http://localhost:8080/nuix-restful-service/svc/v2/cases/4b32357a3894481d804266128fa93661/search?query=*' \
--header 'nuix-auth-token: 9729a460-eda7-48dc-ba70-d12b3aae3c8d' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json'
{
"request": {
"caseId": "4b32357a3894481d804266128fa93661",
"query": "*",
"sortField": null,
"sortOrder": null,
"startIndex": 0,
"numberOfRecordsRequested": 100,
"deduplicate": null,
"metadataProfile": null,
"fieldList": null,
"customMetadataList": null,
"propertyList": null,
"itemParameterizedFields": null,
"showAvailableThumbnails": false,
"useCache": false,
"forceCacheDelete": false,
"searchRetry": 0,
"relationType": null,
"entities": [],
"s": 0,
"p": 100,
"customMetadataField": null,
"field": null,
"property": null
},
"startedOn": 1634307172752,
"completedOn": 1634307172934,
"elapsedTimeForSearch": 169,
"elapsedTimeForSort": 0,
"elapsedTimeForMarshal": 13,
"elapsedTimeForDeduplicate": 0,
"elapsedTotal": 182,
"metadataItems": [],
"localizedMetadataItems": [],
"metadataItemDetails": [],
"resultList": [
{
"guid": "175d00fe-2da7-4adb-8486-98dcfa235d16"
},
{
"guid": "6b319806-8dcd-4a14-9793-c2e34b5ae691"
},
{
"guid": "44655544-1774-4631-b3f6-ce8bc765037c"
},
{
"guid": "1efcb6ed-61dc-4974-9dca-5b4f8b5d383d"
}
],
"count": 365,
"deduplicatedCount": 365
}
Searching Using a Metadata Profile
The default search response does not return a lot of detailed information about the items in the case.
To return a more detailed response, you can apply a metadata profile to the search request using the metadataProfile
query parameter.
The following example response has been truncated for brevity.
The Default
metadata profile returns the following fields:
- File Type
- Name
- Path Name
- guid
curl --location --request GET 'http://localhost:8080/nuix-restful-service/svc/v2/cases/4b32357a3894481d804266128fa93661/search?query=*&metadataProfile=Default' \
--header 'nuix-auth-token: 9729a460-eda7-48dc-ba70-d12b3aae3c8d' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json'
{
"request": {
"caseId": "4b32357a3894481d804266128fa93661",
"query": "*",
"sortField": null,
"sortOrder": null,
"startIndex": 0,
"numberOfRecordsRequested": 100,
"deduplicate": null,
"metadataProfile": "Default",
"fieldList": null,
"customMetadataList": null,
"propertyList": null,
"itemParameterizedFields": null,
"showAvailableThumbnails": false,
"useCache": false,
"forceCacheDelete": false,
"searchRetry": 0,
"relationType": null,
"entities": [],
"s": 0,
"p": 100,
"customMetadataField": null,
"field": null,
"property": null
},
"startedOn": 1634308098710,
"completedOn": 1634308099252,
"elapsedTimeForSearch": 190,
"elapsedTimeForSort": 0,
"elapsedTimeForMarshal": 348,
"elapsedTimeForDeduplicate": 0,
"elapsedTotal": 542,
"metadataItems": [
"Name",
"File Type",
"Path Name"
],
"localizedMetadataItems": [
"Name",
"File Type",
"Path Name"
],
"metadataItemDetails": [
{
"name": "Name",
"localisedName": "Name",
"type": "String"
},
{
"name": "File Type",
"localisedName": "File Type",
"type": "String"
},
{
"name": "Path Name",
"localisedName": "Path Name",
"type": "String"
}
],
"resultList": [
{
"File Type": "Hypertext Markup Language Document",
"Name": "allclasses-index.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"guid": "175d00fe-2da7-4adb-8486-98dcfa235d16"
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "allclasses.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"guid": "6b319806-8dcd-4a14-9793-c2e34b5ae691"
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "allpackages-index.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"guid": "44655544-1774-4631-b3f6-ce8bc765037c"
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "constant-values.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"guid": "1efcb6ed-61dc-4974-9dca-5b4f8b5d383d"
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "deprecated-list.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"guid": "24597e5c-ef61-4d43-9cf2-935cd1e5e8ff"
}
],
"count": 365,
"deduplicatedCount": 365
}
Complex Search Queries
Although there are no official limits specified by RFC 2616, many security protocols recommend that you set your server’s maximum query string character limit
to 1024 and your entire URL character limit, including the query string, to a maximum of 2048 characters. In some cases, your query string may be more complex and exceed these limits. For this reason, the REST API also provides a POST
version
of the search endpoint which allows more complex queries to be placed in the request body.
curl --location --request POST 'http://localhost:8080/nuix-restful-service/svc/v2/cases/4b32357a3894481d804266128fa93661/search' \
--header 'nuix-auth-token: 1bc4e278-5640-4d56-a63c-8827cea704bc' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
"caseId" : "4b32357a3894481d804266128fa93661",
"metadataProfile": "Default",
"numberOfRecordsRequested": 100,
"query" : "*",
"useCache" : false
}'
{
"request": {
"caseId": "4b32357a3894481d804266128fa93661",
"query": "*",
"sortField": null,
"sortOrder": null,
"startIndex": 0,
"numberOfRecordsRequested": 100,
"deduplicate": null,
"metadataProfile": "Default",
"fieldList": [],
"customMetadataList": [],
"propertyList": [],
"itemParameterizedFields": [],
"showAvailableThumbnails": false,
"useCache": false,
"forceCacheDelete": false,
"searchRetry": 0,
"relationType": null,
"entities": [],
"s": 0,
"p": 100,
"customMetadataField": [],
"field": [],
"property": []
},
"startedOn": 1634310057960,
"completedOn": 1634310058528,
"elapsedTimeForSearch": 161,
"elapsedTimeForSort": 0,
"elapsedTimeForMarshal": 404,
"elapsedTimeForDeduplicate": 0,
"elapsedTotal": 568,
"metadataItems": [
"Name",
"File Type",
"Path Name"
],
"localizedMetadataItems": [
"Name",
"File Type",
"Path Name"
],
"metadataItemDetails": [
{
"name": "Name",
"localisedName": "Name",
"type": "String"
},
{
"name": "File Type",
"localisedName": "File Type",
"type": "String"
},
{
"name": "Path Name",
"localisedName": "Path Name",
"type": "String"
}
],
"resultList": [
{
"File Type": "Hypertext Markup Language Document",
"Name": "allclasses-index.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"customMetadata": {},
"entities": {},
"guid": "175d00fe-2da7-4adb-8486-98dcfa235d16",
"properties": {}
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "allclasses.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"customMetadata": {},
"entities": {},
"guid": "6b319806-8dcd-4a14-9793-c2e34b5ae691",
"properties": {}
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "allpackages-index.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"customMetadata": {},
"entities": {},
"guid": "44655544-1774-4631-b3f6-ce8bc765037c",
"properties": {}
}
],
"count": 365,
"deduplicatedCount": 365
}
Searching With Field Lists
In some cases, you may need to specify the fields to be returned during a search instead of a metadata profile. You can do so by specifying a field list. The following fields are available.
Field Name | Description |
---|---|
all | All fields |
auditedSize | The audited size for the item. |
caseName | The case name. |
children | The list of items which are children of this item. |
clusterPivotResemblances | A map where keys are cluster IDs and values are resemblances. |
clusterPivots | A map where keys are cluster IDs and values are boolean flags. |
comment | The comments on the item. |
communication | Communication information for the item, if the item represents a communication. |
correctedExtension | The extension based on Nuix’s identification of this items MIME type. |
custodian | The custodian assigned to the item. |
customMetadata | The custom metadata for the item as a map of field name → value. |
date | The item date. |
descendants | The list of items which are descendants of this item. |
digests | A map of computed digests for the item. |
duplicateCustodianSet | The set of custodian names associated with this item and its duplicates. |
duplicatesCount | The number of items that are duplicates of this one. |
duplicates | The list of items which are duplicates of this one. |
duplicateDetails | The details of the duplicate items. |
emailThreadClusters | The thread of e-mails if a cluster run was performed in the case. |
emailThreadClustersCount | A map of queries → counts if a cluster run was performed in the case. |
evidenceMetadata | The custom evidence metadata for the item. |
exclusion | The reason for an item’s exclusion, if any. |
family | The map of items in the same family as this item. |
familyCount | The count of items in the same family as this item. |
familyList | The list of items in the same family as this item. |
fileSize | The size of this item if it is a readable file, or null if this is not file data. |
fileType | The name of this type. |
guid | The item GUID. This is always included. |
history | The complete history of this case, in date ascending order. |
id | The ID of this item. |
itemCategory | The item category. |
kind | The item’s kind. |
itemKind | The item’s kind. The same as kind . |
kindLocalisedName | The name of this kind, localised appropriately for display to users. |
language | The identified language of the item. |
localisedName | The name of the item, or the localised placeholder name (e.g [Unnamed Image]) if it is blank. |
localisedPathNames | A list of the names of items on the path from the root evidence container up to the item itself. |
name | The name of the item. |
nearDuplicatesCount | The count of items that are near-duplicates of this one, given a resemblance threshold. |
nearDuplicates | The list of items that are near-duplicates of this one, given a resemblance threshold. |
nearDuplicateDetails | The details of items that are near-duplicates of this one, given a resemblance threshold. |
originalExtension | The original extension listed on the source file. |
parent | The parent item, or null if this item is a root item. |
path | A list of items which represent the path from the root evidence container up to the item itself. This can be used to look at the MIME type of each item in the path, to search for a top-level item, or for other similar operations. |
pathIds | A list of the IDs of items on the path from the root evidence container up to the item itself. |
pathNames | A list of the names of items on the path from the root evidence container up to the item itself. |
pathName | The localized path name of the item. |
position | The position of this item within the tree. |
printedImageInfo | Gets information about the printed image. |
properties | Gets the properties for the item. |
root | The root item GUID. |
rootUri | The item’s root URI as a string. |
tags | The tags for the item. |
text | The item’s text. |
textHtml | The item’s text formatted in HTML. |
textSummary | The stored text summary of the item if one exists, otherwise null. |
textSummaryHtml | The stored text summary of the item if one exists formatted as HTML, otherwise null. |
threadItems | The list of items which are in the same discussion thread as this one. |
thumbnail | The stored item thumbnail. |
topLevelItem | The top-level item GUID for this item. |
topLevelItemDate | The top-level item date for this item. |
type | The name of this type. |
typeLocalisedName | The name of this type, localised appropriately for display to users. |
uri | The item’s URI as a string. |
isAudited | Tests if the item is considered audited. |
isBinaryAvailable | Tests whether the item’s binary is available before attempting to export it. |
isBinaryStored | Tests whether the item has binary stored against it in the database. |
isChatConversation | Tests whether the item is of kind chat-conversation . |
isChatMessage | Tests whether the item is of kind chat-message . |
isDeleted | Tests whether the item was marked as deleted. |
isEncrypted | Tests whether this item was marked as encrypted. |
isExcluded | Tests if an item is excluded. |
isExportable | Tests whether this item is exportable as a PDF. |
isIncluded | Tests if an item is included (i.e., not excluded). |
isLooseFile | Tests if the item is a loose file. |
isPhysicalFile | Tests if the item is a physical file. |
isPrintedImageStored | Tests whether the printed image is actually stored. |
isTextAvailable | Tests whether the item’s text is available before attempting to read or export it. |
isTextStored | Tests whether the item has text stored against it in the database. |
isThumbnailStored | Tests whether the item has a thumbnail stored against it in the database. Deprecated, for removal: This API element is subject to removal in a future version. |
isTopLevel | Tests if the item is a top-level item. |
isFamilyMember | Tests if the item is a family member. |
isEmailThreadMember | Tests if the item is an email thread member. |
hasEmailAttachment | Tests if the email item has an attachment. |
hasChatAttachment | Tests if the chat item has an attachment. |
curl --location --request POST 'http://localhost:8080/nuix-restful-service/svc/v2/cases/4b32357a3894481d804266128fa93661/search' \
--header 'nuix-auth-token: 1bc4e278-5640-4d56-a63c-8827cea704bc' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
"caseId" : "4b32357a3894481d804266128fa93661",
"numberOfRecordsRequested": 100,
"query" : "flag:encrypted OR NOT flag:encrypted",
"fieldList" : [ "name","guid","date","digest","fileSize","isBinaryAvailable","kind","fileType","pathNames" ],
"useCache" : false
}'
{
"request": {
"caseId": "4b32357a3894481d804266128fa93661",
"query": "flag:encrypted OR NOT flag:encrypted",
"sortField": null,
"sortOrder": null,
"startIndex": 0,
"numberOfRecordsRequested": 100,
"deduplicate": null,
"metadataProfile": null,
"fieldList": [
"name",
"guid",
"date",
"digest",
"fileSize",
"isBinaryAvailable",
"kind",
"fileType",
"pathNames"
],
"customMetadataList": [],
"propertyList": [],
"itemParameterizedFields": [],
"showAvailableThumbnails": false,
"useCache": false,
"forceCacheDelete": false,
"searchRetry": 0,
"relationType": null,
"entities": [],
"s": 0,
"p": 100,
"customMetadataField": [],
"field": [
"name",
"guid",
"date",
"digest",
"fileSize",
"isBinaryAvailable",
"kind",
"fileType",
"pathNames"
],
"property": []
},
"startedOn": 1634310485862,
"completedOn": 1634310486441,
"elapsedTimeForSearch": 157,
"elapsedTimeForSort": 0,
"elapsedTimeForMarshal": 422,
"elapsedTimeForDeduplicate": 0,
"elapsedTotal": 579,
"metadataItems": [],
"localizedMetadataItems": [],
"metadataItemDetails": [],
"resultList": [
{
"File Type": "application/vnd.nuix-evidence",
"customMetadata": {},
"entities": {},
"fileSize": null,
"fileType": "application/vnd.nuix-evidence",
"guid": "90ccc6bf-3cc6-430e-8092-486afdb3d4e3",
"isBinaryAvailable": false,
"kind": "container",
"name": "b488c34f-f46c-47e7-8b2e-549433978781",
"pathNames": [
"b488c34f-f46c-47e7-8b2e-549433978781"
],
"properties": {}
},
{
"File Type": "filesystem/directory",
"customMetadata": {},
"date": 1626686806000,
"entities": {},
"fileSize": null,
"fileType": "filesystem/directory",
"guid": "2d9484a2-d333-4f95-b3d4-83fffddf4f65",
"isBinaryAvailable": false,
"kind": "container",
"name": "doc",
"pathNames": [
"b488c34f-f46c-47e7-8b2e-549433978781",
"doc"
],
"properties": {}
},
{
"File Type": "filesystem/directory",
"customMetadata": {},
"date": 1626686828000,
"entities": {},
"fileSize": null,
"fileType": "filesystem/directory",
"guid": "a6d71a08-efa4-422a-a694-5a069cc8ee74",
"isBinaryAvailable": false,
"kind": "container",
"name": "api",
"pathNames": [
"b488c34f-f46c-47e7-8b2e-549433978781",
"doc",
"api"
],
"properties": {}
},
{
"File Type": "text/html",
"customMetadata": {},
"date": 1626686807000,
"entities": {},
"fileSize": 91046,
"fileType": "text/html",
"guid": "175d00fe-2da7-4adb-8486-98dcfa235d16",
"isBinaryAvailable": true,
"kind": "document",
"name": "allclasses-index.html",
"pathNames": [
"b488c34f-f46c-47e7-8b2e-549433978781",
"doc",
"api",
"allclasses-index.html"
],
"properties": {}
},
{
"File Type": "text/html",
"customMetadata": {},
"date": 1626686819000,
"entities": {},
"fileSize": 38342,
"fileType": "text/html",
"guid": "6b319806-8dcd-4a14-9793-c2e34b5ae691",
"isBinaryAvailable": true,
"kind": "document",
"name": "allclasses.html",
"pathNames": [
"b488c34f-f46c-47e7-8b2e-549433978781",
"doc",
"api",
"allclasses.html"
],
"properties": {}
},
{
"File Type": "text/html",
"customMetadata": {},
"date": 1626686814000,
"entities": {},
"fileSize": 6287,
"fileType": "text/html",
"guid": "44655544-1774-4631-b3f6-ce8bc765037c",
"isBinaryAvailable": true,
"kind": "document",
"name": "allpackages-index.html",
"pathNames": [
"b488c34f-f46c-47e7-8b2e-549433978781",
"doc",
"api",
"allpackages-index.html"
],
"properties": {}
}
],
"count": 365,
"deduplicatedCount": 365
}
Paging Results
Search results can be paged to improve performance. It is best practice to reduce your search results to the minimum
set necessary. To page results, use the startIndex
and numberOfRecordsRequested
fields. For example, to reduce
the result set to 10 results per page starting at the first item, you would set startIndex=0
and numberOfRecordsRequested=10
curl --location --request GET 'http://localhost:8080/nuix-restful-service/svc/v2/cases/4b32357a3894481d804266128fa93661/search?query=*&metadataProfile=Default&startIndex=0&numberOfRecordsRequested=10' \
--header 'nuix-auth-token: 9729a460-eda7-48dc-ba70-d12b3aae3c8d' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json'
{
"request": {
"caseId": "4b32357a3894481d804266128fa93661",
"query": "*",
"sortField": null,
"sortOrder": null,
"startIndex": 0,
"numberOfRecordsRequested": 10,
"deduplicate": null,
"metadataProfile": "Default",
"fieldList": null,
"customMetadataList": null,
"propertyList": null,
"itemParameterizedFields": null,
"showAvailableThumbnails": false,
"useCache": false,
"forceCacheDelete": false,
"searchRetry": 0,
"relationType": null,
"entities": [],
"s": 0,
"p": 10,
"customMetadataField": null,
"field": null,
"property": null
},
"startedOn": 1634317411338,
"completedOn": 1634317411531,
"elapsedTimeForSearch": 159,
"elapsedTimeForSort": 0,
"elapsedTimeForMarshal": 31,
"elapsedTimeForDeduplicate": 0,
"elapsedTotal": 193,
"metadataItems": [
"Name",
"File Type",
"Path Name"
],
"localizedMetadataItems": [
"Name",
"File Type",
"Path Name"
],
"metadataItemDetails": [
{
"name": "Name",
"localisedName": "Name",
"type": "String"
},
{
"name": "File Type",
"localisedName": "File Type",
"type": "String"
},
{
"name": "Path Name",
"localisedName": "Path Name",
"type": "String"
}
],
"resultList": [
{
"File Type": "Hypertext Markup Language Document",
"Name": "allclasses-index.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"guid": "175d00fe-2da7-4adb-8486-98dcfa235d16"
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "allclasses.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"guid": "6b319806-8dcd-4a14-9793-c2e34b5ae691"
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "allpackages-index.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"guid": "44655544-1774-4631-b3f6-ce8bc765037c"
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "constant-values.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"guid": "1efcb6ed-61dc-4974-9dca-5b4f8b5d383d"
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "deprecated-list.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"guid": "24597e5c-ef61-4d43-9cf2-935cd1e5e8ff"
},
{
"File Type": "Plain Text",
"Name": "element-list",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"guid": "f956d7b5-988c-437a-bc87-167a0b012c27"
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "help-doc.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"guid": "e430124c-c912-4863-9e04-77a09199db02"
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "index-all.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"guid": "93ff2b30-a3fa-473b-8437-71e28e10d70e"
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "index.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"guid": "f1850292-bf03-4824-91fa-43dcdf8f8dcd"
},
{
"File Type": "Ini Style Configuration File",
"Name": "member-search-index.js",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"guid": "080d6ccf-06ee-4ac6-a11e-f59faa94e8cb"
}
],
"count": 365,
"deduplicatedCount": 365
}
Now, let’s jump to the end and display the last 5 items by setting startIndex=360
.
Note
startIndex
is the index of the first item you wish to display while numberOfRecordsRequested
is the page size.
curl --location --request GET 'http://localhost:8080/nuix-restful-service/svc/v2/cases/4b32357a3894481d804266128fa93661/search?query=*&metadataProfile=Default&startIndex=360&numberOfRecordsRequested=10' \
--header 'nuix-auth-token: 9729a460-eda7-48dc-ba70-d12b3aae3c8d' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json'
{
"request": {
"caseId": "4b32357a3894481d804266128fa93661",
"query": "*",
"sortField": null,
"sortOrder": null,
"startIndex": 360,
"numberOfRecordsRequested": 10,
"deduplicate": null,
"metadataProfile": "Default",
"fieldList": null,
"customMetadataList": null,
"propertyList": null,
"itemParameterizedFields": null,
"showAvailableThumbnails": false,
"useCache": false,
"forceCacheDelete": false,
"searchRetry": 0,
"relationType": null,
"entities": [],
"s": 360,
"p": 10,
"customMetadataField": null,
"field": null,
"property": null
},
"startedOn": 1634317988476,
"completedOn": 1634317988651,
"elapsedTimeForSearch": 148,
"elapsedTimeForSort": 0,
"elapsedTimeForMarshal": 23,
"elapsedTimeForDeduplicate": 0,
"elapsedTotal": 175,
"metadataItems": [
"Name",
"File Type",
"Path Name"
],
"localizedMetadataItems": [
"Name",
"File Type",
"Path Name"
],
"metadataItemDetails": [
{
"name": "Name",
"localisedName": "Name",
"type": "String"
},
{
"name": "File Type",
"localisedName": "File Type",
"type": "String"
},
{
"name": "Path Name",
"localisedName": "Path Name",
"type": "String"
}
],
"resultList": [
{
"File Type": "Portable Network Graphic",
"Name": "ui-icons_888888_256x240.png",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api/jquery/images",
"guid": "6bc1c2fd-f0d4-4c09-aa04-2fdbc167ca3a"
},
{
"File Type": "Portable Network Graphic",
"Name": "ui-icons_cd0a0a_256x240.png",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api/jquery/images",
"guid": "b5a6db63-d22e-44d3-8134-f1815b2db29c"
},
{
"File Type": "Directory",
"Name": "dist",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api/jquery/jszip",
"guid": "c3e0934d-c11c-48de-b4e2-72ee73602e57"
},
{
"File Type": "Directory",
"Name": "dist",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api/jquery/jszip-utils",
"guid": "f9487081-2727-4dd6-9894-bb1981f0e16a"
},
{
"File Type": "Nuix Evidence File",
"Name": "b488c34f-f46c-47e7-8b2e-549433978781",
"Path Name": "/",
"guid": "90ccc6bf-3cc6-430e-8092-486afdb3d4e3"
}
],
"count": 365,
"deduplicatedCount": 365
}
Sorting Results
Results can be sorted using the sortField
and sortOrder
fields.
For example, to sort the results by Name
in descending order
you would set the sortField to Name
and the sortOrder to DESC
.
curl --location --request GET 'http://localhost:8080/nuix-restful-service/svc/v2/cases/4b32357a3894481d804266128fa93661/search?query=*&metadataProfile=Default&numberOfRecordsRequested=5&sortField=Name&sortOrder=DESC' \
--header 'nuix-auth-token: 9729a460-eda7-48dc-ba70-d12b3aae3c8d' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json'
{
"request": {
"caseId": "4b32357a3894481d804266128fa93661",
"query": "*",
"sortField": "Name",
"sortOrder": "DESC",
"startIndex": 0,
"numberOfRecordsRequested": 5,
"deduplicate": null,
"metadataProfile": "Default",
"fieldList": null,
"customMetadataList": null,
"propertyList": null,
"itemParameterizedFields": null,
"showAvailableThumbnails": false,
"useCache": false,
"forceCacheDelete": false,
"searchRetry": 0,
"relationType": null,
"entities": [],
"s": 0,
"p": 5,
"customMetadataField": null,
"field": null,
"property": null
},
"startedOn": 1634318448677,
"completedOn": 1634318448959,
"elapsedTimeForSearch": 271,
"elapsedTimeForSort": 118,
"elapsedTimeForMarshal": 10,
"elapsedTimeForDeduplicate": 0,
"elapsedTotal": 282,
"metadataItems": [
"Name",
"File Type",
"Path Name"
],
"localizedMetadataItems": [
"Name",
"File Type",
"Path Name"
],
"metadataItemDetails": [
{
"name": "Name",
"localisedName": "Name",
"type": "String"
},
{
"name": "File Type",
"localisedName": "File Type",
"type": "String"
},
{
"name": "Path Name",
"localisedName": "Path Name",
"type": "String"
}
],
"resultList": [
{
"File Type": "Portable Network Graphic",
"Name": "x.png",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api/resources",
"guid": "7a429f1c-c59c-409f-93aa-cea3a2e751e8"
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "WorkerItem.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api/nuix",
"guid": "00d45666-5369-428d-9a10-08675db5283e"
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "WorkerBroker.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api/nuix",
"guid": "242577e0-cf96-4ba5-a413-3bf86d8f0e37"
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "WorkerAgentStatus.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api/nuix",
"guid": "28e41e5f-979e-4ecc-bfc3-5eb4baf943c5"
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "WorkerAgent.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api/nuix",
"guid": "7f391063-ee68-4506-8eb2-8d16ef115657"
}
],
"count": 365,
"deduplicatedCount": 365
}
Deduplication
For the purposes of demonstration, we have ingested some duplicate data into this case. When searching,
we can have duplicate items removed by setting the deduplicate
flag equal to true
. Note that the total
number of search hits is available in the count
field but the deduplicated search hits is available in the
deduplicatedCount
field.
In this example, we have set the startIndex
to 381 with the deduplicatedCount
equal to 385 and the numberOfRecords
field set to 5. The response shows the last 4 results of the search.
Note
When paging with deduplicated results, be sure to use thededuplicatedCount
field and verify that the value of startIndex
does not exceed the value of deduplicatedCount
.
curl --location --request GET 'http://localhost:8080/svc/v2/cases/4b32357a3894481d804266128fa93661/search?query=*&metadataProfile=Default&startIndex=381&numberOfRecordsRequested=5&deduplicate=true' \
--header 'nuix-auth-token: 9729a460-eda7-48dc-ba70-d12b3aae3c8d' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json'
{
"request": {
"caseId": "4b32357a3894481d804266128fa93661",
"query": "*",
"sortField": null,
"sortOrder": null,
"startIndex": 381,
"numberOfRecordsRequested": 5,
"deduplicate": "md5",
"metadataProfile": "Default",
"fieldList": null,
"customMetadataList": null,
"propertyList": null,
"itemParameterizedFields": null,
"showAvailableThumbnails": false,
"useCache": false,
"forceCacheDelete": false,
"searchRetry": 0,
"relationType": null,
"entities": [],
"s": 381,
"p": 5,
"customMetadataField": null,
"field": null,
"property": null
},
"startedOn": 1634319019422,
"completedOn": 1634319023095,
"elapsedTimeForSearch": 3659,
"elapsedTimeForSort": 0,
"elapsedTimeForMarshal": 13,
"elapsedTimeForDeduplicate": 3431,
"elapsedTotal": 3673,
"metadataItems": [
"Name",
"File Type",
"Path Name"
],
"localizedMetadataItems": [
"Name",
"File Type",
"Path Name"
],
"metadataItemDetails": [
{
"name": "Name",
"localisedName": "Name",
"type": "String"
},
{
"name": "File Type",
"localisedName": "File Type",
"type": "String"
},
{
"name": "Path Name",
"localisedName": "Path Name",
"type": "String"
}
],
"resultList": [
{
"File Type": "Directory",
"Name": "dist",
"Path Name": "/a6413d2e-c9d6-4fa8-be81-3dfb08283370/doc/api/jquery/jszip",
"guid": "7579aa21-5a7a-473d-9166-326ee2ce741f"
},
{
"File Type": "Directory",
"Name": "dist",
"Path Name": "/a6413d2e-c9d6-4fa8-be81-3dfb08283370/doc/api/jquery/jszip-utils",
"guid": "bc9905b9-d7a3-4eba-b040-c5664b71d9b2"
},
{
"File Type": "Nuix Evidence File",
"Name": "b488c34f-f46c-47e7-8b2e-549433978781",
"Path Name": "/",
"guid": "90ccc6bf-3cc6-430e-8092-486afdb3d4e3"
},
{
"File Type": "Nuix Evidence File",
"Name": "a6413d2e-c9d6-4fa8-be81-3dfb08283370",
"Path Name": "/",
"guid": "520a0877-4869-43e1-a46e-531850e765a1"
}
],
"count": 730,
"deduplicatedCount": 385
}
Asynchronous Search
Up until this point, we have only discussed synchronous searches. It is also possible to run a search in the background and poll the result of
the search task for completion before displaying results. When running an asynchronous search, an AsyncFunctionResponse
is returned. This
result needs to be polled for status and the result of the function is the search result.
curl --location --request POST 'http://localhost:8080/nuix-restful-service/svc/v1/cases/4b32357a3894481d804266128fa93661/asyncFunctions/search' \
--header 'nuix-auth-token: 9729a460-eda7-48dc-ba70-d12b3aae3c8d' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
"caseId" : "4b32357a3894481d804266128fa93661",
"metadataProfile": "Default",
"query" : "*",
"numberOfRecordsRequested": 5
}'
{
"functionKey": "7f6422ed-66e5-420b-ba2d-f97e202f0949",
"location": "http://localhost:8080/nuix-restful-service/svc/v1/asyncFunctions/7f6422ed-66e5-420b-ba2d-f97e202f0949"
}
curl --location --request GET 'http://localhost:8080/nuix-restful-service/svc/v1/asyncFunctions/7f6422ed-66e5-420b-ba2d-f97e202f0949' \
--header 'nuix-auth-token: 1bc4e278-5640-4d56-a63c-8827cea704bc'
{
"done": true,
"cancelled": false,
"result": {
"request": {
"caseId": "4b32357a3894481d804266128fa93661",
"query": "*",
"sortField": null,
"sortOrder": null,
"startIndex": 0,
"numberOfRecordsRequested": 5,
"deduplicate": null,
"metadataProfile": "Default",
"fieldList": [],
"customMetadataList": [],
"propertyList": [],
"itemParameterizedFields": [],
"showAvailableThumbnails": false,
"useCache": false,
"forceCacheDelete": false,
"searchRetry": 0,
"relationType": null,
"entities": [],
"s": 0,
"p": 5,
"customMetadataField": [],
"property": [],
"field": []
},
"startedOn": 1634320241510,
"completedOn": 1634320241773,
"elapsedTimeForSearch": 222,
"elapsedTimeForSort": 0,
"elapsedTimeForMarshal": 16,
"elapsedTimeForDeduplicate": 0,
"elapsedTotal": 263,
"metadataItems": [
"Name",
"File Type",
"Path Name"
],
"localizedMetadataItems": [
"Name",
"File Type",
"Path Name"
],
"metadataItemDetails": [
{
"name": "Name",
"localisedName": "Name",
"type": "String"
},
{
"name": "File Type",
"localisedName": "File Type",
"type": "String"
},
{
"name": "Path Name",
"localisedName": "Path Name",
"type": "String"
}
],
"resultList": [
{
"File Type": "Hypertext Markup Language Document",
"Name": "allclasses-index.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"customMetadata": {},
"entities": {},
"guid": "175d00fe-2da7-4adb-8486-98dcfa235d16",
"properties": {}
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "allclasses.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"customMetadata": {},
"entities": {},
"guid": "6b319806-8dcd-4a14-9793-c2e34b5ae691",
"properties": {}
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "allpackages-index.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"customMetadata": {},
"entities": {},
"guid": "44655544-1774-4631-b3f6-ce8bc765037c",
"properties": {}
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "constant-values.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"customMetadata": {},
"entities": {},
"guid": "1efcb6ed-61dc-4974-9dca-5b4f8b5d383d",
"properties": {}
},
{
"File Type": "Hypertext Markup Language Document",
"Name": "deprecated-list.html",
"Path Name": "/b488c34f-f46c-47e7-8b2e-549433978781/doc/api",
"customMetadata": {},
"entities": {},
"guid": "24597e5c-ef61-4d43-9cf2-935cd1e5e8ff",
"properties": {}
}
],
"count": 730,
"deduplicatedCount": 730
},
"token": "1bc4e278-5640-4d56-a63c-8827cea704bc",
"functionKey": "7f6422ed-66e5-420b-ba2d-f97e202f0949",
"progress": 6,
"total": 6,
"percentComplete": 100.0000,
"updatedOn": 1634320241773,
"status": "DONE:100/100",
"statusId": null,
"requestTime": 1634320235045,
"startTime": 1634320235050,
"finishTime": 1634320241773,
"caseId": "4b32357a3894481d804266128fa93661",
"caseName": "SearchBestPractice",
"hasSuccessfullyCompleted": true,
"friendlyName": "Search Native Function",
"caseLocation": "/Cases/SearchBestPractice",
"requestor": "nuixadmin",
"licenseShortName": "enterprise-workstation",
"action": "AsyncSearchFunction",
"options": {},
"participatingInCaseFunctionQueue": false,
"processedBy": "nuix-restful-server-2",
"errorMsg": null
}
One major difference between synchronous and asynchronous searches is that asynchronous searches can be performed in a cluster. The previous request
was run in a cluster of three Nuix REST nodes. Note that the processedBy
field in the response says it was processed by nuix-restful-server-2
.
Note
Only Elasticsearch based cases are supported within clustered environments.Feedback
Was this page helpful?
Thank you for your feedback.
Thank you for your feedback.