Adding a “Last Updated” Field to Records
The application data to be indexed must exist in a record containing a column that tracks the update history of the data. This column is referred to as the "Last Updated" field. The Last Updated field is a datetime field that captures when the set of data to be indexed has been changed. Keeping track of the data updates is critical for enabling incremental indexing. Rather than recreating the entire index each time the index needs to be updated, incremental indexing enables the system to gather only the information that has changed since the last time the index generation process has run.
The system keeps track of when the index generation process last ran, and compares that time to the Last Updated field value in the underlying record structure. Based on the comparison between those time values, the system can isolate only the data that has undergone a change since the last index generation process run. Once the system creates the initial full index, only those rows that have been updated or added since the last index process run will be collected and added to the existing index. Using incremental index updates improves performance and decreases system overhead.
If the query being used for the search definition only runs against a single record, then that record must contain a datetime field to capture data update date and time values. If the data exists within a hierarchy of tables (grand parent, parent, and child, for example), only one of the records within the hierarchy requires the existence of the datetime field.
Important:
The Last Updated field must be of the type datetime. An example of this field is the LASTUPDTTM field, which can be found in many delivered PeopleSoft applications. Whether you intend to implement an incremental indexing system or not, it is still a requirement to have a "last updated“ field within the record.
Note:
Many PeopleSoft application tables come with a LASTUPDTTM field in place, especially those for which the application has provided search definitions. For any custom tables or tables that do not already track date and time updates, you need to ensure the field exists in the record or record hierarchy.
Note:
For any search definitions delivered with your PeopleSoft applications, the underlying records will be configured to include the required datetime field as well as the program logic to ensure that the value of the datetime field is collected. For any custom applications, you will need to add the datetime field manually, alter the underlying SQL table, and include program logic to ensure the value of the datetime field is collected and updated accurately. For example, using SavePreChange PeopleCode you can test IsComponentChanged and if so, then update the LASTUPDTTM field accordingly.