Tutorial: Add Suggest on the Name Field

In this tutorial, we want to add suggest based on the name field from our sample sales database, so that when a user starts entering sl, we automatically suggest sleeveless shirt, sleeve shirt, and slim shorts.

For that, we need to build a suggest dictionary based on the content of the sales_name index field (see the Data Model > Advanced Schema tab for a listing of all index fields), and set up the Mashup UI to use this suggest data.

For more information, see Adding Search Suggestions in the Exalead CloudView Configuration Guide.

This task shows you how to:

Build a Suggest Dictionary

  1. In the Administration Console, select Search > Suggest.
  2. Click Add suggest:
    1. For Name, type, for example, name_suggest.
    2. For Type, select Index field suggest.
    3. Click Accept.
  3. In the configuration options for this new suggest, click in the Index field and select sales_name from the list.
  4. We want to find matches not only for the first word of the name value, but for each word:
    1. Expand Build options.
    2. Select Subexpr matching.
  5. Click Apply.

    Now that you have declared the suggest, you must precompile data for efficient lookup.

  6. Under Suggest status, click Build now.

Now, we need to add the suggest to the Mashup UI.

Add the Suggest to the Mashup UI

  1. In Mashup Builder, go to a page using a search form widget. For example, the /index page, which uses the Standard Search Form widget.
  2. Click the widget header to display its properties panel.
  3. On the Suggest tab, complete the following:
    1. Select Enable suggest.
    2. For Suggest Name, click inside the field.
    3. From the dynamic list that displays on the left, select the suggest service.

    Note:

    If you do not see the suggest you just created, refresh the list.

  4. Repeat these steps for the /search page.
  5. Click Apply.

Test the Suggest in the Mashup UI

  1. Go to the Mashup UI, and refresh the search page.
  2. Start entering sl in the Search box.

    The search box suggests all the available values that start with sl.

    Note: If you do not see the following suggestions, empty your browser cache.