Search code examples
azureazure-cognitive-searchazure-search-.net-sdk

GroupBy and Count in Azure Search


I want to migrate a project from Elasticsearch to Azure Cognitive Search, and I can't find a way to do a group + count operation, such as the Elasticsearch client "aggregate" method. What is the correct way to do it in Azure Search? Ofc I can just get all the data and do the counting in my code (the amount of data in my case is not that big), but there must be a more optimal solution.


Solution

  • You can probably use facets for that. Though it's more limited than Elasticsearch client "aggregate" method.