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

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
		protected SearchHit FindSearchHit(IRecord record)
		{
			foreach (SearchHit hit in _hits)
			{
				if (hit.Record == record)
				{
					return hit;
				}
			}
			return null;
		}

Usage Example

Exemplo n.º 1
0
        /// <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);
        }
All Usage Examples Of Bamboo.Prevalence.Indexing.SearchResult::FindSearchHit