The `azure-search` library (version 1.0.0b2, currently in preview) provides a client for interacting with Azure AI Search (formerly Azure Cognitive Search). It's designed for newer API versions and capabilities, distinct from the stable `azure-search-documents` library. As a preview package, it is in active development with rapid changes and is not recommended for production use. Microsoft generally releases updates to its Python SDK packages on a monthly cadence.
pip install azure-search==1.0.0b2Verified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the `SearchIndexClient` to create an index, then use `SearchClient` to upload documents and perform a basic search, and finally clean up by deleting the index. Ensure you have `SEARCH_SERVICE_ENDPOINT` (e.g., `https://<your-service-name>.search.windows.net`) and `SEARCH_ADMIN_KEY` environment variables set with your Azure AI Search service details.
For stable production use, consider `azure-search-documents` (version 11.x.x) if its features meet your requirements. Otherwise, frequently check release notes for breaking changes and pin to specific beta versions.
Always refer to the official documentation or quickstart examples for correct import paths. Do not assume the import path matches the package name directly.
Understand which library you intend to use. If you need a stable, production-ready client, use `azure-search-documents`. If you are experimenting with new features or preview API versions, use `azure-search`.
Ensure your client library version is compatible with your Azure AI Search service's API version. If encountering `HttpResponseError` with API version messages, consult the service documentation or try explicitly specifying the `api_version` parameter during client instantiation if supported by your client version.