Skip to content

vector field not setting to retrievable. #40604

Open
@gopesh97

Description

@gopesh97
  • Package Name: azure.search.documents
  • Package Version: 11.5.2
  • Operating System: Windows 11
  • Python Version: 3.12.9

Describe the bug
I am creating an index with a vector field, if

  1. I am instantiating the field using SearchField and passing retrievable=True, its giving me _retrievable is not a known attribute of class <class 'azure.search.documents.indexes.models.index.SearchField'> and will be ignored .
  2. I am instantiating the field using SearchableField and passing retrievable=True, its able to create an index, but when I am uploading the same docs as above, its raising an error saying The request is invalid. Details: An unexpected 'StartArray' node was found when reading from the JSON reader. A 'PrimitiveValue' node was expected.
    Code:
    Message: The request is invalid. Details: An unexpected 'StartArray' node was found when reading from the JSON reader. A 'PrimitiveValue' node was expected.
  3. Only thats working currently is that I create the field using SearchField and then manully go to the azure portal, and edit the json to make it retrievable.

To Reproduce
Steps to reproduce the behavior:

  1. Set fields and create index like
    `fields =[
    SimpleField(
    name='id',
    type=SearchFieldDataType.String,
    key=True,
    filterable=True,
    ),
    SimpleField(
    name='asset_id',
    type=SearchFieldDataType.String,
    filterable=True,
    facetable=True,
    ),
    SimpleField(
    name='version_id',
    type=SearchFieldDataType.String,
    filterable=True,
    facetable=True,
    ),
    SimpleField(
    name='cdn_download_url',
    type=SearchFieldDataType.String,
    ),
    SimpleField(
    name='fund_id',
    type=SearchFieldDataType.Collection(SearchFieldDataType.String),
    filterable=True,
    facetable=True,
    ),
    SearchableField(
    name='document_type',
    type=SearchFieldDataType.String,
    searchable=True,
    filterable=True
    ),
    SearchableField(
    name='content',
    type=SearchFieldDataType.String,
    searchable=True,
    ),
    SearchField(
    name='content_vector',
    type=SearchFieldDataType.Collection(SearchFieldDataType.Single),
    searchable=True,
    vector_search_dimensions= len(embedding("Text")),
    vector_search_profile_name="myHnswProfile",
    retrievable = True
    ),
    ]

index_name = "langchain_v3_ff_docs_test2"
semantic_configuration_name = index_name+'_semantics'

semantic_configuration = SemanticConfiguration(
name=semantic_configuration_name,
prioritized_fields=SemanticPrioritizedFields(
content_fields=[SemanticField(field_name="content"),],
title_field=SemanticField(field_name="document_type"),
),
)`

Expected behavior
I want to have the vector field retrievable.

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.SearchbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-author-feedbackWorkflow: More information is needed from author to address the issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions