Bamboo.Prevalence.Indexing.SearchResult.Intersect C# (CSharp) Method

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
		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;
		}