Lack of some faceted search features over HTTP

Is there any way to do:

  • Faceting by aggregation over another attribute1
  • Facet over multi-level grouping2
  • Ordering in facet result3

over HTTP interface (or using PHP package)? I could not find any example/way on main documentation nor PHP package documentation.


you could use aggs object that is similar to elastic interface.

Here is also examples of aggs usage at test

Thx, I’m already using simple faceted search with aggregations and it works as expected, but I would like to know if it’s possible to order facet result or facet over multiple fields (facet over multi-level grouping).

I’ve checked that XML test file you’ve linked, If I understand correct it just do simple faceted search.

For example, I’d like to how to make FACET brand_name BY brand_id query (over another field) over HTTP? Or FACET price_range AS price_range, brand_name (over multiple fields) or FACET field_name ORDER BY COUNT(*) (ordering).

Documentation is lack of examples for those type of faceted queries for HTTP/PHP, it just shows SQL queries.

By the way, if I use Client object sql method to run that kind of queries, it throws multiple queries not supported error.

Sample code:

$params = [
    'body' => [
        'query' => 'SELECT * FROM index_name FACET field_name AS field_name,another_field_name ORDER BY COUNT(*)'

$response = $client->sql($params);


I am also trying to find a way how to do sort on aggregation results using /search endpoint.
Not sure if it is possible just by reading the docs.