Now let's break this simple percolation example down: the first part of the rule,
select using "google.com|search.yahoo.com|bing.com" setting()
tells the rule what domains to fire on, in this particular select statement, we use the regex OR symbol "|" to tell this rule to fire on any of the sites in the statement.
The next part of the rule takes place in an
emit << >>
Inside of our emit block, we code a function that defines how search resultes are percolated, this is the beauty of the percolate action, you write our own function that fully customizes the way that the search percolation happens. The percolate action simply takes your custom function as a parameter.
In the above specific percolation example, we just implement a simple domain check. First note that your percolation function takes a parameter, and then that parameter is used to pull information using the .data() method. The .data() method only works like this when your percolation function is used with the KRL action, percolate. In this example, we check the domain of the current search result, and if it matches "kynetx.com", we return true, which tells the percolate action to percolate it.
There are infinitely many ways one can design their custom percolate function, one way is to run through a JSON object, and if the key is found, percolate it.
The following ruleset shows percolate() being used