Global Search
In the initial phase of implementation, following entities are scoped for global search.
- Clients
- Loans
- Groups
The user authentication narrows down the access scope to a hierarchy to which user belongs to. (do we need to restrict search on user access or display all the results?)
The search is carried on scoped entities in the following order.
- Clients Search: The request parameter is matched against
- Display name (m_client.display_name) – partial or exact match
- Account Number (m_client.account_no) – exact match
- External Id (m_client.external_id) – exact match
- Loan Search: The request parameter is matched against
- Account Number (m_loan.account_no) – exact match
- Account Number (m_loan.account_no) – exact match
- Group Search: The request parameter is matched against
- Group Name (m_group.name) – partial or exact match
- External Id (m_group.external_id) – exact match
The search results will be listed in following order,
- List exact match results,
- Matching Clients and Loans,
- Matching Groups.
Request
HTTP Request
/search?query=searchstring
Parameters
Parameter | Value | Description |
Required Parameters | ||
query | string | Specify a query string for partial or exact match of clients, loans and groups |
Option Parameters | ||
maxResults | Unassigned integer | Right now not supported. (TBD for later implementation) |
pageToken | string | Right now not supported. (TBD for later implementation). This will be used for pagination of large set of results. |
Response
If successful, this method returns a response body with the following structure:
{
"entitytype":"CLIENT",
"id":1,
"name":"display name",
"accountNo":"000000001"
"loanofficer":"FirstName LastName",
"hierarchy":{
"id":2,
"name":"display name"
"hierarchy":{
"id":3,
"name":"display name",
}
},
"activeLoanCount": 1,
"openLoans": [
{
"id": 1,
"accountNo": "000000001",
"productId": 1,
"productName": "A new loan product for me",
"status": {
"id": 300,
"code": "loanStatusType.active",
"value": "Active"
}
}
]
}
Out of Scope:
As part of global search, search scope to resource level is not included.
At later stage we can think of adding search scope at resource level like,
/search?resource=client?displayName=joe
Or
/clients?displayName=joe?officeId=2
In these kind of search we need to come up with a search template for each of the scoped resource.