Searching the country data

Flow showing how to perfrom a country specific search

Call GetInputWithSearch

If you do not know whether you can perform an indexed search for the country, and if so, what categories exist for the country, call GetInputWithSearch, supplying the relevant country code.

If any categories are returned, this country supports indexed searches.

Save categories

If categories were returned, you should save the returned categories so that you can use them to help your user specify the search expression.

Get the search criteria - non-indexed search

For countries that have non-indexed searches, you enter up to 3 terms. This search finds records that match ALL of the terms. Typically, if you include more items in the search, fewer matches will be found. This search brings back the first 100 records that match the entered terms.

The search is case insensitive and spaces cannot be included within the terms. For example, "Paris Vichy" is treated as 2 terms and finds all records that contain [Paris, PARIS, or paris] AND [Vichy, VICHY or vichy].

Get the search criteria - indexed search

For countries that support an indexed search, you specify the categories that are searched as well as the information to search for. For example to search the Branch fields for Central, you enter "Branch:Central". If you do not specify a category, all of the data is searched.

When you include multiple terms in the search, records that match ANY of the terms are returned. However the records that match more of the terms are prioritised. This search returns all of the records that match the entered terms.

Call BranchSearch

To perform the search, call the BranchSearch service supplying:

  • country - the 2 character code of the country you want to search
  • the search criteria
  • page - which page of results you want to retrieve
  • pageSize - the number of results you want retrieved
  • header details - reportString and itemisationId.

Get the response

To find out the result of the search, you need to retrieve the search response. This always shows whether a new search token has been generated and the size of the results.

If the search was successful, it also includes an array of the results, with a data access key for each record.

Are there any errors?

Errors are returned if you have not supplied the correct data within the search request. If you receive any errors, you should re-prompt for the missing or incorrect information and then call the search service again.

Has a new search token been returned?

If NewToken is set to true, this search has generated a new search token. You should cache this so that you can use it to retrieve any further pages of results for this search.

Display the results

Depending on your business requirements, you could display a summary or all of the branch information returned for each match.

You should never display the search token to the user.

Do you want to retrieve data?

For each match, you can retrieve the more detailed information using the standard data retrieval services and the data access key returned as part of the search results.

Are there any more results?

Depending on your page size and the number of matches, you may need to call the service again to retrieve the remaining matches. To do this, increment the pageNumber and supply the search token instead of the search expression.