1.3.5.8.3.9.  Updates of ERP search index

The AppServer is aware of all database changes so that it can react automatically to project changes and/or role changes with updates to the LinkDB search index or client notifications.

If the option Catalogs and search via AppServer [Catalog browsing and search with AppServer] is selected (i.e. not Catalogs, search and database via AppServer [Catalog browsing, search and database with AppServer] ), automatic updates of the LinkDB search index [LinkDB search index] will still work. This is possible because you can configure a "task" on the AppServer that regularly updates the LinkDB search index [LinkDB search index] (with the information from the LOGTABLE).

An older concept (up to V9.08) uses the script nightupdate_erp.vbb for index updates. This ensures that the ERPTABLE is included in the full-text search index (=Lucene index). (Can optionally also be used in V10/11.) (Details can be found in the script itself.) The advantage of the AppServer solution is that only those parts of the ERP search index in which data has changed are updated. Unless there is something to the contrary in special cases, the nightupdate_erp.vbb process is no longer required in V10/11.

Task calls

  • DBSearchIndexTask:

    • Task interval for updating the ERP search index. The Task checks the LOGTABLE whether there are new entries available. If yes, the ERP search index is updated

    • If the value is set, then after a catalog update the search index is automatically updated.

      If you do not want the search index to be updated automatically, but want to initiate it manually after an update, proceed as follows:

      1. Remove the value "DBSearchIndexTask" from the key "Tasks".

      2. plinkcommon.cfg -> Key UPDATESEARCHINDEX

        Set the value on 1.

        -> Now, when starting the catalog update a message is displayed, whether you want the ERP search index to be updated automatically after the installation.

        Do you want to update the ERP search indexes automatically after installation?

        Do you want to update the ERP search indexes automatically after installation?

      On this also see Section 4.16.7, “ Update full-text search index after LinkDB changes / plinkcommon.cfg -> Block [Common] -> Key "UPDATESEARCHINDEX" ”.

  • DBClearLogTask: Interval at which the task for cleaning up the LOGTABLE is started. This task deletes old entries from the LOGTABLE.

Detailed information can be found in the following section.

1.3.5.8.3.9.1.  Logging of LinkDB changes

INSERTS, DELETES and manual UPDATES (by PARTlinkManager or PARTdataManager) are automatically logged in the table LOGTABLE.

Structure of LOGTABLE

LOGID VARCHAR(40) NOT NULL,
TABNAME VARCHAR(15) NOT NULL,
KEYFLD VARCHAR(15) NOT NULL,
LOGKEY VARCHAR(500) NOT NULL,
LOGEXT VARCHAR(64),
LOGTIME VARCHAR(20) NOT NULL,
USERNAME NVARCHAR(20),
HOSTNAME NVARCHAR(20),
PROGNAME VARCHAR(15),
MODTYPE SMALLINT DEFAULT 0 NOT NULL,
UPDSEARCH SMALLINT DEFAULT 0 NOT NULL,

The table can be viewed via PARTlinkManager -> Extras menu -> Database -> Edit additional tables.

If in plinkcommon.cfg under ADDITIONALTABLES the entry LOGTABLE has been set it is displayed here.

If in plinkcommon.cfg under ADDITIONALTABLES the entry LOGTABLE has been set it is displayed here.

Meaning of single LOGTABLE columns

  • LOGID: LOGID is a unique number (GUID)

  • TABNAME: Table where the changes are saved (ERPTABLE or LINKTABLE).

  • KEYFLD:

    • For ERPTABLE this is always ERP_PDM_NUMBER and LOGKEY contains the ERP number.

    • For LINKTABLE this is always PRJ_PATH and LOGKEY contains the path.

  • LOGEXT: Additional information, for LinkDB changes this is the version and row ID.

  • LOGTIME: Time of the change (in UTC)

  • USERNAME: Login name of the user who made the change.

  • HOSTNAME: Computer name of the client

  • PROGNAME: Program where the changes were made.

  • MODTYPE: Modification type

    Value range:

    • 1: Insert (dataset has been added)

    • 2: Update (dataset has been changed)

    • 3: Delete (dataset has been deleted)

    • 4: Installation (updates during cip installation)

  • UPDSEARCH: If UPDSEARCH has the value 1, the ERP search index should be updated. Is reset to 0 by the AppServer after it has been updated.

To ensure that the task is actually executed, the following settings must be made in the configuration file pappserver.cfg.

Example:

[TaskManagerModule]
TimerInterval=60 
tasks=loadAll 
DBSearchIndexTask=1h
DBClearLogTask=24h

[DBClearLogTask] 
DaysToKeep=365

  • TimerInterval: Specifies the interval (seconds) at which the system should check whether a new task is due for execution. (Normally not to be changed)

  • tasks:

    Value range:

    • loadAll: All TaskModules should be loaded when the AppServer is started. There are currently only two (DBSearchIndexTask and DBClearLogTask)

  • DBSearchIndexTask: Interval at which the task for updating the ERP search index is started. It then checks in the LOGTABLE whether new entries are available. If so, the ERP index is updated.

  • DBClearLogTask: Interval at which the task for cleaning up the LOGTABLE is started. This task deletes old entries from the LOGTABLE.

    Possible date formats:

    1mTask is executed every minute
    1hTask is executed every hour
    13:21zTask is executed every day at 13:21 GMT
    mon 14:30Task is executed every Monday at 14:30 (locale time)

  • DaysToKeep: Number of days in which the entries are saved in the LOGTABLE.

[Note]Note

The timing of the interaction with nightupdate.vbb (updating the ERPTABLE) must be taken into account.

1.3.5.8.3.9.2. Manual update and initial creation of LinkDB search index



[15] Exact time depends on the environment (network, processor, disk, etc.).