FileLocator Pro .NET Library
Show/Hide TOC

# SearchEngine Class

Represents the core searching component.

## Definition

Namespace: Mythicsoft.Search.Core
Assembly: Mythicsoft.Search.Core (in Mythicsoft.Search.Core.dll) Version: 9.3.830.1
C#

    public class SearchEngine : IDisposable

C++

    public ref class SearchEngine : IDisposable

Inheritance
  Object SearchEngine

Implements
  IDisposable

## Remarks

A search is started by calling the Start(SearchCriteria, Boolean) method with a SearchCriteria instance. The results from the search are available via the SearchResultItems property or through the SearchResultItemCollection passed to the OnFileFound event.

You can also use SearchEngine to search through a given string using the SearchText(SearchCriteria, String) method.

## Example

C#

    SearchFileSystemCriteria criteria    = new SearchFileSystemCriteria();
    criteria.FileNameExprType            = ExpressionType.DosExp;
    criteria.FileName                    = "*.txt";
    criteria.ContainingText              = "SearchFor";
    criteria.LookIn                      = "C:\\";

    criteria.ApplyChanges();
    engine.Start(criteria, false);

## Constructors

SearchEngine | Initializes a new instance of the SearchEngine class

## Properties

SearchResultItems | The list of found SearchResultItem objects for the current search.

## Methods

Dispose | Releases all resources used by the SearchEngine
Dispose(Boolean) | Releases the unmanaged resources used by the SearchEngine and optionally releases the managed resources
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object)
Finalize | Non-GC class clean up (Overrides ObjectFinalize)
GetHashCode | Serves as the default hash function. (Inherited from Object)
GetType | Gets the Type of the current instance. (Inherited from Object)
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object)
SearchText | Search a string for the given criteria.
Start | Starts a new search
Stop | Stops a currently running search.
ToString | Returns a string that represents the current object. (Inherited from Object)
Unlock | Provide registration information to the search engine. Used when regkey.xml file not available.

## Events

OnFileFound | Occurs when one or more files are found. If multiple files are found within a short interval they are grouped into a single OnFileFound message.
OnProgress | Occurs during the search providing progress information.
OnSearchFinished | Occurs when the search has finished.
OnSearchStarted | Occurs when the search starts.

## See Also

#### Reference

Mythicsoft.Search.Core Namespace