Close
dtSearch Engine API for Java
IndexCache.setAutoReopenTime Method

Number of seconds an index can be left open before it is automatically closed and reopened.

Syntax
Java
public void setAutoReopenTime(int v);
Parameters
Description
int v
Number of seconds an index can be left open before it is automatically closed and reopened. If -1, the modification date of the index will be checked on every search, to force the index to be reopened if it has been updated recently.

When an index is opened, its view of the index contents is not changed by subsequent index updates. To ensure that indexes in the cache do not get out of date, use AutoReopenTime to specify a maximum number of seconds before an open index is closed and reopened. 

On each access to the cache, the last-opened time for each index is compared to AutoReopenTime and, if the index has not been opened for a sufficient period of time, the index is closed and reopened. 

The cache does not have its own thread to implement AutoReopenTime, so it only checks AutoReopenTime when the cache is accessed for any reason.