# AzureSearch

> **Class** in `langchain_azure_ai`

📖 [View in docs](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch)

`Azure Cognitive Search` vector store.

## Signature

```python
AzureSearch(
    self,
    azure_search_endpoint: str,
    azure_search_key: Optional[str],
    index_name: str,
    embedding_function: Union[Callable, Embeddings],
    search_type: str = 'hybrid',
    semantic_configuration_name: Optional[str] = None,
    fields: Optional[List[SearchField]] = None,
    vector_search: Optional[VectorSearch] = None,
    semantic_configurations: Optional[Union[SemanticConfiguration, List[SemanticConfiguration]]] = None,
    scoring_profiles: Optional[List[ScoringProfile]] = None,
    default_scoring_profile: Optional[str] = None,
    cors_options: Optional[CorsOptions] = None,
    *,
    vector_search_dimensions: Optional[int] = None,
    additional_search_client_options: Optional[Dict[str, Any]] = None,
    azure_ad_access_token: Optional[str] = None,
    azure_credential: Optional[TokenCredential] = None,
    azure_async_credential: Optional[AsyncTokenCredential] = None,
    kwargs: Any = {},
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `azure_search_endpoint` | `str` | Yes | The endpoint URL for Azure Cognitive Search. |
| `azure_search_key` | `Optional[str]` | Yes | The API key for Azure Cognitive Search. |
| `index_name` | `str` | Yes | The name of the index to use. |
| `embedding_function` | `Union[Callable, Embeddings]` | Yes | The embedding function or object. |
| `search_type` | `str` | No | The type of search to perform (default: "hybrid"). (default: `'hybrid'`) |
| `semantic_configuration_name` | `Optional[str]` | No | Optional semantic configuration name. (default: `None`) |
| `fields` | `Optional[List[SearchField]]` | No | Optional list of search fields. (default: `None`) |
| `vector_search` | `Optional[VectorSearch]` | No | Optional vector search configuration. (default: `None`) |
| `semantic_configurations` | `Optional[Union[SemanticConfiguration, List[SemanticConfiguration]]]` | No | Optional semantic configurations. (default: `None`) |
| `scoring_profiles` | `Optional[List[ScoringProfile]]` | No | Optional scoring profiles. (default: `None`) |
| `default_scoring_profile` | `Optional[str]` | No | Optional default scoring profile. (default: `None`) |
| `cors_options` | `Optional[CorsOptions]` | No | Optional CORS options. (default: `None`) |
| `vector_search_dimensions` | `Optional[int]` | No | Optional vector search dimensions. (default: `None`) |
| `additional_search_client_options` | `Optional[Dict[str, Any]]` | No | Additional options for the search client. (default: `None`) |
| `azure_ad_access_token` | `Optional[str]` | No | Optional Azure AD access token. (default: `None`) |
| `azure_credential` | `Optional[TokenCredential]` | No | Optional Azure credential. (default: `None`) |
| `azure_async_credential` | `Optional[AsyncTokenCredential]` | No | Optional async Azure credential. (default: `None`) |
| `**kwargs` | `Any` | No | Additional keyword arguments. (default: `{}`) |

## Extends

- `VectorStore`

## Constructors

```python
__init__(
    self,
    azure_search_endpoint: str,
    azure_search_key: Optional[str],
    index_name: str,
    embedding_function: Union[Callable, Embeddings],
    search_type: str = 'hybrid',
    semantic_configuration_name: Optional[str] = None,
    fields: Optional[List[SearchField]] = None,
    vector_search: Optional[VectorSearch] = None,
    semantic_configurations: Optional[Union[SemanticConfiguration, List[SemanticConfiguration]]] = None,
    scoring_profiles: Optional[List[ScoringProfile]] = None,
    default_scoring_profile: Optional[str] = None,
    cors_options: Optional[CorsOptions] = None,
    *,
    vector_search_dimensions: Optional[int] = None,
    additional_search_client_options: Optional[Dict[str, Any]] = None,
    azure_ad_access_token: Optional[str] = None,
    azure_credential: Optional[TokenCredential] = None,
    azure_async_credential: Optional[AsyncTokenCredential] = None,
    kwargs: Any = {},
)
```

| Name | Type |
|------|------|
| `azure_search_endpoint` | `str` |
| `azure_search_key` | `Optional[str]` |
| `index_name` | `str` |
| `embedding_function` | `Union[Callable, Embeddings]` |
| `search_type` | `str` |
| `semantic_configuration_name` | `Optional[str]` |
| `fields` | `Optional[List[SearchField]]` |
| `vector_search` | `Optional[VectorSearch]` |
| `semantic_configurations` | `Optional[Union[SemanticConfiguration, List[SemanticConfiguration]]]` |
| `scoring_profiles` | `Optional[List[ScoringProfile]]` |
| `default_scoring_profile` | `Optional[str]` |
| `cors_options` | `Optional[CorsOptions]` |
| `vector_search_dimensions` | `Optional[int]` |
| `additional_search_client_options` | `Optional[Dict[str, Any]]` |
| `azure_ad_access_token` | `Optional[str]` |
| `azure_credential` | `Optional[TokenCredential]` |
| `azure_async_credential` | `Optional[AsyncTokenCredential]` |
| `kwargs` | `Any` |


## Properties

- `client`
- `async_client`
- `embedding_function`
- `embed_query`
- `search_type`
- `semantic_configuration_name`
- `fields`
- `embeddings`

## Methods

- [`add_texts()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/add_texts)
- [`aadd_texts()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/aadd_texts)
- [`add_embeddings()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/add_embeddings)
- [`aadd_embeddings()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/aadd_embeddings)
- [`delete()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/delete)
- [`adelete()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/adelete)
- [`similarity_search()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/similarity_search)
- [`similarity_search_with_score()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/similarity_search_with_score)
- [`asimilarity_search()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/asimilarity_search)
- [`asimilarity_search_with_score()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/asimilarity_search_with_score)
- [`similarity_search_with_relevance_scores()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/similarity_search_with_relevance_scores)
- [`asimilarity_search_with_relevance_scores()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/asimilarity_search_with_relevance_scores)
- [`vector_search()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/vector_search)
- [`avector_search()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/avector_search)
- [`vector_search_with_score()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/vector_search_with_score)
- [`avector_search_with_score()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/avector_search_with_score)
- [`max_marginal_relevance_search_with_score()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/max_marginal_relevance_search_with_score)
- [`amax_marginal_relevance_search_with_score()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/amax_marginal_relevance_search_with_score)
- [`hybrid_search()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/hybrid_search)
- [`ahybrid_search()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/ahybrid_search)
- [`hybrid_search_with_score()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/hybrid_search_with_score)
- [`ahybrid_search_with_score()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/ahybrid_search_with_score)
- [`hybrid_search_with_relevance_scores()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/hybrid_search_with_relevance_scores)
- [`ahybrid_search_with_relevance_scores()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/ahybrid_search_with_relevance_scores)
- [`hybrid_max_marginal_relevance_search_with_score()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/hybrid_max_marginal_relevance_search_with_score)
- [`ahybrid_max_marginal_relevance_search_with_score()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/ahybrid_max_marginal_relevance_search_with_score)
- [`semantic_hybrid_search()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/semantic_hybrid_search)
- [`asemantic_hybrid_search()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/asemantic_hybrid_search)
- [`semantic_hybrid_search_with_score()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/semantic_hybrid_search_with_score)
- [`asemantic_hybrid_search_with_score()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/asemantic_hybrid_search_with_score)
- [`semantic_hybrid_search_with_score_and_rerank()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/semantic_hybrid_search_with_score_and_rerank)
- [`asemantic_hybrid_search_with_score_and_rerank()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/asemantic_hybrid_search_with_score_and_rerank)
- [`from_texts()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/from_texts)
- [`afrom_texts()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/afrom_texts)
- [`afrom_embeddings()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/afrom_embeddings)
- [`from_embeddings()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/from_embeddings)
- [`as_retriever()`](https://reference.langchain.com/python/langchain-azure-ai/vectorstores/azuresearch/AzureSearch/as_retriever)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-azure/blob/7a6a664d617264df8dcb12fcfb1bacc09f21d504/libs/azure-ai/langchain_azure_ai/vectorstores/azuresearch.py#L284)