Hi,
I'm developing Java application that should recommend users activities that are most often used to reach specific competence. My approach was to use association rules, so I already have generated association rules that are stored in ES in the following form:
{ "id": 24,
"support": 1,
"confidence": 0.671,
"itemset1": [{"id": 3},{"id": 8},{"id": 12}],
"itemset2": [{"id": 4},{ "id": 7}, {"id": 8 }]
}
As an input in the system I have competence id (e.g. 24), and a list of activities that user already have passed (e.g. 3,8,12,17). This list of activities should be compared with itemset1 in order to find best match. It doesn't have to be exactly the same match, but closest one. After that, I would use itemset2 as a recommendation. Confidence is also relevant, and it would be great if this value could affect the score of the results.
In ideal case, these value should not be present in itemset2.
My problem is how to create appropriate query that will find the best match. I tried with the simplest scenario which will filter out rules only by comparing itemset1 with input list. I tried to create terms for each input activity, and to combine it with AndFilterBuilder. However, this query works only if input list is subset of itemset1. For example, list(3,8,12,17) will not return above association rule.
I also tried with bool filter and should for each term, but that's not working too.
I hope somebody could give me idea how to solve the problem.
Thanks,
Zoran