在KRL搜索注释中格式化多个域的正确方法

时间:2012-08-30 21:42:46

标签: krl

我正在KRL中配置规则,以根据搜索结果中显示的2个以上不同域的结果进行注释。第一个域工作正常,但添加第二个或更多域会破坏规则。我在下面使用的代码示例 - 是否有其他方法可以列出这些域名?

rule search_annotate_cust is active {
select using "google.com|bing.com/search|search.yahoo.com/search" setting()
every {
  emit <<
    function annotate_cust(toAnnotate, wrapper, data) {
      if (data.domain == "exampleurl.com" ||
         (data.domain == "anotherurl.com" ||
         (data.domain == "sub.exampleurl.com) {
        wrapper.append("<div style='border: 0px solid red'><img  src=http://www.example.com/uploads/product/cust_icon.jpg>");
        wrapper.show();
      }
    }
  >>;
  annotate:annotate("cust") with
    annotator = <| annotate_cust |>;
 }
}

0 个答案:

没有答案