C# Class Bamboo.Prevalence.Indexing.SearchResult

Accumulates the results of a search.
Inheritance: IEnumerable
Exibir arquivo Open project: bamboo/Bamboo.Prevalence Class Usage Examples

Public Methods

Method Description
Add ( SearchHit hit ) : void

Adds a new item to the collection of items returned by the search. If the hit represents an existing record it will be combined to the existing hit instead.

Contains ( IRecord record ) : bool

Checks if the specified record was returned by the search.

reference comparison is always used

Filter ( ISearchHitFilter filter ) : SearchResult

Build a new SearchResult object including only those elements for which the filter returns true.

GetEnumerator ( ) : IEnumerator

See IEnumerable.GetEnumerator for details

GetRecordEnumerator ( ) : SearchHitRecordEnumerator

Returns an enumerator for all the records in this object.

Intersect ( SearchResult other ) : SearchResult

Set intersection operation. Creates a new SearchResult with all the records that exist in both SearchResult objects.

all the SearchHit objects in the resulting SearchResult are clones from the original ones combined to the ones in other

SearchResult ( ) : System

Creates an empty SearchResult object.

Sort ( IComparer comparer ) : void

Sorts the result using the specified comparer.

SortByField ( string field ) : void

Sorts the result by a specific record field.

ToRecordArray ( ) : Array
ToRecordArray ( Type recordType ) : Array

Copies all the records to an array. The order is mantained so that this[N].Record == resultingArray[N] is valid for every 0 <= N < this.Count.

this ( int index ) : SearchHit

Returns an item by its position

Protected Methods

Method Description
FindSearchHit ( IRecord record ) : SearchHit

Finds a SearchHit that represents a specific record.

Method Details

Add() public method

Adds a new item to the collection of items returned by the search. If the hit represents an existing record it will be combined to the existing hit instead.
public Add ( SearchHit hit ) : void
hit SearchHit the hit to be added or /// combined to a existing hit
return void

Contains() public method

Checks if the specified record was returned by the search.
reference comparison is always used
public Contains ( IRecord record ) : bool
record IRecord record to be checked
return bool

Filter() public method

Build a new SearchResult object including only those elements for which the filter returns true.
public Filter ( ISearchHitFilter filter ) : SearchResult
filter ISearchHitFilter filter
return SearchResult

FindSearchHit() protected method

Finds a SearchHit that represents a specific record.
protected FindSearchHit ( IRecord record ) : SearchHit
record IRecord the record to search for
return SearchHit

GetEnumerator() public method

See IEnumerable.GetEnumerator for details
public GetEnumerator ( ) : IEnumerator
return IEnumerator

GetRecordEnumerator() public method

Returns an enumerator for all the records in this object.
public GetRecordEnumerator ( ) : SearchHitRecordEnumerator
return SearchHitRecordEnumerator

Intersect() public method

Set intersection operation. Creates a new SearchResult with all the records that exist in both SearchResult objects.
all the SearchHit objects in the resulting SearchResult are clones from the original ones combined to the ones in other
public Intersect ( SearchResult other ) : SearchResult
other SearchResult
return SearchResult

SearchResult() public method

Creates an empty SearchResult object.
public SearchResult ( ) : System
return System

Sort() public method

Sorts the result using the specified comparer.
public Sort ( IComparer comparer ) : void
comparer IComparer
return void

SortByField() public method

Sorts the result by a specific record field.
public SortByField ( string field ) : void
field string the field to be used in the sort
return void

ToRecordArray() public method

public ToRecordArray ( ) : Array
return System.Array

ToRecordArray() public method

Copies all the records to an array. The order is mantained so that this[N].Record == resultingArray[N] is valid for every 0 <= N < this.Count.
public ToRecordArray ( Type recordType ) : Array
recordType System.Type array element type
return System.Array

this() public method

Returns an item by its position
public this ( int index ) : SearchHit
index int
return SearchHit