Elastic6.7 <search> 'Unknown key for a START_OBJECT in [filter].'

I'm from Py3 and es6.7 in my macOS. When I try to search and it raise an error.

body = {
    "query": {"match": {"doc.name": s_key}},
    "filter": {"term": {"doc.is_vaild": True}}
}

print(es.search(index='crm_brand', doc_type='_doc', body=body))

Error:

elasticsearch.exceptions.RequestError: RequestError(400, 'parsing_exception', 'Unknown key for a START_OBJECT in [filter].')

Depending on what you want to do you need to use post_filter IIRC or a bool query instead.

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