Configuring Real-Time Indexing

Any search definition with the source type of query, connected query, and activity guide can be configured for real-time indexing.

Search Framework supports real-time indexing through SQL triggers and uses set based processing.

Important! Oracle does not deliver search definitions enabled for real-time indexing automatically. Therefore, you should enable search definitions for real-time indexing based on your business requirements. In addition, some search definitions need to be certified before being turned on. See the Application Fundamentals Online Help <for your product> for more information.

Oracle delivers two search definitions, PTSF_RECENTMENU and PTSF_RECENT_KW, for providing suggestions in search that are configured for real-time indexing, but you have to enable real-time indexing for these two search definitions.

See Working with Suggestions Search.

Before you can begin configuring real-time indexing for a search definition, you should configure the following elements or verify that these elements are set correctly:

  • Set the Real Time Indexing property in Quick Configure Menu.

  • Configure PSRTISRV server process.

  • Create an application class for any preprocessing or post processing.

    Application class may be provided by PeopleSoft for any delivered indexes.

Note: Real-time indexing can be enabled on search definitions with trigger records up to 16 key fields.

Setting the Real Time Indexing Parameter in PSADMIN Quick Configure Menu

You should set the Real Time Indexing parameter on the Process Scheduler domain.

To set the Real Time Indexing parameter:

  1. Run PSADMIN and choose the Process Scheduler domain.

  2. Select 4) Configure this domain.

    To configure the domain, the domain needs to be shut down.

  3. Enter y to the question: Do you want to continue (y/n).

  4. Toggle 6) Real Time Indexing to set it to Yes.

  5. Select 7) Load config as shown.

  6. Restart the domain.

Configuring the PSRTISRV Server Process

The real-time indexing server process, PSRTISRV, starts when the Process Scheduler domain is booted up. The number of RTI server processes can be configured in the Process Scheduler section of the configuration file (psprcs.cfg). The default is set to 1 instance.

See PSRTISRV Section

You should configure the following RTI server process parameters on the Search Options page (select PeopleTools > Search Framework > Search Admin Activity Guide, from the left panel choose Administration, and then choose Search Options):

  • Index Refresh Interval

  • Heartbeat Interval

  • Real Time Indexing Set Size

  • Real Time Indexing Threshold

For description of these parameters, see Managing General Search Options.

Creating an Application Class

For full or incremental indexing of a search definition, any preprocessing is performed by an Application Engine program. In the real-time indexing process, you should define an application class to perform preprocessing and post processing. The application class should extend the PTRTIPKG:PTRTI application class. The PTRTI class contains the Process and PostProcess methods, and you should extend these methods with your application class to perform preprocessing and post processing tasks respectively.

See PTRTI Class.

To ensure that the real-time indexing process runs smoothly, PeopleSoft suggests the following sequence of steps.

  1. On the Configure Real Time Indexing page,

    1. Select the Enable Real Time Indexing check box.

    2. Verify that the metadata is populated correctly and ensure that you specify the required trigger records.

    3. Save the real-time indexing configuration.

    4. Create the trigger.

  2. Run incremental index for the search index for data synchronization. Perform this step to index records that were added before real-time indexing was initialized.

The selected search definition is now configured for real-time indexing. When data is inserted, modified, or deleted in the database for the search index, a SQL trigger runs to initiate real-time indexing of data in the search engine.

Note: Search definitions with queries using set operators like UNION, INTERSECTION etc. are not supported for real-time indexing. Real-time indexing requires equivalent queries without set operators.

Use the Configure Real Time Indexing page to enable real-time indexing for a specific search definition and to specify any additional information required for real-time indexing of the search definition.

Access the Configure Real Time Indexing page by selecting PeopleTools > Search Framework > Real Time Indexing > Configure Real Time Indexing.

The search page displays search definitions with the source type as query, connected query, and activity guide from the default search instance. The search page also provides a comprehensive view of the deploy status retrieved from the Deploy Search Definition page, and the real-time indexing configuration status of the search definitions, enabling you to take the necessary action on a search definition.

Select a search definition to display the real-time indexing information. The search definition metadata is imported including security and attachment configurations.

This example illustrates the fields and controls on the Configure Real Time Indexing page. You can find definitions for the fields and controls later on this page.

Configure Real Time Indexing page

Field or Control

Description

Enable Real Time Indexing

Select the check box to enable real-time indexing for the search definition.

Configure Batch

Select the check box to configure batch programs, with a specific Process Type and Process Name, from an available list of batch programs.

This field is not available for activity guide search definitions.

See Turning Off Real-Time Indexing During Batch Processing.

Trigger SQL

After reviewing or modifying the search definition, you should save the search index. The Trigger SQL link appears only when you select Save on the page. Then, you should create a trigger. A trigger record is generated at runtime. Contact your database administrator to implement triggers on the database.

Note: PeopleSoft RTI trigger names have the prefix SFA and suffix TR. For example, SFA_PT_PORTAL_MRU_TR.

