-
Notifications
You must be signed in to change notification settings - Fork 3
Post Processors
Giacomo Stelluti Scala edited this page Jan 3, 2020
·
20 revisions
A post processor service is a type that configured in a SearchContext
will process a collection of ResultInfo
producing a new one. It's a class of type PostProcessor
that must override the following abstract method:
IEnumerable<ResultInfo> Process(IEnumerable<ResultInfo> results)
It's also mandatory to define a constructor that accepts a single object
parameter, used for the settings of the specific post processor.
PickAll comes with following built-in post processors, that chan be found in PickAll.PostProcessors
namespace:
- Uniqueness: removes duplicate results by URL
- Order: orders results placing indexes of same number close by each other
- FuzzyMatch: compares a string against results descriptions
- Improve: improves results computing word frequency to perform a subsequent search
- Wordify: reduces documents identified by results URLs to a collection of words
FuzzyMatch post processors computes (Levenshtein Distance)[https://en.wikipedia.org/wiki/Levenshtein_distance] between a given string and results descriptions. If the distance is out of the specified range, the result will be excluded. Is configured as follows:
var context = SearchContext.Default
.With<FuzzyMatch>(new FuzzyMatchSettings {
Text = options.FuzzyMatch,
MaximumDistance = 10 }); // MinimumDistance default is 0