Magento – Types cannot be provided in put mapping requests : Magento2.3

elasticsearchmagento2

I am facing issue when enabling elastic search in magento 2.3 with latest elastic version 7.3.1. All products are hidden in frontend and search not working and when trying to do manual indexing getting this error.

{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Types
cannot be provided in put mapping requests, unless the
include_type_name parameter is set to
true."}],"type":"illegal_argument_exception","reason":"Types cannot be
provided in put mapping requests, unless the include_type_name
parameter is set to true."},"status":400}

Best Answer

Go to Magento\Elasticsearch6\Model\Client\Elasticsearch

Find function addFieldsMapping approx line number 241

Add new element to $params array

'include_type_name' => true,

This will resolve your error

$params = [
    'index' => $index,
    'type' => $entityType,
    'include_type_name' => true,
Related Topic