Product DocsMenu

Coveo Platform 6.5 >
Administrator Help > Connectors > Database Connector > Enabling Live Indexing on a Source

Enabling Live Indexing on a Database Source

Live indexing keeps documents up-to-date by scanning repositories and re-indexing modified documents at short intervals. To enable this feature on a source, database items that have to be indexed, such as tables or views, must contain a Date type field to indicate their latest modification date. Fields can be given any name as long as it has the right data type. Furthermore, whenever a record is modified, it is important to update the latest modification date field (see Configuring and Indexing a Database Source and Additional XML Attributes).

To enable live indexing

In the SQL query, the SELECT statement must have a WHERE clause with a criterion on the last modification date field.

Example:
WHERE ITEM.LAST_MODIFICATION_DATE_FIELD >= ?

The question mark operator (?) is used to pass a parameter to the SQL query. The Database connector automatically replaces it with the last refresh date of the current database item.

In the case of MSSQL/SQLServer databases (SqlClient driver type), replace the question mark operator (?) by @LastRefresh.

Example:
WHERE ITEM.LAST_MODIFICATION_DATE_FIELD >= @LastRefresh