List All Indexes on Azure Search Service

  • Estimated read time: 2 min read
  • Written by Chad Campbell on Jun 18th 2016

An Azure Search service can have hundreds of search indexes. Your search index collection can quickly grow if you're managing documents across multiple environments and geographies. As your collection grows, you'll need ways to manage and report on these indexes. In these scenarios, you'll likely need to list all indexes on an Azure Search index.

To list the indexes on an Azure Search service, you can use a GET request. The request URL looks something like this:

https://[my-service-name].search.windows.net/indexes?api-version=[my-api-version]

Once you issue a GET request to an endpoint that matches this template, you'll get a response. The response will include a JSON object that looks like the following:

{
  "value": [
    {
      "name": "my-index-name",
      "fields": [
        { "name":"field-name", ... },
        ...
      ]
    },
    {
      "name": "my-other-index",
      "fields":[
        { "name":"field-name", ... },
        ...          
      ]
    }
  ]
}

This JSON response has a property called value. The value is a collection of all of the indexes in your search service. This is super useful for looping scenarios. You might find yourself needing to loop through the indexes in a report or administrative setting.

Each index in the collection includes its full definition. This definition includes fields, suggesters, and scoring profiles. I talk about about each of these topics in detail in my Azure Search training course on Pluralsight (free trial). For now, I hope this post answered your question. Thank you for reading.


Comments

comments powered by Disqus

Chad Campbell
Chad Campbell

Chad is an independent software professional. He has been named a Microsoft MVP five times. His books have been translated into multiple languages and distributed worldwide. He holds a computer science degree from Purdue University, where he also studied psychology.

Chad has built sites, apps, frameworks, libraries, and platforms using Java, .NET, and Node. He's ran his own startups and has created software for Fortune 100 companies. In short, Chad knows how to create software. From ideation to delivery. From start-to-finish.



Follow Chad Online