title: Elasticsearch\RuntimeException: Failed to JSON encode: 5 in file /Elasticsearch/Serializers/SmartSerializer.php on line 33
body: <p>I am trying to run a project that uses elasticsearch on my computer. But at the point that the API. Queries something from elasticsearch I get the following error and the query does not execute:</p>
  
  <pre><code>Elasticsearch\Common\Exceptions\RuntimeException: Failed to JSON encode: 5 in file /Users/sobhan.bagheri/projects/laravel/regionsdelen-api/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Serializers/SmartSerializer.php on line 33
  </code></pre>
  
  <p>I am using: <code>laravel framework</code> with <code>valet</code> - <code>php7.1</code> - <code>elasticsearch 6.1.2</code> - and <code>elasticsearch/elasticsearch:v6.0.1</code> for the driver.</p>
  
  <p>I tried everything like changing elasticsearch to newer or older versions. Changing the way of the client connects to elasticsearch and also changed versions of the <code>elasticsearch/elasticsearch</code> driver but nothing seems to work.</p>
  
  <p>btw: those versions I mentioned are the exact ones running on another machine without this error.</p>
  
  <p>P.S: This error only occurres when I query a swedish character.</p>