Global Search

In the initial phase of implementation, following entities are scoped for global search.

  1. Clients
  2. Loans
  3. 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.

  1. Clients Search: The request parameter is matched against
    1. Display name (m_client.display_name) – partial or exact match
    2. Account Number (m_client.account_no) – exact match
    3. External Id (m_client.external_id) – exact match

  2.  Loan Search: The request parameter is matched against
    1. Account Number (m_loan.account_no) – exact match

  3.  Group Search:  The request parameter is matched against
    1. Group Name (m_group.name) – partial or exact match
    2. External Id (m_group.external_id) – exact match

The search results will be listed in following order,

  1. List exact match results,
  2. Matching Clients and Loans,
  3. 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.