Document Selection Criteria

When indexing, the indexing applications need to be able to determine which Dovetail CRM entities should be indexed.


The following document selection criteria is used for Solutions.

<documentSelectionCriteria><![CDATA[creation_time > ${lastIndexUpdate} OR modify_stmp > ${lastIndexUpdate}]]></documentSelectionCriteria>

The specification's document selection criteria roughly translates into the following SQL query:

SELECT id_number from table_probdesc WHERE creation_time > ${lastIndexUpdate} OR modify_stmp > ${lastIndexUpdate}

It is possible to add additional constraints to the criteria. For example, if you want to make sure you only index public solutions, you could add the following constraints:

<documentSelectionCriteria><![CDATA[public_ind=1 AND (creation_time > ${lastIndexUpdate} OR modify_stmp > ${lastIndexUpdate})]]></documentSelectionCriteria>

Last Index Update - (since we last met)

Dovetail Seeker indexing applications remember when it last indexed each document specification. When the ${lastIndexUpdate} symbol is placed in the document selection criteria, that symbol is replaced with the date that the document specification was last updated.

If a given document specification has not been indexed before, the value 'January 1st 1753' is used. This value should be used to filter out entities that do not need indexing, which will speed up indexing greatly. When indexing does not take very long, you can run one of the indexing applications more frequently which will keep your indexes more up-to-date.

Nullable Criteria Fields

Be aware that when using criteria against database fields which have nullable values that in the examples above records with null values will not be included in the indexer. The recommended way to correct this situation would be to put a date into the row's value rather than NULL.

Criteria Fields With Future Dates

Be aware that Dovetail CRM entities whose criteria fields have values whose timestamp is in the future will trigger an index update with every run of the indexer. To avoid this your should correct the rows with futuristic values to have more realistic values.

Performance - Database Indexes

When you are first indexing a Dovetail Document Specification which is working against a table with a large population and you do not have database indexes on fields used in the document selection criteria, the document selection process could take a long time.

To improve performance we recommend adding database indexes to the database fields used in the document selection criteria.

Important Security Consideration

We recommend that the database dovetail user credentials used to run the indexing applications only have read-only access to the database. A SQL Injection attack is possible, because the indexing applications uses the document selection criteria as part of a SQL where clause.