Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The vector field 'Vector' must have the property 'dimensions' set #265

Open
Elizabeth819 opened this issue Aug 20, 2024 · 2 comments
Open

Comments

@Elizabeth819
Copy link

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

@HeidiSteen
Copy link
Contributor

Hi @Elizabeth819, it looks like you provided the field definition for "actionsVector", but not for "summaryVector". Or do you have have a field mapping somewhere?? (assuming indexer-based-indexing)....

@mattgotteiner
Copy link
Member

Hi @Elizabeth819, it looks like you provided the field definition for "actionsVector", but not for "summaryVector". Or do you have have a field mapping somewhere?? (assuming indexer-based-indexing)....

+1 - seeing the definition of "summaryVector" would help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants