New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Facets not working as per docs #50
Comments
Do you mean you are receiving an exception from Elasticsearch, a PHP parse error or just not returning the results that you expect? Everything appears to be working fine on my end: $client = new Elasticsearch\Client();
$query = array(
'query' => array(
'match_all' => array()
),
'facets' => array(
'tag' => array(
'terms' => array(
'field' => 'tag',
'all_terms' => true
)
)
)
);
$params['body'] = $query;
$params['index'] = 't';
$params['type'] = 't';
$ret = $client->search($params);
print_r($ret);
|
Should have been clearer, was in a rush, sorry. It still truncates at 10 facet results for me which is the default, when I have 13 possible results. I'm on ES v1.0 |
Ah, that's just Elasticsearch's behavior. The $query = array(
'query' => array(
'match_all' => array()
),
'facets' => array(
'tag' => array(
'terms' => array(
'field' => 'tag',
'all_terms' => true,
'size' => 200
)
)
)
); |
Ahhh, ok, no problem. I have switched it to the size parameter anyway, thanks for clearing that up. |
If I use:
from the documentation, as a PHP array converted to json by the php-api, the
all_terms
part doesn't work.The text was updated successfully, but these errors were encountered: