Summary
Inconsistent search results are displayed after executing a search via a custom program that uses Laserfiche SDK code. For example, after some search attempts, no results are returned, while other times partial or complete results are returned (the same search query is used in all instances).
Resolution
Ensure your program is not calling the LFDatabase.ReindexSearchbase() method before executing the search, as this instructs the Laserfiche Full-Text Indexing and Search service to re-index some or all of the documents in your repository. As a result, when the search is performed, the files needed to return the correct results are being used to re-index the repository. Depending on the timing of the machine and the program, this may lead to incorrect results.
In most cases, we recommend indexing documents as they are created, which is enabled by default. To configure this setting, log in to a repository using the Laserfiche Administration Console, right-click the Index node under a specific repository, select Properties, and refer to the Always index on document creation setting. This option determines whether new documents, regardless of whether they have been associated with text pages, will be automatically indexed. This feature, combined with Laserfiche indexing functionality that automatically indexes any text added to previously indexed documents, ensures that all new documents can be searched using the text associated with them.
For more information, see the LFDatabase.ReindexSearchbase Method topic in the Laserfiche SDK help files, or the Indexing for Full-Text Search topic in the Laserfiche Administration Console help files.