Convert between virtual and local paths.
After a search, the SearchResults object contains a list of the files that were retrieved. These files are expressed as local paths, such as c:\docs\sample.doc. For web-based applications, it is usually preferable to report document locations using virtual directory names, such as /docs/sample.doc. Also, when highlighting hits in PDF files or creating direct links to retrieved documents, a virtual directory name is required.
Internet Information Server stores its mapping between virtual and local paths in the Metabase. Reading this information from the Metabase is time-consuming and requires access rights that may not be available to a process running in the web server context. Therefore, the dtSearch Engine caches this information in the registry, under the key HKEY_LOCAL_MACHINE\Software\dtSearch Corp.\dtSearch\Virtual Roots. By default, ConvertPath will use the cached table values. Call ConvertPath with the dtsCpRefreshMappings + dtsCpStoreInRegistry flags to update the cached information. (Running dtWebSetup.exe, the dtSearch Web Setup program, will also update this information.)
If ConvertPath returns a blank string, it means that either (1) the folder passed in does not have a virtual directory associated with it, or (2) the registry tables have not been refreshed since the virtual directory was created.
Server Class | dtSearch.Engine Namespace