azure-sdk-for-python: [azure-search-documents] Generating url is not complied with standard Cognitive Search REST API
- Package Name: azure-search-documents
- Package Version: 11.4.0b6
- Operating System: WSL
- Python Version: 3.9
Describe the bug A clear and concise description of what the bug is.
Why this request url is generated to {endpoint}/indexes('{indexName}')
instead of {endpoint}/indexes/{indexName}
Since integrating Cognitive Search API as a backend API on APIM, found out it is impossible to use {endpoint}/indexes('{indexName}')
as front endpoint.
According to official REST API spec, url in SDK should be generated to {endpoint}/indexes/{indexName}
To Reproduce Steps to reproduce the behavior:
- setup APIM then make backend endpoint like
test.search.windows.net/indexes
. Front endpoint is likehttps://test.azure-api.net/indexes
- use SDK via above APIM endpoint https://aoai.azure-api.net
search_client = SearchClient(
endpoint=f"https://test.azure-api.net",
index_name=AZURE_SEARCH_INDEX,
credential=AzureKeyCredential("key"))
then call to url: https://test.azure-api.net/indexes(‘gptkb-vector’)/docs/search.post.search?api-version=2023-07-01-Preview But should be this : https://test.azure-api.net/indexes/gptkb-vector/docs/search.post.search?api-version=2023-07-01-Preview
Expected behavior A clear and concise description of what you expected to happen. SDK must follow standard spec of Cognitive Search REST API
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
Not just this version, other can be found like this issue on generating Url
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 17 (7 by maintainers)
@xiangyan99 Ah. What you’re talking about hooking was this! I’ll try your way, it will be worked. Thank you much!