You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/deep-dive/retrieval_models_clients/Azure.mdx
+65-5Lines changed: 65 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,32 +22,59 @@ The constructor initializes an instance of the `AzureAISearchRM` class and sets
22
22
-`search_api_key` (str): The API key for accessing the Azure AI Search service.
23
23
-`search_index_name` (str): The name of the search index in the Azure AI Search service.
24
24
-`field_text` (str): The name of the field containing text content in the search index. This field will be mapped to the "content" field in the dsp framework.
25
+
-`field_vector` (Optional[str]): The name of the field containing vector content in the search index.
25
26
-`k` (int, optional): The default number of top passages to retrieve. Defaults to 3.
27
+
-`azure_openai_client` (Optional[openai.AzureOpenAI]): An instance of the AzureOpenAI client. Either openai_client or embedding_func must be provided. Defaults to None.
28
+
-`openai_embed_model` (Optional[str]): The name of the OpenAI embedding model. Defaults to "text-embedding-ada-002".
29
+
-`embedding_func` (Optional[Callable]): A function for generating embeddings. Either openai_client or embedding_func must be provided. Defaults to None.
26
30
-`semantic_ranker` (bool, optional): Whether to use semantic ranking. Defaults to False.
27
31
-`filter` (str, optional): Additional filter query. Defaults to None.
28
32
-`query_language` (str, optional): The language of the query. Defaults to "en-Us".
29
33
-`query_speller` (str, optional): The speller mode. Defaults to "lexicon".
30
34
-`use_semantic_captions` (bool, optional): Whether to use semantic captions. Defaults to False.
31
35
-`query_type` (Optional[QueryType], optional): The type of query. Defaults to QueryType.FULL.
32
36
-`semantic_configuration_name` (str, optional): The name of the semantic configuration. Defaults to None.
37
+
-`is_vector_search` (Optional[bool]): Whether to enable vector search. Defaults to False.
38
+
-`is_hybrid_search` (Optional[bool]): Whether to enable hybrid search. Defaults to False.
39
+
-`is_fulltext_search` (Optional[bool]): Whether to enable fulltext search. Defaults to True.
40
+
-`vector_filter_mode` (Optional[VectorFilterMode]): The vector filter mode. Defaults to None.
33
41
34
-
Available Query Types:
35
42
36
-
SIMPLE
43
+
**Available Query Types:**
44
+
45
+
- SIMPLE
37
46
"""Uses the simple query syntax for searches. Search text is interpreted using a simple query
38
47
#: language that allows for symbols such as +, * and "". Queries are evaluated across all
39
48
#: searchable fields by default, unless the searchFields parameter is specified."""
40
-
FULL
49
+
- FULL
41
50
"""Uses the full Lucene query syntax for searches. Search text is interpreted using the Lucene
42
51
#: query language which allows field-specific and weighted searches, as well as other advanced
43
52
#: features."""
44
-
SEMANTIC
53
+
- SEMANTIC
45
54
"""Best suited for queries expressed in natural language as opposed to keywords. Improves
46
55
#: precision of search results by re-ranking the top search results using a ranking model trained
47
56
#: on the Web corpus.""
48
57
49
58
More Details: https://learn.microsoft.com/en-us/azure/search/search-query-overview
50
59
60
+
**Available Vector Filter Mode:**
61
+
62
+
- POST_FILTER = "postFilter"
63
+
"""The filter will be applied after the candidate set of vector results is returned. Depending on
64
+
#: the filter selectivity, this can result in fewer results than requested by the parameter 'k'."""
65
+
66
+
- PRE_FILTER = "preFilter"
67
+
"""The filter will be applied before the search query."""
68
+
69
+
More Details: https://learn.microsoft.com/en-us/azure/search/vector-search-filters
70
+
71
+
**Note**
72
+
73
+
- The `AzureAISearchRM` client allows you to perform Vector search, Hybrid search, or Full text search.
74
+
- By default, the `AzureAISearchRM` client uses the Azure OpenAI Client for generating embeddings. If you want to use something else, you can provide your custom embedding_func, but either the openai_client or embedding_func must be provided.
75
+
- If you need to enable semantic search, either with vector, hybrid, or full text search, then set the `semantic_ranker` flag to True.
76
+
- If `semantic_ranker` is True, always set the `query_type` to QueryType.SEMANTIC and always provide the `semantic_configuration_name`.
0 commit comments