Searcher.cfc helps simplify searching functionality.
When initializing Searcher.cfc, you need to specify a file path in which to store collections as well as passing in DataMgr and the browser path to a page to handle forwarding searches (more on that later).
You can optionally specify directories and/or files to be excluded from a search.
The first thing that you need to do in order to have Searcher work is to index one or more collections. If you want to index files, use the indexPath() method (the key argument is the file path that you want to index).
If you want to index data from a database, you need to query the database and index the query using the indexQuery() method.
To search for a term, simply call the run() method. Pass in the search string and optionally pass in a list of collections to search.
In order to count a selected page, Searcher must have a page that redirects the user to the desired page. The file specified in the "sendpage" argument of the init() method should have the following code (assuming Searcher.cfc is loaded into Application.Searcher).
<cfif isDefined("url.searchid") AND isDefined("url.to")>
<cfset Application.Searcher.send(url.searchid,url.to)>
</cfif>
You can also extend Searcher.cfc for an individual site if you want to customize the way it works for a particular site. For example, you could overwrite the run() method to filter the Summary based on extra code you know to be in the site.