I'm trying to develop a unified text search across my application. Let me briefly explain the scope of this application.
I am (trying to) create an application in which all the separate online Help documents for my company's product can be displayed and searched in a unified interface. I am using a Web Control object to display each HTML Help document. I am thinking of using only a single frame as the main interface, then calling sub-applications to display each HTML Help document. This way, I can use an Update widget to update each individual document separately.
More to the point of this post, though, I would like to create a unified text search function in this application. I have looked at the Search object, but it seems to designed to search file and directory content and not necessarily text in the application. This, however, may prove to be better, since if a text search takes place across all documents in the file structure, it would return hits even if those documents are not presently displayed/loaded into a Web Control object.
However, I seem to be having some difficulty implementing this search function. I have placed an Edit box, a simple button, and (for now) another Edit box in which to display search results.
The button is disabled until text content is placed into the first Edit box. Once the Edit box has content and the button is clicked, the Search object gets the content of the first Edit box, performs a search against an index which is built at the beginning of the application loading, then displays the results in the second Edit box.
Of course, though, it's not working. I suspect I'm not using the Search object properly.
One question I have is what file format is a search index to be saved? There is an option in the Search object that it can index a specified directory, then that index can be saved. However, the Search object's documentation doesn't specify what file format that index is to be saved. Once I know how it is to be saved, I can load that index when a text search is required.
I am not sure what action is used in the Search object to display search results into the second Edit box.
A much more trickier thing I must consider is once I display proper results, how do I allow the user to reference those hits? In other words, how can I create hyperlinks from the search result(s) to the corresponding document?
I am definitely open to feedback and suggestions.