You are here: C++ Support Classes > dtSearch Namespace > Classes > dtsIndexCacheOptions Structure > dtsIndexCacheOptions::autoReopenTime Data Member
dtSearch Text Retrieval Engine Programmer's Reference
dtsIndexCacheOptions::autoReopenTime Data Member

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

int autoReopenTime;

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, including a call to dtsIndexCache.GetStatus(). 

Set autoReopenTime to -1 to have dtSearch check the modification date of the index on every search to see if the index should be closed and reopened reflect a recent update.

Copyright (c) 1995-2023 dtSearch Corp. All rights reserved.