Add a denormalized address field to search

Adding a denormalized field to search can improve the speed of searching.

About this task

If you want to search on a denormalized address field, add fields to the Address entity and the ABContact entity to give ContactManager an actual field to search for. On the ContactManager side, the field you set up for search is the field you add to ABContact. On the core application side, the field you search for is the Address field, as it would be for a regular, non-denormalized Address field search. The following steps show what you do differently for denormalized Address searches:

Procedure

  1. Add a column for the denormalized field to the Address entity and set SupportsLinguisticSearch to true.
  2. Add a searchColumn to the ABContact entity that has the same name as the column added to Address, plus Denorm.
    For example, if the Address column is named County, the ABContact column is named CountyDenorm. The sourceColumn is the same as the name for this search column, such as CountyDenorm, and the sourceForeignKey is PrimaryAddress.
  3. The next steps are similar to those starting at Add search support to the ContactManager user interface. In general, for the ContactManager part of the process, use the ABContact search column as your field.
    For example:
    1. Add a column to ABContactSearchCriteria.etx, using the name of the ABContact search column.
    2. Add to search-config.xml a <Criterion> for the column you just added to ABContactSearchCriteria.etx. Add it to the following <CriteriaDef> for ABContact:
      <CriteriaDef entity="ABContactSearchCriteria" targetEntity="ABContact">

      The new criterion must use the name of the column in ABContactSearchCriteria.etx and can have any match type you prefer.

  4. The next steps are similar to those starting at Add search support in ContactManager for Guidewire core applications. In general, for the ContactManager part of the process, use the ABContact search column as your field.
    For example:
    1. Add an entry for your ABContact search field to the class ABContactAPISearchCriteria.
    2. If you want the field to be added to the search results sent back to a Guidewire core application, add the ABContact search field to the class ABContactAPISearchResult.
  5. Refresh the web services. See Restart ContactManager and refresh web services in ClaimCenter.
  6. Go through the steps for the ClaimCenter part of the configuration, but use the Address field you want to have in search. This part of the configuration starts at Add ContactManager search capability in ClaimCenter.
    1. The entity ContactSearchCriteria.etx has a foreign key to Address, so any field on Address can be used in contact search, and there is no need to update this file.
    2. Add an entry for the Address field to ContactSearchMapper in the following if statement after the first line of code in that statement:
          if (searchCriteria.Address != null) {
            var address = new ABContactAPIAddressSearch()
      For example, for Address.County, add the following new line of code:
      address.County = searchCriteria.Address.County
    3. The class ContactSearchResultMapper has a lot of the Address fields already in it. Check to see if a field you want to make visible for the address part of search might already be in the file. If you add a new field to Address that you want to search for, you must add an entry for the new Address field to this file.
  7. Continue with the user interface configuration instructions, but use them as only a guideline for adding Address fields and do not follow them exactly. Address fields are located in different parts of the screens from Contact and ABContact fields. See Configure the address book search interface in ContactManager.