You are here: C++ Support Classes > dtSearch Namespace > Classes > dtsIndexCache Class > dtsIndexCache::closeIndex Method
dtSearch Text Retrieval Engine Programmer's Reference
dtsIndexCache::closeIndex Method

Close all indexes in a cache that match a filename or filename pattern including wildcards

bool closeIndex(const char * filenamePattern);
const char * filenamePattern
Filename or filename pattern to match. The filename pattern may include the wildcards * and ?. The match is case-insensitive.

Returns true if either (a) the index was not present in the cache, or (b) all instances of the index in the cache could be closed

CloseIndex() will attempt to close all instances of an index in the cache. If an instance is currently being used in a search, the attempt will fail and closeIndex() will return false. After closeIndex() returns, the index may be reopened if a search that uses the cache references the index. Therefore, before calling closeIndex(), an application should ensure that the code that initiates searches will not cause the index to be reopened.

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