File Indexing

How to:

This section illustrates how to use the Fixed File adapter to monitor a file directory. This allows you to catalog and track changes in a given directory in order to index the content of files and make it searchable with Magnify.

For more information, see the Magnify Developer’s Guide.

Note: This section includes an embedded file that contains the code for a WebFOCUS procedure. This will be needed to complete the following procedure. The code is also available from the following link:

http://documentation.informationbuilders.com/masterindex/html/zip_wf80/myappmapexample.txt


Top of page

x
Procedure: How to Setup File Indexing

This procedure will copy the Master File description template for the Fixed File adapter to point to a new file repository, index the content of those files, and monitor those directories for any changes.

  1. Create a new application mapping named myappmapexample.
    1. Log on to the Reporting Server console.
    2. Select Applications.
    3. Right-click Application Directories in the left pane, select New, and then Application Directory.

      The Create New Application pane opens.

    4. Select Application Mapping to Disk from the Application Type drop-down menu.
    5. In the Application Name field, enter myappmapexample.
    6. Select a physical location. For this example, use \ibi\apps\ibisamp.

      Note: It is important to note that for file indexing to work, this directory must also be a virtual path. For more information, see the Magnify Security and Administration manual.

    7. Uncheck the Add directory to APPPATH check box.

    8. Click OK.
  2. In the Reporting Server console, create the myfileindexing synonym:
    1. Select Applications if it is not already selected.
    2. From the ibisamp directory, right-click the filtmntr.mas file and select Open.
    3. Click the console icon and select Save As, as shown in the following image.

    4. Use the Save in drop-down menu to navigate to the ibisamp folder.
    5. Save the file as myfileindexing
    6. Expand the Variables folder.
      • Double-click the &&FL_DIRECTORY variable, enter myappmapexample in the Default field, and click Apply. This is the same value as the APP MAP name set in step 1e.
      • Double-click the &&FL_POLLING variable, enter '1' in the Values field, and click Apply.
      • Double-click the &&FL_TIMEOUT variable, enter '2' in the Values field, and click Apply.
    7. Save and close the Master File.
  3. In the Reporting Server console, create the file indexing procedure:
    1. Right-click the ibisamp folder and select New, then Procedure.
    2. Paste in the code in the attached file.

      Note:

      • You may have to change the CONNECTION_ATTRIBUTES and BASEURL accordingly.
      • You may need to change the ROOT_DOS_PATH and ROOT_WEB_PATH DEFINE fields to accommodate the known base system and virtual path of the files being evaluated.
      • This file will read a directory's file list and pass it to this procedure where the file system path is replaced by its URL path.
      • Magnify will use the URL to access the file via HTTP protocol and index the content found.

    3. Save the procedure as myfileindexing.
  4. Add a new index to the collections_myexample.xml file. For more information, see How to Add Indexes to the Collections Drop-down Menu and How to Create a Customized Collection Configuration.
  5. Navigate to the search page and validate the changes and files indexed by searching for File Repository.
    http://localhost:8080/ibi_apps/search?proxyreload=1&clearcache=1
    &collections=collections_myexample.xml

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

A sample of the results are shown in the following image.


WebFOCUS