page_type | languages | name | description | products | |||
---|---|---|---|---|---|---|---|
sample |
|
Compute aggregations over a search index |
Compute aggregations such as mean over a search index using a query. |
|
In this sample, create a simple search index and upload random data to it. This sample illustrates how aggregations can be computed from the random data, and how the data can be filtered using a query.
In contrast with other tutorials, this one uses an index with randomly generated data. No preliminary service or index setup is required.
- Clone or download this sample repository.
- Extract contents if the download is a zip file. Make sure the files are read-write.
-
Open a solution in Visual Studio.
-
Modify appsettings.json to use your search service URI and admin API key. The URI is a full URL in the format of
https://<service-name>.search.windows.net
. The admin API key is an alphanumeric string that you can obtain from the portal, PowerShell, or CLI.{ "searchServiceUrl": "<YOUR-SEARCH-SERVICE-URI>", "adminKey": "<YOUR-SEARCH-SERVICE-API-KEY>" }
-
Press F5 to compile and run the project.
You can learn more about Azure AI Search on the official documentation site.