Hello everyone!
I'm trying to set up a vector store within Azure Cognitive Search.
So far I created an index and added data to it, including a vectorized version of my text.
Next I want to query the index using a vector search.
To do that I followed a guide I found here:
https://learn.microsoft.com/en-us/azure/search/search-get-started-vector
POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/docs/search?api-version=2023-11-01
Content-Type: application/json
api-key: {{admin-api-key}}
{
"count": true,
"select": "HotelId, HotelName, Description, Category",
"vectors": [
{
"value": [0.01944167, 0.0040178085
. . .
010858015, -0.017496133],
"k": 7,
"fields": "DescriptionVector",
"kind": "vector",
"exhaustive": true
}
]
}
I put together a Python function using the same schema:
endpoint = f'{service_name}/indexes/test-index/docs/search?api-version={api_version}'
headers = {
'Content-Type': 'application/json',
'api-key': api_key
}
searchString = "test"
payload = {
"count": True,
"select": "DocId, DocName, description, docText",
"vectors": [
{
"value": CallOpenAI.createEmbedding(searchString),
"k": 2,
"fields": "docVector",
"kind": "vector",
"exhaustive": True
}
]
}
response = requests.post(endpoint, headers=headers, data=json.dumps(payload))
However running the query always results in this error message:
"The request is invalid. Details: The parameter 'vectors' in the request payload is not a valid parameter for the operation 'search'."
I tried both 2023-10-01-preview as well as 2023-11-01 to no avail.
I hope someone can help me figure out what I'm doing wrong.
Best regards
Ralf