My Query which returns the error: elasticsearch.exceptions.RequestError: RequestError(400, 'x_content_parse_exception', '[8:43] [bool] failed to parse field [must]')
I have tried replacing the [] with {} but that hasen't helped
chunksize, chunk, double_chunk = ssdeep_value.split(":")
chunksize = int(chunksize)
twice_chunksize = chunksize*2
half_chunksize = chunksize*0.5
query = """
{
"query": {
"bool": {
"must": [
{
"terms": {
"chunksize": [chunksize, twice_chunksize, half_chunksize]
}
},
{
"bool": {
"should": [
{
"match": {
"chunk": {
"query": chunk,
}
}
},
{
"match": {
"double_chunk": {
"query": double_chunk,
}
}
}
],
"minimum_should_match": 1
}
}
]
}
}
}
"""
results = es.search(index="ssdeep-index", body=query)