Elastic JSON query to PHP associative array and empty objects
<p>I have this Elastic search query which works fine, but I am unable to translate this completely into a PHP associative array.</p>

<pre><code>POST /index/type/_search
{
  "fields": [
   "url"
   ],
  "query": {
     "query_string": {
         "default_field": "content.content",
         "query": "german"
      }
   },
  "highlight": {
      "fields": {
         "content.content": {}
       }
  }
}
</code></pre>

<p>How are <code>fields</code> and <code>highlight</code> sections in the above <code>POST</code> represented in the PHP associative array? My attempt below, where all works except <code>/* ERROR */</code>: </p>

<pre><code>$params = [
  'index' =&gt; $index_name,
  'type' =&gt; 'type_name',
  'body' =&gt; [
    'fields' =&gt; 'url'      /* ERROR */ 
    'query' =&gt; [
        'query_string' =&gt; [
            'default_field' =&gt; 'content.content',
            'query' =&gt; $search_term
        ]
    ],
    'highlight' =&gt; [
        'fields' =&gt; ['content.content'=&gt; []]   /*  ERROR */
    ]
  ]
];
</code></pre>

<p>Of course, with the above <code>$params</code>, I will be doing: </p>

<pre><code>$results = Elastic_PHP_client-&gt;search($params);
</code></pre>