Warning |
---|
title | Engine Compatibility |
---|
|
percolate is not supported by the Node engine. |
percolate(<js_function>)
The percolate action iterates through search results on the current page as well as pages after the current page. Currently the percolate action takes a javascript function as its parameter. This function is run for each search result with the result being passed in as a parameter. A search result is percolated, or brought to the top, when the function passed to the action returns true. To start off, lets take a simple example and explain it:
Code Block |
---|
language | javascript |
---|
theme | Confluence | language | javascript |
---|
|
ruleset a1299x177 {
meta {
name "percolate example"
author "nathan cerny"
logging off
}
dispatch {
// domain "exampley.com"
}
rule percolate is active {
select using "google.com|search.yahoo.com|bing.com" setting ()
emit <<
var perc_data = ["www.windley.com"];
function perc_filter(obj){
var host = $K(obj).data("domain");
var o = perc_data.indexOf(host);
if(o !== -1){
return true;
} else {
return false;
}
}
>>;
percolate(perc_filter);
}
} |
...
The following ruleset shows percolate() being used
Code Block |
---|
language | javascript |
---|
theme | Confluence | language | javascript |
---|
|
ruleset a1299x177 {
meta {
name "percolate example"
author "nathan cerny"
logging off
}
dispatch {
// domain "exampley.com"
}
rule percolate is active {
select using "google.com|search.yahoo.com|bing.com" setting ()
emit <<
var perc_data = ["www.windley.com"];
function perc_filter(obj){
var host = $K(obj).data("domain");
var o = perc_data.indexOf(host);
if(o !== -1){
return true;
} else {
return false;
}
}
>>;
percolate(perc_filter);
}
} |
...