Skip to content

Instantly share code, notes, and snippets.

@vigikaran
Created September 5, 2017 23:26
Show Gist options
  • Save vigikaran/1926f85aebc1afcbb635969cccf0e240 to your computer and use it in GitHub Desktop.
Save vigikaran/1926f85aebc1afcbb635969cccf0e240 to your computer and use it in GitHub Desktop.
<?php
$params['body'] = [
[
'_index' => 'service_panel',
'_type' => 'directoryies'
],
[
'_source' => [
'includes' => ['name_en','url_key','vanity_url','logo']
],
'size' => 10,
'query' => [
'bool' => [
'must' => [
'match' => [
'name_en.autocomplete_name' => $query
]
],
'should' => [
'match' => [
'name_en.name_en' => $query
]
]
]
]
],
[
'_index' => 'service_panel',
'_type' => 'directory_categories'
],
[
'_source' => [
'includes' => ['name_en','unique_name']
],
'size' => 10,
'query' => [
'bool' => [
'filter' => [
'term' => [
'site' => $site
],
'term' => [
'edition' => $request->input('edition',NULL)
]
],
'must' => [
'match' => [
'name_en.autocomplete_name' => $query
]
],
'should' => [
'match' => [
'name_en.name_en' => $query
]
]
]
]
]
];
$response = $client->msearch($params);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment