Skip to content

Latest commit

 

History

History
page_type languages products
sample
python
azure
azure-search

Samples for Azure Cognitive Search client library for Python

These code samples show common scenario operations with the Azure Cognitive Search client library.

Authenticate the client with a Azure Cognitive Search API Key Credential:

https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/search/azure-search-documents/samples/sample_authentication.py (async version)

Then for common search index operations:

Prerequisites

Setup

  1. Install the Azure Cognitive Search client library for Python with pip:

    pip install azure-search-documents --pre
  2. Clone or download this repository

  3. Open this sample folder in Visual Studio Code or your IDE of choice.

Running the samples

  1. Open a terminal window and cd to the directory that the samples are saved in.
  2. Set the environment variables specified in the sample file you wish to run.
  3. Follow the usage described in the file, e.g. python sample_simple_query.py

Next steps

Check out the API reference documentation to learn more about what you can do with the Azure Cognitive Search client library.