dtSearch Text Retrieval Engine Programmer's Reference 7.86
Multithreaded Indexing and Searching
Overviews | Send Feedback

Rules for multithreaded use of the dtSearch Engine.


The dtSearch Engine supports multithreaded indexing and searching. As a general rule, any API function can be called from any thread at any time. However, access to API objects such as SearchResults, IndexJob, etc. is not synchronized, so a single API object may not be accessed from more than one thread at a time. 

Threading model. The dtSearch COM interface uses the "both" threading model. This means it can be called from a single-threaded apartment or from a multi-threaded apartment and will operate efficiently in both cases, without adversely affecting threading in the apartment. 

Visual Basic. The IndexJob and SearchJob objects have ExecuteInThread methods that will start an indexing or searching job in a separate thread and return immediately. You can then call IsThreadDone or AbortThread periodically to check the status of a thread that has been tarted. 

Concurrent index access. An index can only be updated by one indexing job at a time. Therefore, even though the dtSearch Engine can conduct index update operations in multiple threads concurrently, each thread has to be updating a different index. 

Options. Option settings are maintained separately for each thread, so changes to options in one thread will not affect a job in progress on another thread. When a new thread is started, it will inherit the most recent option settings from other threads in the process. 

You are here: Overviews > Multithreaded Indexing and Searching
Copyright (c) 1995-2016 dtSearch Corp. All rights reserved.