Match list in list

I have my apriori result save on elasticsearch index as:

index    |    antecedents    |    consequents    ...other fields
1        |    [1,2]          |    [8]
2        |    [1]            |    [55]
3        |    [82]           |    [8,99]

Now I want to retrieve consequents if antecedent match:
[1,2] or related i.e. using match rather than term (not match exactly)

and the output shall be [[8],[55]] ordered by score of match

I want to get them form pandas or python query, what I am doing by now is:

from elasticsearch import Elasticsearch
from import json_normalize
res ="index_name", body={ "query": {"match_all": {}}})
df = json_normalize(res['hits']['hits'])

This is how I am by now retrieving records, I need the elasticsearch query to do so!
Also I looked at: Similar ES question, but I here want the field and not includes

The documents are like:

"_id": 1, 
"antecedents": [1,2]
"consequents": [8]
...other fields

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.