Azure / Azure/azure-search-vector-samples
The vector field 'Vector' must have the property 'dimensions' set
- Dominant language
- Jupyter Notebook
- Stars
- 910
- Forks
- 377
- PR merge metrics
- No merged PRs in 30d
Description
code:
"name": "actionsVector",
"type": "Collection(Edm.Single)",
"searchable": True,
"retrievable": True,
**"dimensions": 3072,**
"vectorSearchProfile": "vector-profile",
service_name = "cobra-video-search-eliz"
admin_key = ""
api_version = "2024-07-01"
index_name = "complexscene_index"
# Create a SearchIndexClient to manage the index
index_client = SearchIndexClient(
endpoint=f"https://{service_name}.search.windows.net",
credential=AzureKeyCredential(admin_key),
api_version=api_version,
)
# Add IDs to documents
for i, doc in enumerate(data):
summary_vector = generate_embedding(doc['summary'])
documents.append({
"@search.action": "mergeOrUpload", #
"id": str(i),
"characters": doc.get("characters", ""),
"summary": doc.get("summary", ""),
"summaryVector": summary_vector,
"chunk_id": f"chunk_{i}"
})
# Upload documents to the index
try:
result = search_client.upload_documents(documents=documents)
error:
Failed to create or update index: (InvalidRequestParameter) The request is invalid. Details: definition : **The vector field 'summaryVector' must have the property 'dimensions' set.**
Code: InvalidRequestParameter
Message: The request is invalid. Details: definition : The vector field 'summaryVector' must have the property 'dimensions' set.
Exception Details: (InvalidField) The vector field 'summaryVector' must have the property 'dimensions' set. Parameters: definition
Code: InvalidField
Message: The vector field 'summaryVector' must have the property 'dimensions' set. Parameters: definition
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the index definition that creates the summaryVector field and compare it with the shown actionsVector definition. Confirm the vector field includes its dimensions setting, then rerun index creation to verify that the InvalidField error is gone.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, python
- Domain
- cloud, search
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100