Previous Topic: Search ArchitectureNext Topic: Stored Procedures (SPs)


Versioning Scheme

Searches installed in the iConsole support a versioning scheme to facilitate upwards compatibility of saved searches wherever possible. This section describes how this versioning scheme operates.

As an illustration of the problem, suppose we have installed and published a search definition in the iConsole, and installed the corresponding stored procedure on the CMS. This search is being used every day and users have saved searches based upon it. We now want to add an extra feature to the search. Without versioning we have two options:

Search versioning is designed to overcome both of these problems.

When a search definition is created, major and minor version numbers (generally 1 and 0) are defined. These attributes, along with stored procedure name, are used to identify the stored procedure that the search definition will access. When a search needs to be modified, minor and/or major version should be updated based on the impact of the change.

This section contains the following topics:

Minor Updates

Major Updates

Saved Searched Update Automatically

Search Visibility

Search Definitions

Stored Procedures

Minor Updates

A minor update is one that does not affect the upwards compatibility of saved searches. In general this means that:

However, the new version of the search can:

Incrementing the minor version is usually appropriate for most changes involving bug fixing, performance tuning and adding extra capabilities.

Minor updates are automatically picked up by saved searches when the new version is published.

Major Updates

An increment of the major version is only required when the changes to the search are such that saved searches can no longer be expected to function correctly. For example this occurs if the search was completely revised, using a completely different set of input parameters.

Major updates are not picked up by saved searches based on previous major versions.

Saved Searched Update Automatically

When a user saves a search, only the parameter values for the search are saved along with a reference to the search it was saved from.

When the saved search is run, the iConsole retrieves the search definition with the most recent minor version for the same major version. This means that if a custom search was saved against Standard_Search 1.0 and the current, published version of the standard search is now 1.5, the saved search uses version 1.5 of the search. However, if version 2.0 of the search is produced, the saved search does not use this as it is considered to be incompatible, and continues to use 1.5.

The iConsole merges the saved parameters with the latest search definition, using defaults for any new parameters that have been added since the search was saved. In this way, saved searches continue to function, but benefit from updates to improve performance or correct errors and also new features using the default parameter values.

Search Visibility

Only the most recent version of a search with a given major version is displayed on the Review page as users only need to see the latest one. Several minor versions of a search may still be present, however and may be seen in the Administer Searches | Searches page allowing the administrator to remove old versions as and when required.

Example: If versions 1.0, 1.1, 1.2, 1.3, 2.0 and 2.1 of a particular search have been installed, only versions 1.3 and 2.1 would be visible in the Review page Searches folder.

Note: The reason that old versions of searches are not automatically removed when the new version is published is that large installations may have multiple iConsole server installations which may be at different iConsole version levels (for example, part way through an upgrade project). If new version of a search requires a particular version of the iConsole (both web and application servers) to function (see the 'requires' attribute in Search Definition Syntax), it is only displayed on the upgraded iConsole servers; older installations continue to show an earlier version of the search.

Search Definitions

The search definition XML defines the search to the iConsole and includes the name of the stored procedure (spname) and the major and minor version numbers. The search definition defines the interface to the stored procedure so they must be kept in step.

The iConsole has a publishing process allowing new searches to be tested before they are made available to users. After a new version of a search definition is published, the new version may be used automatically by any saved searches based on the original search.

Note: The publication process in the iConsole only affects the search definition; the stored procedure is not moved or renamed. Access to a different version of a stored procedure is controlled through publication of its search definition.

Stored Procedures

The name of the stored procedure (SP) is constructed like this:

<spname>_V<major>_<minor>

For example, with an spname of Standard_Search, major version 1 and minor version 0 the stored procedure name would be "Standard_Search_V1_0".

When the search is modified, the major or minor version should be incremented so that a completely new stored procedure is referenced. This allows the new version of the search to be tested from the unpublished folder of the iConsole, accessing the new SP, while the original, published search and any saved searches can continue to use the original SP, unaffected by the changes.

Note: On a SQL Server database, the stored procedures are all independent and so the new version can be installed independently. However, on Oracle the stored procedures are defined within a package. In this case all versions of the stored procedure must be retained in the package as the complete package is replaced during SP installation.