Question: i Want to Override

> 
> Magento\Wishlist\CustomerData\Wishlist
> 
> 
> 

```
public function getSectionData()
    {
        $counter = $this->getCounter();
        return [
            'counter' => $counter,
            'items' => $counter ? $this->getItems() : [],
        ];
    }

```

so in My `etc\frontend\di.xml`

```
<type name="Magento\Wishlist\CustomerData\Wishlist">
     <plugin name="wishlist" type="Vendor\ModuleName\Plugin\Wishlist" disabled="false" sortOrder="0"/>
</type>

```

in My 

> 
> Vendor\ModuleName\Plugin\Wishlist
> 
> 
> 

```
class Wishlist
{

    public function afterGetSectionData(\Magento\Wishlist\CustomerData\Wishlist $subject, $result)
    {
        return [
            'counter' => 2,
            'items' => NULL,
        ];

    }
}

```

when i apply plugin i am not getting any wishlist Array in `mage-cache-storage`

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,

```
**Types** in requests is deprecated in Elasticsearch 7.x version.

* Types are deprecated in APIs in 7.x, with breaking changes to the
index creation, put mapping, get mapping, put template, get template
and get field mappings APIs.
* For instance, indexing a document no longer requires a document type.
The new index APIs are `PUT {index}/_doc/{id}` in case of explicit
ids and `POST {index}/_doc` for auto-generated ids. 

Note that in 7.0, `_doc` is a permanent part of the path, and
represents the endpoint name rather than the document type.
* The `include_type_name` parameter in the index creation, index
template, and mapping APIs will default to false. Setting the
parameter at all will result in a deprecation warning.
* The `_default_` mapping type is removed.

Switching to Elasticsearch 6.x is one of the best alternative as this will be endpoint update for the elastic search libraries (<https://github.com/elastic/elasticsearch-php>).

It can be achievable to use include\_type\_name is an elastic search flag but it will attract a deprecated warning.

For debugging purpose, one should make a change in the methods (i.e. `addFieldsMapping`, `deleteMapping` ) of the following class by creating a override module for `elasticsearchfix-7`.

```
vendor/magento/module-elasticsearch-6/Model/Client/Elasticsearch.php

```