Skip to content

Write Aggregation Queries in PHP #196

@JugalSA

Description

@JugalSA

Hello, i am writing Elasticsearch aggregations queries to find the total count available:

GET listjugal/_search
{
"aggregations": {
"Brand_Name_Count": {
"terms": {"field": "brand_name", "size" : 0}
},
"Stock_Status_Count" : {
"terms" : { "field" : "stock_status", "size" : 50}
},
"Category_Id_Count" : {
"terms" : { "field" : "category_id", "size" : 50}
},
"Price_Name_Count" : {
"terms" : { "field" : "price_name", "size" : 50}
},
"Discount_Name_Count" : {
"terms" : { "field" : "discount_name", "size" : 50}
}
}
}

And I am getting the count properly.
How do i write these type of queries in php code??
And also how do i merge aggregation with search results query.
Help me

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