'vectors' in the request payload is not a valid parameter for the operation 'search'.

Ralf A 0 Reputation points

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:

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

Azure Cognitive Search
Azure Cognitive Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
501 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ralf A 0 Reputation points

    I found the solution here:

    Instead of vectors I used this definition:

    "vectorQueries": [
          "kind": "vector",
          "vector": [
          "fields": "descriptionEmbedding",
          "k": 5,
          "exhaustive": true