I have this search query which works fine, but I am unable to translate this into a PHP $params
associative array.
POST /index/type/_search
{
"fields": [
"url"
],
"query": {
"query_string": {
"default_field": "content.content",
"query": "german"
}
},
"highlight": {
"fields": {
"content.content": {}
}
}
}
What I have so far of the PHP associative array:
$params = [
'index' => $index_name,
'type' => 'type_name',
'body' => [
'fields' => 'url' /* error */
'query' => [
'query_string' => [
'default_field' => 'content.content',
'query' => '$term'
]
],
'highlight' => [
'fields' => ['content.content'=> []] /* error */
]
]
];