Skip to content

Facets #3

@hellovic

Description

@hellovic

Hi,

How can I do facets grouping of data, e.g. date_histogram, by using elasticsearch-php client?

I tried to send the JSON

{
"query" : {
...
},
"facets": {
    "histo1": {
      "date_histogram": {
        "key_field": "post_date",
        "interval": "month"
      }
    }
  }
}

The ['hits'] gives what match but there is no ['facets'] or something similar for the facets data.

I tried to read the doc on https://github.com/elasticsearch/elasticsearch-php/tree/master/docs, but it doesn't mention facets at all. Please correct if i am wrong and thanks for this elasticsearch php client.

Vic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions