GET Index Schema from Azure Search

只谈情不闲聊 提交于 2019-12-24 15:54:30

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!