Any of the following ways can be used to create a trigger:

  • Select the Trigger SQL link to download the .sql files for the supported database platforms. Run the downloaded trigger SQL in a SQL tool to create triggers.

  • Open the trigger record in Application Designer, and build the record using the Create Trigger option.

  • Run the Datamover command: CREATE_TRIGGER <recordname>, where recordname is the trigger record.

This field is not available for activity guide search definitions.

For more information on trigger records, see the section on Trigger Records later in this topic.

Reload

The Reload link appears only when you select Save on the page.

If a search definition is updated after configuring it for real-time indexing, you should use the Reload link to import the updates to real-time indexing.

Note: After completing the reload action, ensure that you save the real-time indexing configuration, and then restart the Process Scheduler domain.

Warning! The reload operation may clear the existing configurations for application class and trigger records. You may have to redo these configurations after clicking the Reload link.

Data Source

Field or Control

Description

Query/Connected Query or Activity Guide

The system automatically selects Query/Connected Query or Activity Guide as data source for those search definitions that are based on query, connected query, and activity guide.

Application Class

The system automatically selects Query/Connected Query or Activity Guide and Application Class as data sources for those search definitions that contain preprocessing or post processing Application Engine program.

When both Query/Connected Query or Activity Guide and Application Class are auto populated as data sources, the real-time indexing process runs the application class method first and then runs SQL query. If query uses a temporary table, the application class method should insert the data to the temporary table.

You can choose to use only the application class as the data source rather than Query/Connected Query or Activity Guide. In this case, the application class methods perform the necessary preprocessing or post processing and also set the values for all search attributes of each search document to index. The real-time indexing process then creates the JSON document and uses the Direct Transfer technology to index the data.

See PTRTI Class.

Data Generator Application Class

The Data Generator Application Class section is displayed when application class is selected as the data source.

Field or Control

Description

Package Name

Specifies the root package where the application class is created.

You should ensure that the extended application class exists in the database.

Path

Species the path, represented by a colon (:).

Class ID

Choose the relevant application class.

Process

Set the Process option to Yes if you want to perform any validation or preprocessing and to defer or discard processing.

When you set this option to Yes, you should extend the Process method of the delivered application package PTRTIPKG:PTRTI.

PTRTI Class Methods

Post Process

Set the Post Process option to Yes if you want to perform any validation or post processing.

When you set this option to Yes, you should extend the PostProcess method of the delivered application package PTRTIPKG:PTRTI.

This field is not available for activity guide search definitions.

PTRTI Class Methods

General

Search definition metadata is imported and displayed in the Title, Summary, URL, and Last Update Date Time fields.

You cannot edit these fields.

Trigger Records

A trigger record is necessary for real-time indexing. Therefore, you must ensure that the Record field contains a trigger record. When a search definition is based on Query or Connected Query, the system checks the query to try and determine the best trigger record and pre-populates the value for you.

The keys of the trigger record (transaction record) should exist in the primary record of the parent query. If trigger records are pre populated, you should retain these trigger records. You should add a trigger record only if no trigger record is given.

Optionally, you can add more trigger records but doing so will affect the performance. Also, keeping triggers on child records may cause undesired data insertions to the real-time indexing staging table, which may increase the processing time.

Note: Trigger Records is not available for activity guide search definitions. Only activity guide meta data tables, which include Action Item, Activity Guide Instance, and Context Data Table, trigger real-time indexing.

Field or Control

Description

Record

The Record field is pre populated based on the parent record used in Query/Connected Query of the search definition where the Last Modified Date Time is configured. If it is a view, the first record used in that view is auto selected as transaction record to create a trigger. However, you can change it to any other record in that view.

The real-time indexing process recognizes a transaction only when the trigger record inserts a row for the transaction. Hence, the trigger record should be decided based on this condition. Adding multiple trigger records can cause the same data to be processed multiple times to the search engine.

Temp Table

Select this check box if the search definition’s Last Modified Date Time field is using a temporary table.

Note: Temp Table and Transaction Record or Record fields are displayed for search definitions that have data source as Application Class.

Transaction Record

Transaction Record field is used only when the Record field contains a view or a temporary table.

Attachments

If a search definition contains attachments, the Include Attachments check box is displayed.

Field or Control

Description

Include Attachments

Use this check box to either include attachments or exclude attachments from real-time indexing.

If a search definition contains attachments, it is ideal to include attachments in real-time indexing. However, if you observe that attachments are causing delay in real-time indexing, you can choose to exclude attachments. In this case, you can use incremental indexing because in incremental indexing attachments are also indexed.

If an index does not contain attachments, the Include Attachments check box is not displayed.

Search Attributes

The Search Attributes section displays metadata imported from the search definition, and it cannot be edited here.

Application developers can use this mapping from the search definition page to know what attributes should be loaded in the application class.

