Skip to content

azure-search-documents Readme and samples issues #12506

@v-xuto

Description

@v-xuto

Section Link1 and Link2:
image

Reason:
KeyError: 'hotelId', 'hotelName'.

Suggestion:

print("{}: {})".format(result["HotelId"], result["HotelName"]))

Section link:
image

Reason:
NameError: name 'client' is not defined.

Suggestion:

search_client = SearchClient(endpoint, index_name, credential=AzureKeyCredential(key))
result = search_client.upload_documents(documents=[DOCUMENT])

Section Link:
image

Suggestion:
Remove extra ';' at the end of the sentence.
4.
Section Link:
image

Reason:
AttributeError: 'SearchIndexerClient' object has no attribute 'create_datasource'.

Suggestion:

def _create_datasource():
    # Here we create a datasource. As mentioned in the description we have stored it in
    # "searchcontainer"
    ds_client = SearchIndexerClient(service_endpoint, AzureKeyCredential(key))
    container = SearchIndexerDataContainer(name='searchcontainer')
    data_source_connection = SearchIndexerDataSourceConnection(
        name="hotel-datasource",
        type="azureblob",
        connection_string=connection_string,
        container=container
    )
    result = ds_client.create_data_source_connection(data_source_connection)
    return result

Section Link:
image

Suggestion1:
Update SearchIndexerClientt to SearchIndexClient.

Suggestion2:
Update ind_client to indexers_client.

Suggestion3:
Update indexer-hotels to hotels.

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.DocsSearchblocking-releaseBlocks releaseneeds-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamtest-manual-pass

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions