/// <summary>
/// Set intersection operation. Creates
/// a new SearchResult with all the records
/// that exist in both SearchResult objects.
/// </summary>
/// <param name="other"></param>
/// <returns>a SearchResult representing the
/// intersection between the this and other objects
/// </returns>
/// <remarks>all the SearchHit objects in
/// the resulting SearchResult are clones from
/// the original ones combined to the ones in
/// other</remarks>
public SearchResult Intersect(SearchResult other)
{
SearchResult result = new SearchResult();
foreach (SearchHit hit in _hits)
{
SearchHit otherHit = other.FindSearchHit(hit.Record);
if (null != otherHit)
{
SearchHit resultingHit = hit.Clone();
resultingHit.Combine(otherHit);
result.Add(resultingHit);
}
}
return(result);
}