One way is to create a method to do what you want, register that method with esper, and reference that method from your EPL statement:
Create helper class (for this example, I use EsperUtils.java):
package my.package;
class EsperUtils {
public static boolean contains(List<String> list1, List<String> list2) {
// Check for list1 and list2 to contain same word
for (String s1 : list1) {
for (String s2 : list2) {
if (s1.equals(s2)) return true;
}
}
return false;
}
}
Register method with esper in aem.esper.config.xml:
<plugin-singlerow-function name="contains" function-class="my.package.EsperUtils" function-method="contains" />
Use the helper method in your EPL:
select * from myEvent where contains(Words,AnotherListOfWords)
You could also add the helper method to your event POJO instead of a helper class.