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

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
		public void Add(SearchHit hit)
		{
			SearchHit existing = FindSearchHit(hit.Record);
			if (null != existing)
			{
				existing.Combine(hit);
			}
			else
			{
				_hits.Add(hit);
			}
		}

Usage Example

Exemplo n.º 1
0
        /// <summary>
        /// Build a new SearchResult object including
        /// only those elements for which the
        /// filter returns true.
        /// </summary>
        /// <param name="filter">filter</param>
        /// <returns>a new SearchResult containing all the elements for which
        /// <see cref="ISearchHitFilter.Test"/> returned true</returns>
        public SearchResult Filter(ISearchHitFilter filter)
        {
            SearchResult result = new SearchResult();

            foreach (SearchHit hit in _hits)
            {
                if (filter.Test(hit))
                {
                    result.Add(hit);
                }
            }
            return(result);
        }
All Usage Examples Of Bamboo.Prevalence.Indexing.SearchResult::Add