问题
I'm currently working on a POC that uses Azure Search to make an Angular Front End.
I've searched everywhere and am looking for a way to query for the index schema.
What do I mean by this? On this page you can use a PUT to create an index using JSON.
Is there a way to get this JSON schema back using a GET or using the Azure Portal? I want to be able to populate a NavBar with the facetable fields without having to hard code them. Is this possible?
回答1:
You can call Get Index REST API to get the schema of an Index.
Your request URL would be:
https://[service name].search.windows.net/indexes/[index name]?api-version=[api-version]
You would need Admin Key
to authenticate the Get Index
request.
You will need to parse fields
element from the response body to get the list of all attributes of the index.
来源:https://stackoverflow.com/questions/37281251/get-index-schema-from-azure-search