While processing high volume batch updates for search definitions, real-time indexing can cause a sudden increase in the number of entries to process in the real-time indexing staging table. This can, in turn, cause the database table fragmentation to increase and eventually slow down the performance. Therefore, for large volume batch updates, it is recommended that real-time indexing be temporarily suspended and changes to the search index be updated through incremental indexing.

Note: When real-time indexing is off, the staging table will not receive any data for both online and batch programs.

After the batch programs are completed, incremental indexing for a search definition will take place at the scheduled time. When incremental indexing starts, real-time indexing is automatically enabled for the search definition.

Enabling Batch on Real Time Indexing

Use the Configure Batch option on the Configure Real Time Indexing page to enable a batch program.

When you select the Configure Batch option for a search definition, you can access a list of batch programs, delivered by Applications for the search definition, that can cause high volume updates to the trigger records. You can choose additional batch programs from the drop-down, but these must be coded to use the batch switch. Oracle does not recommend adding batches other than the ones delivered for the search definition.

Select batch programs by process type and process name to turn off real-time indexing for them.

Oracle delivers functions that application developers can use to programmatically turn off real-time indexing and set the document count value. However, these functions can only be used with Application Engine programs. See TurnOffRTI.

Programs using SQL or COBOL need to perform a direct SQL execution to turn off real-time indexing.

Following is an example to turn off real-time indexing in COBOL and SQR:

MERGE INTO PS_PTSF_RTI_STATUS d 
USING(SELECT :1 PTSF_INDEX_NAME from dual) 
ON(d.PTSF_INDEX_NAME = s.PTSF_INDEX_NAME) 
WHEN MATCHED THEN UPDATE SET d.PTRTISTATUS = 0 
WHEN NOT MATCHED THEN INSERT VALUES(:1, 0)));

This example illustrates the fields and controls on the Configure Real Time Indexing page with the Configure Batch option selected:

Configure Real Time Indexing page with Configure Batch option

Field or Control

Description

Document Count

The document count is a threshold beyond which the real-time indexing process should be disabled during batch runs. Large batch jobs with records beyond this count should have real-time indexing disabled.

The default is set to 0. 0 means real-time indexing is not turned off.

Note: This count will be used by application developers as a deciding factor to invoke the TurnOffRTI function. Applications will look for a number greater than 0 to compare to the record count for batch jobs to determine whether or not to disable real-time indexing.

Process Type

Select the process type.

Process Name

Select the process name.

Honor Batch Switch

Set the Honor Batch Switch option to Yes if you want the Real Time Indexing Switch to honor the process (batch program). When the Honor Batch Switch option is set to No, the request to turn off real-time indexing for the batch program will be ignored.

Note: Applications will deliver the configuration with the Honor Batch Switch turned off. You must turn it to Yes if you have large batch runs and you must also set the Document Count.

Using the Real Time Indexing Switch Page

The Real Time indexing Switch page displays the current real-time indexing status of the listed search definitions. Administrators can use this page to check the real-time indexing status and turn it on or off only in scenarios where real-time indexing was not automatically turned on or off. Oracle recommends that administrators exercise caution before turning real-time indexing on or off on this page.

This example illustrates the fields and controls on the Real Time Indexing Switch page:

Real Time Indexing Switch page

Real-time indexing uses a staging table to store the keys of the application transactions to be indexed in the search engine. The transaction data is removed from the staging table as soon as the transaction is indexed. Based on the number of search definitions enabled for real-time indexing and the volume of transactions (online or batch), frequent data inserts and deletes take place in the staging table. This can eventually cause table fragmentation and over a period of time the performance of real-time indexing may slow down due to the fragmentation as compared to the initial performance. Periodic maintenance of the staging table will restore the performance of the real-time indexing process.

PeopleSoft provides an AE program, named PTRTI_TRUNC, which performs the maintenance activities on the staging table based on the value you set for the Real Time Indexing Threshold property on the Search Options page. The program obtains a lock on the staging table, backs up the data, and then truncates the table. After a successful truncate action, the backed-up data is copied to the staging table. The successful run of the program depends on the activities on the staging table, that is, while locking and truncating the table, data insert should not take place on the table. If data insert takes place on the table after the lock on the table is obtained,the table is automatically unlocked to avoid any data loss. Therefore, the AE maintenance program should be run when no transactions are being inserted, deleted, or modified on the table.

For example, an administrator can plan to run the AE maintenance program after the successful completion of the application batch update. An administrator can schedule the AE program as a recurring job at regular intervals and the job, on each iteration, performs the maintenance activity based on the availability of the table lock. However, you should note that the AE program only performs the table truncate activity if the table crosses the Real Time Indexing Threshold value specified on the Search options page. The real-time indexing process keeps track of the maximum count of the staging table rows and if the row count crosses the threshold value, the AE maintenance program is run. If the row count does not cross the threshold value, the AE program exits from the current run without proceeding for lock and truncate actions.