C# Class SIL.FieldWorks.Common.Controls.SearchEngine

An abstract class for performing indexing and searching asynchronously.
Inheritance: SIL.Utils.FwDisposableBase, IVwNotifyChange
Show file Open project: sillsdev/FieldWorks Class Usage Examples

Public Methods

Method Description
Get ( XCore.Mediator mediator, string propName, Func searchEngineFactory ) : SearchEngine

Gets the search engine.

Search ( IEnumerable fields ) : IEnumerable

Searches the specified fields. N.B. This version is currently only used in testing.

SearchAsync ( IEnumerable fields ) : void

Searches the specified fields asynchronously.

Protected Methods

Method Description
DisposeManagedResources ( ) : void

Override to dispose managed resources.

FilterResults ( IEnumerable results ) : IEnumerable

If some objects need to be filtered out of the results (for instance the item we started from in the merge dialog) then this function can be used to do it.

GetSearchableObjects ( ) : IList

Gets the searchable objects.

GetStrings ( SearchField field, ICmObject obj ) : IEnumerable

Gets the searchable strings of an object.

IsFieldMultiString ( SearchField field ) : bool

Determines if the specified field is a multi-string or multi-unicode field.

IsIndexResetRequired ( int hvo, int flid ) : bool

Determines if an index reset is required.

SearchEngine ( SIL.FieldWorks.FDO.FdoCache cache, SearchType type ) : System

Initializes a new instance of the SearchEngine class.

Private Methods

Method Description
BuildIndex ( int i, SearchField field, Func isSearchCanceled ) : int

Builds the search index.

HandleWork ( SearchField[]>.IQueueAccessor queue ) : void
IVwNotifyChange ( int hvo, int tag, int ivMin, int cvIns, int cvDel ) : void
IsSearchCanceled ( SearchField[]>.IQueueAccessor queue ) : bool
OnSearchCompleted ( object e ) : void
PerformSearch ( IList fields, Func isSearchCanceled ) : IEnumerable

Method Details

DisposeManagedResources() protected method

Override to dispose managed resources.
protected DisposeManagedResources ( ) : void
return void

FilterResults() protected method

If some objects need to be filtered out of the results (for instance the item we started from in the merge dialog) then this function can be used to do it.
protected FilterResults ( IEnumerable results ) : IEnumerable
results IEnumerable
return IEnumerable

Get() public static method

Gets the search engine.
public static Get ( XCore.Mediator mediator, string propName, Func searchEngineFactory ) : SearchEngine
mediator XCore.Mediator
propName string
searchEngineFactory Func
return SearchEngine

GetSearchableObjects() protected abstract method

Gets the searchable objects.
protected abstract GetSearchableObjects ( ) : IList
return IList

GetStrings() protected abstract method

Gets the searchable strings of an object.
protected abstract GetStrings ( SearchField field, ICmObject obj ) : IEnumerable
field SearchField
obj ICmObject
return IEnumerable

IsFieldMultiString() protected abstract method

Determines if the specified field is a multi-string or multi-unicode field.
protected abstract IsFieldMultiString ( SearchField field ) : bool
field SearchField
return bool

IsIndexResetRequired() protected abstract method

Determines if an index reset is required.
protected abstract IsIndexResetRequired ( int hvo, int flid ) : bool
hvo int
flid int
return bool

Search() public method

Searches the specified fields. N.B. This version is currently only used in testing.
public Search ( IEnumerable fields ) : IEnumerable
fields IEnumerable
return IEnumerable

SearchAsync() public method

Searches the specified fields asynchronously.
public SearchAsync ( IEnumerable fields ) : void
fields IEnumerable
return void

SearchEngine() protected method

Initializes a new instance of the SearchEngine class.
protected SearchEngine ( SIL.FieldWorks.FDO.FdoCache cache, SearchType type ) : System
cache SIL.FieldWorks.FDO.FdoCache
type SearchType
return System