LocationSearchOperationPreprocessResultsBeforeMerge Method |
Namespace: Telogis.GeoBase.Geocoding
public virtual void PreprocessResultsBeforeMerge( List<LocationSearchSuggestion> suggestionsFromOtherSources, List<LocationSearchSuggestion> suggestionsFromThisSource )
This method is useful, for example, to detect and remove duplicates found by multiple search sources, or to adjust confidence of results based on similar results from other sources.
Implementations of this method should not perform any actual merging, however they are otherwise free to modify either list of suggestions.
Care should be taken when implementing sources that result in a substantial number of duplicate results that need to be filtered out in this step. Although the Location Search engine may provide an inflated results limit to the search operation in order to improve results quality when merging, this may not always be the case, and excessive filtering can mean that fewer results than the overall results limit remain, despite a search status of TooManyResults.
This method will not be called if there are no suggestions from previous search sources.
This method will be called on operations in descending order of priority. Consideration should be given to this relative order when designing sources. For example, if a new source may produce results that would be duplicates of an existing source, then the new source should either a) be a higher priority, but exclude relevant result types in GetIgnoredTypesForApplicableSearches(LocationSearchBaseArgs) or GetIgnoredTypesForMatchingSearches(LocationSearchBaseArgs); or b) be a lower priority, to ensure that the suggestions for the existing source are available to check for duplicates. If two operations have the same priority, there is no guarantee as to the relative order that this will be called for them.