Search Services - CaseSearch
The service is generated based on the ICaseSearchAction interface, which implements SOAP services.
https://<hgdb_server_name>[:port]/mercury-ws-app/restServices/CaseSearchRest.wadl
Example: https://testcluster.hgdb.io/mercury-ws-app/restServices/CaseSearchRest.wadl.
A collection of basic search and aggregation methods. Below is a list of available methods with their descriptions:
Method(HTTP Method) | Description | |
---|---|---|
☑️ | echo(POST) | Test method, to verify the connection to the MercuryDB 3.0 (HgDB) service server. See the article Testing the connection with Echo. |
☑️ | groupByQuery(POST) | The implementation is a duplicate of the data aggregation method of the same name contained in the CaseSearchExtRest service, see the description in the article Extended search and data aggregation services - CaseSearchExt. |
☑️ | searchByQuery(POST) | The implementation is a simpler version of the data search method of the same name, which is included in the CaseSearchExtRest service, see the description in the article Extended data search and aggregation services - CaseSearchExt. The difference is that the method does not have the resultTypeName argument, the result can only be presented in the form as is. |
✅️ | searchNarrativeByQuery(POST) | The basic method of searching for cases based on a query to the Lucene index, however the result is returned as a list of CaseNarrative objects, which contains shortened, basic data, coming from the case header. As a result, we get a uniform list with case data. The service result can be used in a tabular presentation. |
☑️ | searchByQueryWithResultType(POST) | The implementation is a special solution of the method called searchByQuery(POST). The method searches for cases based on a query to the Lucene index, however the returned result is converted to a list of cases of one type of case declared in the search request. The mechanism can be used, for example, to transform cases from one type to another. We get a uniform list. The result of the service can be used in a tabular presentation. The method is a duplicate of the implementation of the CaseSearchExtRest service called searchByQuery(POST) , see the description in the article Extended search and data aggregation services - CaseSearchExt |
searchNarrativeByQuery
Searches for cases based on a query to the Lucene index, however the result is returned as a list of CaseNarrative
objects.
We can use the method to present the search result in a single table, even though the returned list contains data from cases of different types. The CaseNarrative
object contains all the necessary data describing the case, so that it is possible to add more details to fully present it.
Method request parameters
Below we will find a description of the method's input parameters.
context
Parameter name | context |
Type | Context |
Required? | Yes |
The context of the request. You can find more about the context in the article SOAP/REST service request context.
Context object example
{
"userName": "anonymous",
"userFullName": null,
"locale": null,
"timeZone": null,
"maxResults": 1,
"currentRole": "anonymous",
"userRoles": null,
"sourceOfRequest": null,
"maxDepthResult": 1,
"decodeResult": "DECODE_DATE_AND_LOB",
"ignoreCaseHeaderInResponse": false,
}
query
Parameter name | query |
Type | String |
Required? | Yes |
A search query for the Lucene index. See the Search Queries section for a description of how to construct queries.
Example search query for the mrc_Case_id
field for two ranges of its values
"mrc_Case_id:[806000 TO 806525] mrc_Case_id:[706525 TO 709000]"
page
Parameter Name | page |
Type | MrcPage |
Required? | Yes |
Definition of the result page object to fetch. Indicates which search result page to fetch.
Example, first page of 10 results
{
"size": 10,
"number": 1
}
sortClause
Parameter Name | sortClause |
Type | String |
Required? | No |
The search result sort clause defined as a concatenation of the field name and the direction acronym (ASC
- ascending, DESC
- descending).
There is a limitation to defining sorting direction of the result to one field.
Example of ascending sorting by a field named grParticipantFullname
"grParticipantFullname ASC"
additionalDateRange
Parameter name | additionalDateRange |
Type | String |
Required? | No |
Additional narrowing query based on a field of type Date
(date). The query criterion must be defined as a range, i.e. "from to". The criterion is written as a range of milliseconds representing the date1.
Example of a criterion to limit results to cases created between 1999-12-31
and 2019-06-31 21:26:34.143
"mrc_createDate:[946681200000 TO 1564608394143]"
Example of a method request
Example of a method request in JSON form for a REST service
{
"context": {
"appName": "mercury-ws-app",
"appVersion": "1.0",
"userName": "admin",
"maxResults": 10000,
"queryTimeout": 2147483647,
"locale": "pl_PL",
"timeZone": "Europe/Warsaw",
"eager4omdBuilder": "true",
"trustedData": false,
"currentRole": "mrc-user",
"userRoles": ["mrc-user","mrc-useradmin"],
"sourceOfRequest": "USER_DEV.localhost",
"directRequest": false,
"formats": {
"date.format.long": "dd-MM-yyyy HH:mm:ss XXX"
},
"ignoreAlternateFields": true,
"decodeResult": "DATE_AND_LOB",
"maxDepthResult": 1,
"decodeRequest": "DATE_AND_LOB",
"ignoreCaseHeaderInResponse": true,
"cacheUsage": "REFRESH",
"httpResponseCacheUsage": "NONE"
},
"query": "mrc_Case_id:[806000 TO 806525] mrc_Case_id:[706525 TO 709000]",
"page": {
"size": 10,
"number": 1
},
"sortClause": "mrc_Case_id DESC",
"additionalDateRange": "mrc_createDate:[946681200000 TO 1564608394143]"
}
Method response parameter
Below we will find a description of the method output parameters (responses to the sent request).
Parameter | Description |
---|---|
errorCode | Error code. When the operation is successful, it takes the value null . Information about the data contained in the value of this parameter can be obtained by reading the article What does the value of the "errorCode" field mean?. |
errorMessage | Error message. When the operation is successful, it takes the value null . See also the article What does the value of the "errorCode" field mean? |
pagedResult | Paged list of found elements represented by an object of the type PagedResult . In this case, the single rows will represent an object of type CaseNarrative . See also the article PagedResult as a list of retrieved data |
CaseNarrative object
Layers used in | Business |
Type | Business object |
Java interface | Serializable |
Java implementation | pro.ibpm.mercury.business.data.api.CaseNarrative |
DTO implementation | pro.ibpm.mercury.business.data.api.CaseNarrative |
Search result element. Its task is to send a minimal and sufficiently large amount of data that clearly describes the case.
Parameter | Description | Type | Required? | Allowed values |
---|---|---|---|---|
caseId | Application name | Long | Yes | |
rootVersionId | The root version ID of the case, a value that groups all versions of the case. | Long | Yes | |
typeCode | The case type code. | String | Yes | |
inventoryCode | Generated/unique case code. | String | No | |
subject | Subject of the case created from a formula defined in the code type object. See the description of the [subjectFormula field of the TypeCode entity (/docs/Architecture/Cases_MetaData/#pole-subjectformula). | String | No | Integer in range |
status | Status of the case. | String | Yes | Integer in range |
{
"caseId": 999998,
"rootVersionId": 2337904,
"typeCode": "TerytStreet",
"inventoryCode": null,
"subject": null,
"status": "A"
}
Footnotes
-
Example page allowing for quick date decoding from/to the number of milliseconds: https://currentmillis.com/ ↩