1

我正在 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 |>;
 }
}
4

0 回答 0