Proper way to format for multiple domains in KRL search annotation

40 Views Asked by At

I am configuring a rule in KRL to annotate based on results of 2+ distinct domains showing in the search results. The first domain works fine, but adding a 2nd or more breaks the rule. Sample of the code I'm using below - is there another way to list these domains?

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

There are 0 best solutions below