Indexing the Car File

This section illustrates Magnify indexing by feeding the Car file. In this example, multiple rows will be aggregated into a single row, in order to rollup data according to a single dimension to create a more robust, inclusive or higher-level search result. For example, this is the difference between showing a single search result for an entire order or showing a search result for each item purchased in an order.

  1. Open the Car file to review all available data.
    1. In App Studio, create a project pointing to the sample directory, ibisamp, if not already created.
  2. Review the Car file (carmgn.fex)

    Note: This file is installed with the WebFOCUS Reporting Server under the ibisamp application directory.

    1. Right-click the carmgn.fex file and select Open from the context menu, as shown in the following image.

      The Procedure View panel is opened for the carmgn.fex file, as shown in the following image.

    2. Add a Set object before the Report object and set the BYDISPLAY parameter to ON to show repeated BY values, as shown in the following image.
    3. Double-click the Report object in the Procedure View panel to change the Output Format.
      • Click the Format tab.
      • Select the Output Format drop-down.
      • From the Output Format drop-down list, expand Styled report formats and select HTML Active Report (AHTML), as shown in the following image.

        Note: If you are not licensed for Active Technology, select HTML Web Document (HTML) instead. In that case, you will not be able to run the aggregation reports.

      • Click Save and then click Run from the Quick Access Toolbar.
    4. Review the naming conventions and data, as shown in the following image.
      • Review the Record Context.

        Note: Notice how multiple rows in the Car data can be used to describe a single entity based on the rollup level. In this case, there are Countries and Cars. Depending on the use case, each entity can be created as its own search result. This is done by using the highest-level field as the primary BY field. Columns are named accordingly to identify where to aggregate values across multiple rows. For example, aggregating on the COUNTRY field will generate five search results, one for each country. Therefore, separate searches for Jensen and Jaguar will both return England as the search result.

        At another level, the Car data has 18 individual models. However, if users are to search for any model, only a single car type search result would be returned.

        For example, rolling up Model By Car reveals that there are 10 cars. Thus, 6 rows of data found for BMW will be aggregated into a single search result, as shown in the following image.

        aggregated result
      • Close the browser window that is running the report.
  3. Index the Car file.
    1. Double-click the Engine MAGNIFY object in the Procedure View panel.

      The MAGNIFY search engine properties dialog opens, as shown in the following image.

      Review the following properties:

      • DELIMITER. Used internally to separate a list of values generated by the Format Magnify procedure in order to aggregate multiple rows into a single search result. This value should be a unique value not found anywhere in the content that is being indexed.
      • BATCHSIZE. Incremental number of records to feed to Magnify at a time.

        Note: Batchsize is critical when indexing large volumes of data. This setting will process all records but only send feeds to Magnify in the batch size specified, thereby sending data in increments.

      The remaining Engine objects were covered in the Indexing the Movie File.

    2. Double-click the Set object in the Procedure View panel.

      The Set dialog opens, as shown in the following image.

      Note: You must set the ASNAMES setting to MIXED in order to preserve case-sensitivity.

    3. Double-click the Define object in the Procedure View panel.

      The Define dialog opens, as shown in the following image.

      • Review each Define field.
      • Close the Define dialog.
    4. Double-click the Report object in the Procedure View panel.

      Note: The following steps give you hands-on experience in recreating this procedure by starting fresh. This step can be skipped in order to follow along, similar to the hands-off approach in the Indexing the Movie File.

    5. In the Report canvas, delete all the fields by selecting all of them (or using Ctrl+A) and then pressing Delete.
    6. Build the Format Magnify Report.
      • In the Object Inspector, double-click on the field CAR and the field COUNTRY.
      • In the Report canvas, while holding Shift, select both the COUNTRY and CAR columns.
      • On the toolbar, click Sort Down, as shown in the following image.
    7. In the Report canvas, click to the right side of CAR to begin adding more columns to the report.
    8. On the toolbar, click Detail, as shown in the following image.
      • In the Object Inspector, add the remaining columns. These are listed in the following table. After the column is added to the Report canvas, right-click on the column and select Column Title, as shown in the following image.
      • Add Fields and Column Titles for the following:

        Column

        Column Title

        Purpose

        SEARCHTITLE

        SearchTitle

        Format Magnify Reserved Alias Name (case-sensitive)

        SEARCHID

        MagnifyID

        Format Magnify Reserved Alias Name (case-sensitive)

        COUNTRY

        C1_Country

        Category

        BODYTYPE

        M3A_Body_Type

        Multiple Category

        MODEL

        M4A_Model

        Multiple Category

        WARRANTY

        M6A_Warranty

        Multiple Category

        STANDARD

        M5A_Features

        Multiple Category

        MPGRANGE

        M7A_MPG_Rating

        Multiple Category

        COUNTRY

        S_Country

        Searchable Content

        CAR

        S_Car

        Searchable Content

        MODEL

        SA_Model

        Aggregated Searchable Content

        BODYTYPE

        SA_BODYTYPE

        Aggregated Searchable Content

        WARRANTY

        SA_WARRANTY

        Aggregated Searchable Content

        STANDARD

        SA_STANDARD

        Aggregated Searchable Content

        SEARCHID

        WF_INDEX_UNIQUE_KEY

        Magnify Meta Tag

        TITLE_URL

        <not needed>

        Magnify Meta Tag

        LINK_URL1

        <not needed>

        Magnify Meta Tag

        LINK_DISPLAY_NAME1

        <not needed>

        Magnify Meta Tag

        S_HARDCODED

        <not needed>

        Searchable content (last because it is a TX field type)

    9. Click Save and then click Run from the Quick Access Toolbar.

      Note: Each Car will include multiple rows as part of its single search result, thereby searching either Jaguar V12XKE Auto or XJ12L Auto will return the aggregated Jaguar search result, as shown in the following image.

      search result
    10. Close the browser window that is running the report and return to the Report canvas.
    11. Change the Output Format as follows:
      • Click the Format tab.
      • Select the Output Format drop-down.
      • Expand the Unstyled formats menu and select Format Magnify (MAGNIFY), as shown in the following image.
      • Click Save and then click Run from the Quick Access Toolbar.
      • Confirm that there are no errors. Upon execution, the WebFOCUS Reporting Server will process the request by transforming the report output into the Magnify feed protocol.

        Note: Not every row is sent to Magnify. Fifty-one rows are aggregated into 34, as shown in the following image.

        As part of the Magnify output, the 34 records are further aggregated into 10 search results.

      • Close the browser window that is running the report.
      • Close the Procedure View panel.
  4. Review the search-based application generated.
    1. Open a web browser.
    2. Navigate to the Magnify search page:
      http://host:port/wfcontext_root/search

      where:

      host:port

      Is the machine name and port number where WebFOCUS is installed.

      wfcontext_root

      Is the WebFOCUS application root.

      Note: Sample or default URLs are for informational purposes only and may not resolve correctly, if at all.

      To return to the Magnify interface, the default URL is:

      http://localhost:8080/ibi_apps/search
    3. Perform a search test by typing cars in the Search box and clicking Searchas shown in the following image.
      search test
    4. Review the returned results and search to identify how the data has been applied to the Magnify search interface.
    5. Close the browser window.
    6. Close App Studio.

WebFOCUS

Feedback