Deleting Records From the Index

How to:

As part of the Format Magnify indexing process, each search result is assigned a unique ID by the value assigned to the WF_INDEX_UNIQUE_KEY Magnify Meta tag. If no record in the index exists for the value assigned to WF_INDEX_UNIQUE_KEY, Magnify will add the record to the index library. Otherwise, Magnify will update the record, essentially overwriting the previous entry. The WF_INDEX_UNIQUE_KEY value can also be used to locate a search result in order to remove it from the index library. A deletion action can be defined at the procedure or global level to apply to all records, or on a record-by-record level.

Note: If the Magnify action is not defined, it defaults to the add action. That is why this is typically not required.

The Magnify action can be set at two levels, the feed level and the record level. The record-level value, if present, will always override the global-level value set for the overall Format Magnify procedure.


Top of page

x
Procedure: How to Set Feed- and Record-Level Actions

This procedure will illustrate how to set the action for the entire feed, while at the same time overwriting the feed-level action by setting the record-level action for only a specific set of records. Once complete, those records with the value ENGLAND will be updated in the index library while all other records are removed.

  1. Launch Developer Studio.
  2. Edit the carmgn procedure in the Procedure Viewer.

    For information of where to locate the carmgn procedure, see Aggregated Indexing: The Car File.

  3. Add a new ENGINE object.
    1. Enter MAGNIFY in the Engine field.
    2. Set -- no connection -- as the Connection.
    3. Enter ACTION=DELETE in the SET parameters field.
    4. Click Test (no errors) and OK.
  4. Create a new DEFINE named MagnifyAction (case-sensitive).
    1. Use a format of A10.
    2. Use the following expression.
      IF CAR.ORIGIN.COUNTRY EQ 'ENGLAND' THEN 'add' ELSE ''
    3. Click Check (no errors) and then OK.
  5. Open the Define object and change the value of LINK_DISPLAY_NAME1 to My Car Graph.
  6. Add MagnifyAction to the Report Painter canvas as a PRINT field toward the end of the report, anywhere between SearchTitle and S_HARDCODED.

    Note: S_HARDCODED must be the last PRINT field because it is a TX field.

  7. Save and Run the procedure.
  8. Verify that records have been removed from search.
    1. Navigate to the search page.
      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.

      For more information, see How to View the Changes Made Using a URL Request.

    2. Select Cars from the collection drop-down menu and search for cars.

      Notice only the two records for England still exist and no other records are found, as shown in the following image.

      Note: It can take a minute or two to refresh.

    3. Close the browser and Developer Studio.

WebFOCUS