diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index c3f792b781ad..0ec5d3323ba9 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -4,11 +4,10 @@ ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added properties to `SearchClient.search`: `semantic_configuration_name` +- Added properties to `SearchIndex`: `semantic_settings` +- Added models: `PrioritizedFields`, `SemanticConfiguration`, `SemanticField`, `SemanticSettings` +- Added new values to model `QueryLanguage` ## 11.3.0b5 (2021-11-09) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/_configuration.py index c6e1f319faca..107daacd0ac7 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/_configuration.py @@ -27,6 +27,8 @@ class SearchClientConfiguration(Configuration): :type endpoint: str :param index_name: The name of the index. :type index_name: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -36,15 +38,17 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None + super(SearchClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") if index_name is None: raise ValueError("Parameter 'index_name' must not be None.") - super(SearchClientConfiguration, self).__init__(**kwargs) self.endpoint = endpoint self.index_name = index_name - self.api_version = "2021-04-30-Preview" + self.api_version = api_version kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/_search_client.py index 05cb393cb3eb..4d7d3e06889c 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/_search_client.py @@ -31,6 +31,9 @@ class SearchClient(object): :type endpoint: str :param index_name: The name of the index. :type index_name: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -41,7 +44,7 @@ def __init__( ): # type: (...) -> None _base_url = '{endpoint}/indexes(\'{indexName}\')' - self._config = SearchClientConfiguration(endpoint, index_name, **kwargs) + self._config = SearchClientConfiguration(endpoint=endpoint, index_name=index_name, **kwargs) self._client = PipelineClient(base_url=_base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/__init__.py index ec41d54fc046..d58f5fc3b7f8 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/__init__.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/__init__.py @@ -8,3 +8,9 @@ from ._search_client import SearchClient __all__ = ['SearchClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_configuration.py index ff2480b785c2..87873ebeca2e 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_configuration.py @@ -23,6 +23,8 @@ class SearchClientConfiguration(Configuration): :type endpoint: str :param index_name: The name of the index. :type index_name: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -31,15 +33,17 @@ def __init__( index_name: str, **kwargs: Any ) -> None: + super(SearchClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") if index_name is None: raise ValueError("Parameter 'index_name' must not be None.") - super(SearchClientConfiguration, self).__init__(**kwargs) self.endpoint = endpoint self.index_name = index_name - self.api_version = "2021-04-30-Preview" + self.api_version = api_version kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_search_client.py index 5bea0add9b2b..9240fb72af20 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_search_client.py @@ -26,6 +26,9 @@ class SearchClient: :type endpoint: str :param index_name: The name of the index. :type index_name: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -35,7 +38,7 @@ def __init__( **kwargs: Any ) -> None: _base_url = '{endpoint}/indexes(\'{indexName}\')' - self._config = SearchClientConfiguration(endpoint, index_name, **kwargs) + self._config = SearchClientConfiguration(endpoint=endpoint, index_name=index_name, **kwargs) self._client = AsyncPipelineClient(base_url=_base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/operations/_documents_operations.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/operations/_documents_operations.py index faae528b930e..d75068f4b391 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/operations/_documents_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/operations/_documents_operations.py @@ -18,7 +18,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._documents_operations import build_autocomplete_get_request, build_autocomplete_post_request, build_count_request, build_get_request, build_index_request, build_search_get_request, build_search_post_request, build_suggest_get_request, build_suggest_post_request - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -54,6 +53,9 @@ async def count( :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: long, or the result of cls(response) :rtype: long @@ -65,11 +67,14 @@ async def count( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_count_request( + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.count.metadata['url'], ) @@ -115,6 +120,9 @@ async def search_get( :type search_options: ~azure.search.documents.models.SearchOptions :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchDocumentsResult, or the result of cls(response) :rtype: ~azure.search.documents.models.SearchDocumentsResult @@ -126,6 +134,8 @@ async def search_get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _include_total_result_count = None _facets = None _filter = None @@ -137,6 +147,7 @@ async def search_get( _query_type = None _scoring_parameters = None _scoring_profile = None + _semantic_configuration = None _search_fields = None _query_language = None _speller = None @@ -162,6 +173,7 @@ async def search_get( _query_type = search_options.query_type _scoring_parameters = search_options.scoring_parameters _scoring_profile = search_options.scoring_profile + _semantic_configuration = search_options.semantic_configuration _search_fields = search_options.search_fields _query_language = search_options.query_language _speller = search_options.speller @@ -178,6 +190,7 @@ async def search_get( _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_search_get_request( + api_version=api_version, search_text=search_text, include_total_result_count=_include_total_result_count, facets=_facets, @@ -190,6 +203,7 @@ async def search_get( query_type=_query_type, scoring_parameters=_scoring_parameters, scoring_profile=_scoring_profile, + semantic_configuration=_semantic_configuration, search_fields=_search_fields, query_language=_query_language, speller=_speller, @@ -243,6 +257,9 @@ async def search_post( :type search_request: ~azure.search.documents.models.SearchRequest :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchDocumentsResult, or the result of cls(response) :rtype: ~azure.search.documents.models.SearchDocumentsResult @@ -254,6 +271,7 @@ async def search_post( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -262,9 +280,10 @@ async def search_post( json = self._serialize.body(search_request, 'SearchRequest') request = build_search_post_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.search_post.metadata['url'], ) request = _convert_request(request) @@ -309,6 +328,9 @@ async def get( :type selected_fields: list[str] :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: any, or the result of cls(response) :rtype: any @@ -320,12 +342,15 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_request( key=key, + api_version=api_version, selected_fields=selected_fields, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get.metadata['url'], @@ -376,6 +401,9 @@ async def suggest_get( :type suggest_options: ~azure.search.documents.models.SuggestOptions :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SuggestDocumentsResult, or the result of cls(response) :rtype: ~azure.search.documents.models.SuggestDocumentsResult @@ -387,6 +415,8 @@ async def suggest_get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _filter = None _use_fuzzy_matching = None _highlight_post_tag = None @@ -411,6 +441,7 @@ async def suggest_get( _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_suggest_get_request( + api_version=api_version, search_text=search_text, suggester_name=suggester_name, filter=_filter, @@ -463,6 +494,9 @@ async def suggest_post( :type suggest_request: ~azure.search.documents.models.SuggestRequest :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SuggestDocumentsResult, or the result of cls(response) :rtype: ~azure.search.documents.models.SuggestDocumentsResult @@ -474,6 +508,7 @@ async def suggest_post( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -482,9 +517,10 @@ async def suggest_post( json = self._serialize.body(suggest_request, 'SuggestRequest') request = build_suggest_post_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.suggest_post.metadata['url'], ) request = _convert_request(request) @@ -525,6 +561,9 @@ async def index( :type actions: list[~azure.search.documents.models.IndexAction] :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IndexDocumentsResult, or the result of cls(response) :rtype: ~azure.search.documents.models.IndexDocumentsResult @@ -536,6 +575,7 @@ async def index( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -545,9 +585,10 @@ async def index( json = self._serialize.body(_batch, 'IndexBatch') request = build_index_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.index.metadata['url'], ) request = _convert_request(request) @@ -599,6 +640,9 @@ async def autocomplete_get( :type request_options: ~azure.search.documents.models.RequestOptions :param autocomplete_options: Parameter group. :type autocomplete_options: ~azure.search.documents.models.AutocompleteOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AutocompleteResult, or the result of cls(response) :rtype: ~azure.search.documents.models.AutocompleteResult @@ -610,6 +654,8 @@ async def autocomplete_get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None _autocomplete_mode = None _filter = None @@ -632,6 +678,7 @@ async def autocomplete_get( _top = autocomplete_options.top request = build_autocomplete_get_request( + api_version=api_version, search_text=search_text, suggester_name=suggester_name, x_ms_client_request_id=_x_ms_client_request_id, @@ -683,6 +730,9 @@ async def autocomplete_post( :type autocomplete_request: ~azure.search.documents.models.AutocompleteRequest :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AutocompleteResult, or the result of cls(response) :rtype: ~azure.search.documents.models.AutocompleteResult @@ -694,6 +744,7 @@ async def autocomplete_post( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -702,9 +753,10 @@ async def autocomplete_post( json = self._serialize.body(autocomplete_request, 'AutocompleteRequest') request = build_autocomplete_post_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.autocomplete_post.metadata['url'], ) request = _convert_request(request) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models.py index 735efd768921..20873b97a5f6 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models.py @@ -735,11 +735,21 @@ class SearchOptions(msrest.serialization.Model): :ivar scoring_profile: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. :vartype scoring_profile: str + :ivar semantic_configuration: The name of the semantic configuration that lists which fields + should be used for semantic ranking, captions, highlights, and answers. + :vartype semantic_configuration: str :ivar search_fields: The list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter. :vartype search_fields: list[str] - :ivar query_language: The language of the query. Possible values include: "none", "en-us". + :ivar query_language: The language of the query. Possible values include: "none", "en-us", + "en-gb", "en-in", "en-ca", "en-au", "fr-fr", "fr-ca", "de-de", "es-es", "es-mx", "zh-cn", + "zh-tw", "pt-br", "pt-pt", "it-it", "ja-jp", "ko-kr", "ru-ru", "cs-cz", "nl-be", "nl-nl", + "hu-hu", "pl-pl", "sv-se", "tr-tr", "hi-in", "ar-sa", "ar-eg", "ar-ma", "ar-kw", "ar-jo", + "da-dk", "no-no", "bg-bg", "hr-hr", "hr-ba", "ms-my", "ms-bn", "sl-sl", "ta-in", "vi-vn", + "el-gr", "ro-ro", "is-is", "id-id", "th-th", "lt-lt", "uk-ua", "lv-lv", "et-ee", "ca-es", + "fi-fi", "sr-ba", "sr-me", "sr-rs", "sk-sk", "nb-no", "hy-am", "bn-in", "eu-es", "gl-es", + "gu-in", "he-il", "ga-ie", "kn-in", "ml-in", "mr-in", "fa-ae", "pa-in", "te-in", "ur-pk". :vartype query_language: str or ~azure.search.documents.models.QueryLanguage :ivar speller: Improve search recall by spell-correcting individual search query terms. Possible values include: "none", "lexicon". @@ -798,6 +808,7 @@ class SearchOptions(msrest.serialization.Model): 'query_type': {'key': 'queryType', 'type': 'str'}, 'scoring_parameters': {'key': 'ScoringParameters', 'type': '[str]'}, 'scoring_profile': {'key': 'scoringProfile', 'type': 'str'}, + 'semantic_configuration': {'key': 'semanticConfiguration', 'type': 'str'}, 'search_fields': {'key': 'searchFields', 'type': '[str]'}, 'query_language': {'key': 'queryLanguage', 'type': 'str'}, 'speller': {'key': 'speller', 'type': 'str'}, @@ -860,11 +871,21 @@ def __init__( :keyword scoring_profile: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. :paramtype scoring_profile: str + :keyword semantic_configuration: The name of the semantic configuration that lists which fields + should be used for semantic ranking, captions, highlights, and answers. + :paramtype semantic_configuration: str :keyword search_fields: The list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter. :paramtype search_fields: list[str] - :keyword query_language: The language of the query. Possible values include: "none", "en-us". + :keyword query_language: The language of the query. Possible values include: "none", "en-us", + "en-gb", "en-in", "en-ca", "en-au", "fr-fr", "fr-ca", "de-de", "es-es", "es-mx", "zh-cn", + "zh-tw", "pt-br", "pt-pt", "it-it", "ja-jp", "ko-kr", "ru-ru", "cs-cz", "nl-be", "nl-nl", + "hu-hu", "pl-pl", "sv-se", "tr-tr", "hi-in", "ar-sa", "ar-eg", "ar-ma", "ar-kw", "ar-jo", + "da-dk", "no-no", "bg-bg", "hr-hr", "hr-ba", "ms-my", "ms-bn", "sl-sl", "ta-in", "vi-vn", + "el-gr", "ro-ro", "is-is", "id-id", "th-th", "lt-lt", "uk-ua", "lv-lv", "et-ee", "ca-es", + "fi-fi", "sr-ba", "sr-me", "sr-rs", "sk-sk", "nb-no", "hy-am", "bn-in", "eu-es", "gl-es", + "gu-in", "he-il", "ga-ie", "kn-in", "ml-in", "mr-in", "fa-ae", "pa-in", "te-in", "ur-pk". :paramtype query_language: str or ~azure.search.documents.models.QueryLanguage :keyword speller: Improve search recall by spell-correcting individual search query terms. Possible values include: "none", "lexicon". @@ -922,6 +943,7 @@ def __init__( self.query_type = kwargs.get('query_type', None) self.scoring_parameters = kwargs.get('scoring_parameters', None) self.scoring_profile = kwargs.get('scoring_profile', None) + self.semantic_configuration = kwargs.get('semantic_configuration', None) self.search_fields = kwargs.get('search_fields', None) self.query_language = kwargs.get('query_language', None) self.speller = kwargs.get('speller', None) @@ -994,6 +1016,9 @@ class SearchRequest(msrest.serialization.Model): :ivar scoring_profile: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. :vartype scoring_profile: str + :ivar semantic_configuration: The name of a semantic configuration that will be used when + processing documents for queries of type semantic. + :vartype semantic_configuration: str :ivar search_text: A full-text search query expression; Use "*" or omit this parameter to match all documents. :vartype search_text: str @@ -1006,7 +1031,14 @@ class SearchRequest(msrest.serialization.Model): matched in order to count the document as a match. Possible values include: "any", "all". :vartype search_mode: str or ~azure.search.documents.models.SearchMode :ivar query_language: A value that specifies the language of the search query. Possible values - include: "none", "en-us". + include: "none", "en-us", "en-gb", "en-in", "en-ca", "en-au", "fr-fr", "fr-ca", "de-de", + "es-es", "es-mx", "zh-cn", "zh-tw", "pt-br", "pt-pt", "it-it", "ja-jp", "ko-kr", "ru-ru", + "cs-cz", "nl-be", "nl-nl", "hu-hu", "pl-pl", "sv-se", "tr-tr", "hi-in", "ar-sa", "ar-eg", + "ar-ma", "ar-kw", "ar-jo", "da-dk", "no-no", "bg-bg", "hr-hr", "hr-ba", "ms-my", "ms-bn", + "sl-sl", "ta-in", "vi-vn", "el-gr", "ro-ro", "is-is", "id-id", "th-th", "lt-lt", "uk-ua", + "lv-lv", "et-ee", "ca-es", "fi-fi", "sr-ba", "sr-me", "sr-rs", "sk-sk", "nb-no", "hy-am", + "bn-in", "eu-es", "gl-es", "gu-in", "he-il", "ga-ie", "kn-in", "ml-in", "mr-in", "fa-ae", + "pa-in", "te-in", "ur-pk". :vartype query_language: str or ~azure.search.documents.models.QueryLanguage :ivar speller: A value that specified the type of the speller to use to spell-correct individual search query terms. Possible values include: "none", "lexicon". @@ -1047,6 +1079,7 @@ class SearchRequest(msrest.serialization.Model): 'session_id': {'key': 'sessionId', 'type': 'str'}, 'scoring_parameters': {'key': 'scoringParameters', 'type': '[str]'}, 'scoring_profile': {'key': 'scoringProfile', 'type': 'str'}, + 'semantic_configuration': {'key': 'semanticConfiguration', 'type': 'str'}, 'search_text': {'key': 'search', 'type': 'str'}, 'search_fields': {'key': 'searchFields', 'type': 'str'}, 'search_mode': {'key': 'searchMode', 'type': 'str'}, @@ -1121,6 +1154,9 @@ def __init__( :keyword scoring_profile: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. :paramtype scoring_profile: str + :keyword semantic_configuration: The name of a semantic configuration that will be used when + processing documents for queries of type semantic. + :paramtype semantic_configuration: str :keyword search_text: A full-text search query expression; Use "*" or omit this parameter to match all documents. :paramtype search_text: str @@ -1133,7 +1169,14 @@ def __init__( matched in order to count the document as a match. Possible values include: "any", "all". :paramtype search_mode: str or ~azure.search.documents.models.SearchMode :keyword query_language: A value that specifies the language of the search query. Possible - values include: "none", "en-us". + values include: "none", "en-us", "en-gb", "en-in", "en-ca", "en-au", "fr-fr", "fr-ca", "de-de", + "es-es", "es-mx", "zh-cn", "zh-tw", "pt-br", "pt-pt", "it-it", "ja-jp", "ko-kr", "ru-ru", + "cs-cz", "nl-be", "nl-nl", "hu-hu", "pl-pl", "sv-se", "tr-tr", "hi-in", "ar-sa", "ar-eg", + "ar-ma", "ar-kw", "ar-jo", "da-dk", "no-no", "bg-bg", "hr-hr", "hr-ba", "ms-my", "ms-bn", + "sl-sl", "ta-in", "vi-vn", "el-gr", "ro-ro", "is-is", "id-id", "th-th", "lt-lt", "uk-ua", + "lv-lv", "et-ee", "ca-es", "fi-fi", "sr-ba", "sr-me", "sr-rs", "sk-sk", "nb-no", "hy-am", + "bn-in", "eu-es", "gl-es", "gu-in", "he-il", "ga-ie", "kn-in", "ml-in", "mr-in", "fa-ae", + "pa-in", "te-in", "ur-pk". :paramtype query_language: str or ~azure.search.documents.models.QueryLanguage :keyword speller: A value that specified the type of the speller to use to spell-correct individual search query terms. Possible values include: "none", "lexicon". @@ -1173,6 +1216,7 @@ def __init__( self.session_id = kwargs.get('session_id', None) self.scoring_parameters = kwargs.get('scoring_parameters', None) self.scoring_profile = kwargs.get('scoring_profile', None) + self.semantic_configuration = kwargs.get('semantic_configuration', None) self.search_text = kwargs.get('search_text', None) self.search_fields = kwargs.get('search_fields', None) self.search_mode = kwargs.get('search_mode', None) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models_py3.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models_py3.py index 1f17711c1f28..c0d10e5b683e 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models_py3.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models_py3.py @@ -772,11 +772,21 @@ class SearchOptions(msrest.serialization.Model): :ivar scoring_profile: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. :vartype scoring_profile: str + :ivar semantic_configuration: The name of the semantic configuration that lists which fields + should be used for semantic ranking, captions, highlights, and answers. + :vartype semantic_configuration: str :ivar search_fields: The list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter. :vartype search_fields: list[str] - :ivar query_language: The language of the query. Possible values include: "none", "en-us". + :ivar query_language: The language of the query. Possible values include: "none", "en-us", + "en-gb", "en-in", "en-ca", "en-au", "fr-fr", "fr-ca", "de-de", "es-es", "es-mx", "zh-cn", + "zh-tw", "pt-br", "pt-pt", "it-it", "ja-jp", "ko-kr", "ru-ru", "cs-cz", "nl-be", "nl-nl", + "hu-hu", "pl-pl", "sv-se", "tr-tr", "hi-in", "ar-sa", "ar-eg", "ar-ma", "ar-kw", "ar-jo", + "da-dk", "no-no", "bg-bg", "hr-hr", "hr-ba", "ms-my", "ms-bn", "sl-sl", "ta-in", "vi-vn", + "el-gr", "ro-ro", "is-is", "id-id", "th-th", "lt-lt", "uk-ua", "lv-lv", "et-ee", "ca-es", + "fi-fi", "sr-ba", "sr-me", "sr-rs", "sk-sk", "nb-no", "hy-am", "bn-in", "eu-es", "gl-es", + "gu-in", "he-il", "ga-ie", "kn-in", "ml-in", "mr-in", "fa-ae", "pa-in", "te-in", "ur-pk". :vartype query_language: str or ~azure.search.documents.models.QueryLanguage :ivar speller: Improve search recall by spell-correcting individual search query terms. Possible values include: "none", "lexicon". @@ -835,6 +845,7 @@ class SearchOptions(msrest.serialization.Model): 'query_type': {'key': 'queryType', 'type': 'str'}, 'scoring_parameters': {'key': 'ScoringParameters', 'type': '[str]'}, 'scoring_profile': {'key': 'scoringProfile', 'type': 'str'}, + 'semantic_configuration': {'key': 'semanticConfiguration', 'type': 'str'}, 'search_fields': {'key': 'searchFields', 'type': '[str]'}, 'query_language': {'key': 'queryLanguage', 'type': 'str'}, 'speller': {'key': 'speller', 'type': 'str'}, @@ -863,6 +874,7 @@ def __init__( query_type: Optional[Union[str, "QueryType"]] = None, scoring_parameters: Optional[List[str]] = None, scoring_profile: Optional[str] = None, + semantic_configuration: Optional[str] = None, search_fields: Optional[List[str]] = None, query_language: Optional[Union[str, "QueryLanguage"]] = None, speller: Optional[Union[str, "Speller"]] = None, @@ -921,11 +933,21 @@ def __init__( :keyword scoring_profile: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. :paramtype scoring_profile: str + :keyword semantic_configuration: The name of the semantic configuration that lists which fields + should be used for semantic ranking, captions, highlights, and answers. + :paramtype semantic_configuration: str :keyword search_fields: The list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter. :paramtype search_fields: list[str] - :keyword query_language: The language of the query. Possible values include: "none", "en-us". + :keyword query_language: The language of the query. Possible values include: "none", "en-us", + "en-gb", "en-in", "en-ca", "en-au", "fr-fr", "fr-ca", "de-de", "es-es", "es-mx", "zh-cn", + "zh-tw", "pt-br", "pt-pt", "it-it", "ja-jp", "ko-kr", "ru-ru", "cs-cz", "nl-be", "nl-nl", + "hu-hu", "pl-pl", "sv-se", "tr-tr", "hi-in", "ar-sa", "ar-eg", "ar-ma", "ar-kw", "ar-jo", + "da-dk", "no-no", "bg-bg", "hr-hr", "hr-ba", "ms-my", "ms-bn", "sl-sl", "ta-in", "vi-vn", + "el-gr", "ro-ro", "is-is", "id-id", "th-th", "lt-lt", "uk-ua", "lv-lv", "et-ee", "ca-es", + "fi-fi", "sr-ba", "sr-me", "sr-rs", "sk-sk", "nb-no", "hy-am", "bn-in", "eu-es", "gl-es", + "gu-in", "he-il", "ga-ie", "kn-in", "ml-in", "mr-in", "fa-ae", "pa-in", "te-in", "ur-pk". :paramtype query_language: str or ~azure.search.documents.models.QueryLanguage :keyword speller: Improve search recall by spell-correcting individual search query terms. Possible values include: "none", "lexicon". @@ -983,6 +1005,7 @@ def __init__( self.query_type = query_type self.scoring_parameters = scoring_parameters self.scoring_profile = scoring_profile + self.semantic_configuration = semantic_configuration self.search_fields = search_fields self.query_language = query_language self.speller = speller @@ -1055,6 +1078,9 @@ class SearchRequest(msrest.serialization.Model): :ivar scoring_profile: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. :vartype scoring_profile: str + :ivar semantic_configuration: The name of a semantic configuration that will be used when + processing documents for queries of type semantic. + :vartype semantic_configuration: str :ivar search_text: A full-text search query expression; Use "*" or omit this parameter to match all documents. :vartype search_text: str @@ -1067,7 +1093,14 @@ class SearchRequest(msrest.serialization.Model): matched in order to count the document as a match. Possible values include: "any", "all". :vartype search_mode: str or ~azure.search.documents.models.SearchMode :ivar query_language: A value that specifies the language of the search query. Possible values - include: "none", "en-us". + include: "none", "en-us", "en-gb", "en-in", "en-ca", "en-au", "fr-fr", "fr-ca", "de-de", + "es-es", "es-mx", "zh-cn", "zh-tw", "pt-br", "pt-pt", "it-it", "ja-jp", "ko-kr", "ru-ru", + "cs-cz", "nl-be", "nl-nl", "hu-hu", "pl-pl", "sv-se", "tr-tr", "hi-in", "ar-sa", "ar-eg", + "ar-ma", "ar-kw", "ar-jo", "da-dk", "no-no", "bg-bg", "hr-hr", "hr-ba", "ms-my", "ms-bn", + "sl-sl", "ta-in", "vi-vn", "el-gr", "ro-ro", "is-is", "id-id", "th-th", "lt-lt", "uk-ua", + "lv-lv", "et-ee", "ca-es", "fi-fi", "sr-ba", "sr-me", "sr-rs", "sk-sk", "nb-no", "hy-am", + "bn-in", "eu-es", "gl-es", "gu-in", "he-il", "ga-ie", "kn-in", "ml-in", "mr-in", "fa-ae", + "pa-in", "te-in", "ur-pk". :vartype query_language: str or ~azure.search.documents.models.QueryLanguage :ivar speller: A value that specified the type of the speller to use to spell-correct individual search query terms. Possible values include: "none", "lexicon". @@ -1108,6 +1141,7 @@ class SearchRequest(msrest.serialization.Model): 'session_id': {'key': 'sessionId', 'type': 'str'}, 'scoring_parameters': {'key': 'scoringParameters', 'type': '[str]'}, 'scoring_profile': {'key': 'scoringProfile', 'type': 'str'}, + 'semantic_configuration': {'key': 'semanticConfiguration', 'type': 'str'}, 'search_text': {'key': 'search', 'type': 'str'}, 'search_fields': {'key': 'searchFields', 'type': 'str'}, 'search_mode': {'key': 'searchMode', 'type': 'str'}, @@ -1137,6 +1171,7 @@ def __init__( session_id: Optional[str] = None, scoring_parameters: Optional[List[str]] = None, scoring_profile: Optional[str] = None, + semantic_configuration: Optional[str] = None, search_text: Optional[str] = None, search_fields: Optional[str] = None, search_mode: Optional[Union[str, "SearchMode"]] = None, @@ -1207,6 +1242,9 @@ def __init__( :keyword scoring_profile: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. :paramtype scoring_profile: str + :keyword semantic_configuration: The name of a semantic configuration that will be used when + processing documents for queries of type semantic. + :paramtype semantic_configuration: str :keyword search_text: A full-text search query expression; Use "*" or omit this parameter to match all documents. :paramtype search_text: str @@ -1219,7 +1257,14 @@ def __init__( matched in order to count the document as a match. Possible values include: "any", "all". :paramtype search_mode: str or ~azure.search.documents.models.SearchMode :keyword query_language: A value that specifies the language of the search query. Possible - values include: "none", "en-us". + values include: "none", "en-us", "en-gb", "en-in", "en-ca", "en-au", "fr-fr", "fr-ca", "de-de", + "es-es", "es-mx", "zh-cn", "zh-tw", "pt-br", "pt-pt", "it-it", "ja-jp", "ko-kr", "ru-ru", + "cs-cz", "nl-be", "nl-nl", "hu-hu", "pl-pl", "sv-se", "tr-tr", "hi-in", "ar-sa", "ar-eg", + "ar-ma", "ar-kw", "ar-jo", "da-dk", "no-no", "bg-bg", "hr-hr", "hr-ba", "ms-my", "ms-bn", + "sl-sl", "ta-in", "vi-vn", "el-gr", "ro-ro", "is-is", "id-id", "th-th", "lt-lt", "uk-ua", + "lv-lv", "et-ee", "ca-es", "fi-fi", "sr-ba", "sr-me", "sr-rs", "sk-sk", "nb-no", "hy-am", + "bn-in", "eu-es", "gl-es", "gu-in", "he-il", "ga-ie", "kn-in", "ml-in", "mr-in", "fa-ae", + "pa-in", "te-in", "ur-pk". :paramtype query_language: str or ~azure.search.documents.models.QueryLanguage :keyword speller: A value that specified the type of the speller to use to spell-correct individual search query terms. Possible values include: "none", "lexicon". @@ -1259,6 +1304,7 @@ def __init__( self.session_id = session_id self.scoring_parameters = scoring_parameters self.scoring_profile = scoring_profile + self.semantic_configuration = semantic_configuration self.search_text = search_text self.search_fields = search_fields self.search_mode = search_mode diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_search_client_enums.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_search_client_enums.py index 5a07c4944d99..195a9888a855 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_search_client_enums.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_search_client_enums.py @@ -97,8 +97,148 @@ class QueryLanguage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Query language not specified. NONE = "none" - #: English. + #: Query language value for English (United States). EN_US = "en-us" + #: Query language value for English (Great Britain). + EN_GB = "en-gb" + #: Query language value for English (India). + EN_IN = "en-in" + #: Query language value for English (Canada). + EN_CA = "en-ca" + #: Query language value for English (Australia). + EN_AU = "en-au" + #: Query language value for French (France). + FR_FR = "fr-fr" + #: Query language value for French (Canada). + FR_CA = "fr-ca" + #: Query language value for German (Germany). + DE_DE = "de-de" + #: Query language value for Spanish (Spain). + ES_ES = "es-es" + #: Query language value for Spanish (Mexico). + ES_MX = "es-mx" + #: Query language value for Chinese (China). + ZH_CN = "zh-cn" + #: Query language value for Chinese (Taiwan). + ZH_TW = "zh-tw" + #: Query language value for Portuguese (Brazil). + PT_BR = "pt-br" + #: Query language value for Portuguese (Portugal). + PT_PT = "pt-pt" + #: Query language value for Italian (Italy). + IT_IT = "it-it" + #: Query language value for Japanese (Japan). + JA_JP = "ja-jp" + #: Query language value for Korean (Korea). + KO_KR = "ko-kr" + #: Query language value for Russian (Russia). + RU_RU = "ru-ru" + #: Query language value for Czech (Czech Republic). + CS_CZ = "cs-cz" + #: Query language value for Dutch (Belgium). + NL_BE = "nl-be" + #: Query language value for Dutch (Netherlands). + NL_NL = "nl-nl" + #: Query language value for Hungarian (Hungary). + HU_HU = "hu-hu" + #: Query language value for Polish (Poland). + PL_PL = "pl-pl" + #: Query language value for Swedish (Sweden). + SV_SE = "sv-se" + #: Query language value for Turkish (Turkey). + TR_TR = "tr-tr" + #: Query language value for Hindi (India). + HI_IN = "hi-in" + #: Query language value for Arabic (Saudi Arabia). + AR_SA = "ar-sa" + #: Query language value for Arabic (Egypt). + AR_EG = "ar-eg" + #: Query language value for Arabic (Morocco). + AR_MA = "ar-ma" + #: Query language value for Arabic (Kuwait). + AR_KW = "ar-kw" + #: Query language value for Arabic (Jordan). + AR_JO = "ar-jo" + #: Query language value for Danish (Denmark). + DA_DK = "da-dk" + #: Query language value for Norwegian (Normway). + NO_NO = "no-no" + #: Query language value for Bulgarian (Bulgary). + BG_BG = "bg-bg" + #: Query language value for Croatian (Croatia). + HR_HR = "hr-hr" + #: Query language value for Croatian (Bosnia and Herzegovina). + HR_BA = "hr-ba" + #: Query language value for Malay (Malaysia). + MS_MY = "ms-my" + #: Query language value for Malay (Brunei Darussalam). + MS_BN = "ms-bn" + #: Query language value for Slovenian (Slovenia). + SL_SL = "sl-sl" + #: Query language value for Tamil (India). + TA_IN = "ta-in" + #: Query language value for Vietnamese (Viet Nam). + VI_VN = "vi-vn" + #: Query language value for Greek (Greece). + EL_GR = "el-gr" + #: Query language value for Romanian (Romania). + RO_RO = "ro-ro" + #: Query language value for Icelandic (Iceland). + IS_IS = "is-is" + #: Query language value for Indonesian (Indonesia). + ID_ID = "id-id" + #: Query language value for Thai (Thailand). + TH_TH = "th-th" + #: Query language value for Lithuanian (Lithuania). + LT_LT = "lt-lt" + #: Query language value for Ukrainian (Ukraine). + UK_UA = "uk-ua" + #: Query language value for Latvian (Latvia). + LV_LV = "lv-lv" + #: Query language value for Estonian (Estonia). + ET_EE = "et-ee" + #: Query language value for Catalan (Spain). + CA_ES = "ca-es" + #: Query language value for Finnish (Finland). + FI_FI = "fi-fi" + #: Query language value for Serbian (Bosnia and Herzegovina). + SR_BA = "sr-ba" + #: Query language value for Serbian (Montenegro). + SR_ME = "sr-me" + #: Query language value for Serbian (Serbia). + SR_RS = "sr-rs" + #: Query language value for Slovak (Slovakia). + SK_SK = "sk-sk" + #: Query language value for Norwegian (Norway). + NB_NO = "nb-no" + #: Query language value for Armenian (Armenia). + HY_AM = "hy-am" + #: Query language value for Bengali (India). + BN_IN = "bn-in" + #: Query language value for Basque (Spain). + EU_ES = "eu-es" + #: Query language value for Galician (Spain). + GL_ES = "gl-es" + #: Query language value for Gujarati (India). + GU_IN = "gu-in" + #: Query language value for Hebrew (Israel). + HE_IL = "he-il" + #: Query language value for Irish (Ireland). + GA_IE = "ga-ie" + #: Query language value for Kannada (India). + KN_IN = "kn-in" + #: Query language value for Malayalam (India). + ML_IN = "ml-in" + #: Query language value for Marathi (India). + MR_IN = "mr-in" + #: Query language value for Persian (U.A.E.). + FA_AE = "fa-ae" + #: Query language value for Punjabi (India). + PA_IN = "pa-in" + #: Query language value for Telugu (India). + TE_IN = "te-in" + #: Query language value for Urdu (Pakistan). + UR_PK = "ur-pk" class QuerySpellerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Improve search recall by spell-correcting individual search query terms. diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/operations/_documents_operations.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/operations/_documents_operations.py index be94d149dd8e..f562610c4f7c 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/operations/_documents_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/operations/_documents_operations.py @@ -22,20 +22,20 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False # fmt: off def build_count_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/docs/$count') @@ -63,6 +63,7 @@ def build_search_get_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str search_text = kwargs.pop('search_text', None) # type: Optional[str] include_total_result_count = kwargs.pop('include_total_result_count', None) # type: Optional[bool] facets = kwargs.pop('facets', None) # type: Optional[List[str]] @@ -75,6 +76,7 @@ def build_search_get_request( query_type = kwargs.pop('query_type', None) # type: Optional[Union[str, "_models.QueryType"]] scoring_parameters = kwargs.pop('scoring_parameters', None) # type: Optional[List[str]] scoring_profile = kwargs.pop('scoring_profile', None) # type: Optional[str] + semantic_configuration = kwargs.pop('semantic_configuration', None) # type: Optional[str] search_fields = kwargs.pop('search_fields', None) # type: Optional[List[str]] query_language = kwargs.pop('query_language', None) # type: Optional[Union[str, "_models.QueryLanguage"]] speller = kwargs.pop('speller', None) # type: Optional[Union[str, "_models.Speller"]] @@ -89,7 +91,6 @@ def build_search_get_request( semantic_fields = kwargs.pop('semantic_fields', None) # type: Optional[List[str]] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/docs') @@ -120,6 +121,8 @@ def build_search_get_request( query_parameters['scoringParameter'] = [_SERIALIZER.query("scoring_parameters", q, 'str') if q is not None else '' for q in scoring_parameters] if scoring_profile is not None: query_parameters['scoringProfile'] = _SERIALIZER.query("scoring_profile", scoring_profile, 'str') + if semantic_configuration is not None: + query_parameters['semanticConfiguration'] = _SERIALIZER.query("semantic_configuration", semantic_configuration, 'str') if search_fields is not None: query_parameters['searchFields'] = _SERIALIZER.query("search_fields", search_fields, '[str]', div=',') if query_language is not None: @@ -165,10 +168,10 @@ def build_search_post_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/docs/search.post.search') @@ -199,10 +202,10 @@ def build_get_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str selected_fields = kwargs.pop('selected_fields', None) # type: Optional[List[str]] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/docs(\'{key}\')') @@ -237,6 +240,7 @@ def build_suggest_get_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str search_text = kwargs.pop('search_text') # type: str suggester_name = kwargs.pop('suggester_name') # type: str filter = kwargs.pop('filter', None) # type: Optional[str] @@ -250,7 +254,6 @@ def build_suggest_get_request( top = kwargs.pop('top', None) # type: Optional[int] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/docs/search.suggest') @@ -298,10 +301,10 @@ def build_suggest_post_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/docs/search.post.suggest') @@ -331,10 +334,10 @@ def build_index_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/docs/search.index') @@ -364,6 +367,7 @@ def build_autocomplete_get_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str search_text = kwargs.pop('search_text') # type: str suggester_name = kwargs.pop('suggester_name') # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] @@ -376,7 +380,6 @@ def build_autocomplete_get_request( search_fields = kwargs.pop('search_fields', None) # type: Optional[List[str]] top = kwargs.pop('top', None) # type: Optional[int] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/docs/search.autocomplete') @@ -422,10 +425,10 @@ def build_autocomplete_post_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/docs/search.post.autocomplete') @@ -484,6 +487,9 @@ def count( :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: long, or the result of cls(response) :rtype: long @@ -495,11 +501,14 @@ def count( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_count_request( + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.count.metadata['url'], ) @@ -546,6 +555,9 @@ def search_get( :type search_options: ~azure.search.documents.models.SearchOptions :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchDocumentsResult, or the result of cls(response) :rtype: ~azure.search.documents.models.SearchDocumentsResult @@ -557,6 +569,8 @@ def search_get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _include_total_result_count = None _facets = None _filter = None @@ -568,6 +582,7 @@ def search_get( _query_type = None _scoring_parameters = None _scoring_profile = None + _semantic_configuration = None _search_fields = None _query_language = None _speller = None @@ -593,6 +608,7 @@ def search_get( _query_type = search_options.query_type _scoring_parameters = search_options.scoring_parameters _scoring_profile = search_options.scoring_profile + _semantic_configuration = search_options.semantic_configuration _search_fields = search_options.search_fields _query_language = search_options.query_language _speller = search_options.speller @@ -609,6 +625,7 @@ def search_get( _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_search_get_request( + api_version=api_version, search_text=search_text, include_total_result_count=_include_total_result_count, facets=_facets, @@ -621,6 +638,7 @@ def search_get( query_type=_query_type, scoring_parameters=_scoring_parameters, scoring_profile=_scoring_profile, + semantic_configuration=_semantic_configuration, search_fields=_search_fields, query_language=_query_language, speller=_speller, @@ -675,6 +693,9 @@ def search_post( :type search_request: ~azure.search.documents.models.SearchRequest :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchDocumentsResult, or the result of cls(response) :rtype: ~azure.search.documents.models.SearchDocumentsResult @@ -686,6 +707,7 @@ def search_post( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -694,9 +716,10 @@ def search_post( json = self._serialize.body(search_request, 'SearchRequest') request = build_search_post_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.search_post.metadata['url'], ) request = _convert_request(request) @@ -742,6 +765,9 @@ def get( :type selected_fields: list[str] :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: any, or the result of cls(response) :rtype: any @@ -753,12 +779,15 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_request( key=key, + api_version=api_version, selected_fields=selected_fields, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get.metadata['url'], @@ -810,6 +839,9 @@ def suggest_get( :type suggest_options: ~azure.search.documents.models.SuggestOptions :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SuggestDocumentsResult, or the result of cls(response) :rtype: ~azure.search.documents.models.SuggestDocumentsResult @@ -821,6 +853,8 @@ def suggest_get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _filter = None _use_fuzzy_matching = None _highlight_post_tag = None @@ -845,6 +879,7 @@ def suggest_get( _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_suggest_get_request( + api_version=api_version, search_text=search_text, suggester_name=suggester_name, filter=_filter, @@ -898,6 +933,9 @@ def suggest_post( :type suggest_request: ~azure.search.documents.models.SuggestRequest :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SuggestDocumentsResult, or the result of cls(response) :rtype: ~azure.search.documents.models.SuggestDocumentsResult @@ -909,6 +947,7 @@ def suggest_post( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -917,9 +956,10 @@ def suggest_post( json = self._serialize.body(suggest_request, 'SuggestRequest') request = build_suggest_post_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.suggest_post.metadata['url'], ) request = _convert_request(request) @@ -961,6 +1001,9 @@ def index( :type actions: list[~azure.search.documents.models.IndexAction] :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IndexDocumentsResult, or the result of cls(response) :rtype: ~azure.search.documents.models.IndexDocumentsResult @@ -972,6 +1015,7 @@ def index( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -981,9 +1025,10 @@ def index( json = self._serialize.body(_batch, 'IndexBatch') request = build_index_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.index.metadata['url'], ) request = _convert_request(request) @@ -1036,6 +1081,9 @@ def autocomplete_get( :type request_options: ~azure.search.documents.models.RequestOptions :param autocomplete_options: Parameter group. :type autocomplete_options: ~azure.search.documents.models.AutocompleteOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AutocompleteResult, or the result of cls(response) :rtype: ~azure.search.documents.models.AutocompleteResult @@ -1047,6 +1095,8 @@ def autocomplete_get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None _autocomplete_mode = None _filter = None @@ -1069,6 +1119,7 @@ def autocomplete_get( _top = autocomplete_options.top request = build_autocomplete_get_request( + api_version=api_version, search_text=search_text, suggester_name=suggester_name, x_ms_client_request_id=_x_ms_client_request_id, @@ -1121,6 +1172,9 @@ def autocomplete_post( :type autocomplete_request: ~azure.search.documents.models.AutocompleteRequest :param request_options: Parameter group. :type request_options: ~azure.search.documents.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AutocompleteResult, or the result of cls(response) :rtype: ~azure.search.documents.models.AutocompleteResult @@ -1132,6 +1186,7 @@ def autocomplete_post( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -1140,9 +1195,10 @@ def autocomplete_post( json = self._serialize.body(autocomplete_request, 'AutocompleteRequest') request = build_autocomplete_post_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.autocomplete_post.metadata['url'], ) request = _convert_request(request) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_search_client.py index d7801844bb31..09e2bbee6f4e 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_search_client.py @@ -197,8 +197,14 @@ def search(self, search_text, **kwargs): # pylint:disable=too-many-locals :keyword search_mode: A value that specifies whether any or all of the search terms must be matched in order to count the document as a match. Possible values include: 'any', 'all'. :paramtype search_mode: str or ~azure.search.documents.models.SearchMode - :keyword query_language: A value that specifies the language of the search query. Possible values - include: "none", "en-us". + :keyword query_language: The language of the search query. Possible values include: "none", "en-us", + "en-gb", "en-in", "en-ca", "en-au", "fr-fr", "fr-ca", "de-de", "es-es", "es-mx", "zh-cn", + "zh-tw", "pt-br", "pt-pt", "it-it", "ja-jp", "ko-kr", "ru-ru", "cs-cz", "nl-be", "nl-nl", + "hu-hu", "pl-pl", "sv-se", "tr-tr", "hi-in", "ar-sa", "ar-eg", "ar-ma", "ar-kw", "ar-jo", + "da-dk", "no-no", "bg-bg", "hr-hr", "hr-ba", "ms-my", "ms-bn", "sl-sl", "ta-in", "vi-vn", + "el-gr", "ro-ro", "is-is", "id-id", "th-th", "lt-lt", "uk-ua", "lv-lv", "et-ee", "ca-es", + "fi-fi", "sr-ba", "sr-me", "sr-rs", "sk-sk", "nb-no", "hy-am", "bn-in", "eu-es", "gl-es", + "gu-in", "he-il", "ga-ie", "kn-in", "ml-in", "mr-in", "fa-ae", "pa-in", "te-in", "ur-pk". :paramtype query_language: str or ~azure.search.documents.models.QueryLanguage :keyword query_speller: A value that specified the type of the speller to use to spell-correct individual search query terms. Possible values include: "none", "lexicon". @@ -217,6 +223,9 @@ def search(self, search_text, **kwargs): # pylint:disable=too-many-locals query caption is set to 'extractive'. Determines whether highlighting is enabled. Defaults to 'true'. :keyword list[str] semantic_fields: The list of field names used for semantic search. + :keyword semantic_configuration_name: The name of the semantic configuration that will be used when + processing documents for queries of type semantic. + :paramtype semantic_configuration_name: str :keyword list[str] select: The list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included. :keyword int skip: The number of search results to skip. This value cannot be greater than 100,000. @@ -302,6 +311,7 @@ def search(self, search_text, **kwargs): # pylint:disable=too-many-locals ) semantic_fields = kwargs.pop("semantic_fields", None) + semantic_configuration = kwargs.pop("semantic_configuration_name", None) query = SearchQuery( search_text=search_text, @@ -323,6 +333,7 @@ def search(self, search_text, **kwargs): # pylint:disable=too-many-locals answers=answers, captions=captions, semantic_fields=",".join(semantic_fields) if semantic_fields else None, + semantic_configuration=semantic_configuration, select=select if isinstance(select, six.string_types) else None, skip=skip, top=top, diff --git a/sdk/search/azure-search-documents/azure/search/documents/aio/_search_client_async.py b/sdk/search/azure-search-documents/azure/search/documents/aio/_search_client_async.py index fafa78592533..d3c4af8cc4f4 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/aio/_search_client_async.py +++ b/sdk/search/azure-search-documents/azure/search/documents/aio/_search_client_async.py @@ -175,8 +175,14 @@ async def search(self, search_text, **kwargs): # pylint:disable=too-many-locals :keyword search_mode: A value that specifies whether any or all of the search terms must be matched in order to count the document as a match. Possible values include: 'any', 'all'. :paramtype search_mode: str or ~azure.search.documents.models.SearchMode - :keyword query_language: A value that specifies the language of the search query. Possible values - include: "none", "en-us". + :keyword query_language: The language of the search query. Possible values include: "none", "en-us", + "en-gb", "en-in", "en-ca", "en-au", "fr-fr", "fr-ca", "de-de", "es-es", "es-mx", "zh-cn", + "zh-tw", "pt-br", "pt-pt", "it-it", "ja-jp", "ko-kr", "ru-ru", "cs-cz", "nl-be", "nl-nl", + "hu-hu", "pl-pl", "sv-se", "tr-tr", "hi-in", "ar-sa", "ar-eg", "ar-ma", "ar-kw", "ar-jo", + "da-dk", "no-no", "bg-bg", "hr-hr", "hr-ba", "ms-my", "ms-bn", "sl-sl", "ta-in", "vi-vn", + "el-gr", "ro-ro", "is-is", "id-id", "th-th", "lt-lt", "uk-ua", "lv-lv", "et-ee", "ca-es", + "fi-fi", "sr-ba", "sr-me", "sr-rs", "sk-sk", "nb-no", "hy-am", "bn-in", "eu-es", "gl-es", + "gu-in", "he-il", "ga-ie", "kn-in", "ml-in", "mr-in", "fa-ae", "pa-in", "te-in", "ur-pk". :paramtype query_language: str or ~azure.search.documents.models.QueryLanguage :keyword query_speller: A value that specified the type of the speller to use to spell-correct individual search query terms. Possible values include: "none", "lexicon". @@ -196,6 +202,9 @@ async def search(self, search_text, **kwargs): # pylint:disable=too-many-locals query caption is set to 'extractive'. Determines whether highlighting is enabled. Defaults to 'true'. :keyword list[str] semantic_fields: The list of field names used for semantic search. + :keyword semantic_configuration_name: The name of the semantic configuration that will be used when + processing documents for queries of type semantic. + :paramtype semantic_configuration_name: str :keyword list[str] select: The list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included. :keyword int skip: The number of search results to skip. This value cannot be greater than 100,000. @@ -282,6 +291,7 @@ async def search(self, search_text, **kwargs): # pylint:disable=too-many-locals ) semantic_fields = kwargs.pop("semantic_fields", None) + semantic_configuration = kwargs.pop("semantic_configuration_name", None) query = SearchQuery( search_text=search_text, @@ -303,6 +313,7 @@ async def search(self, search_text, **kwargs): # pylint:disable=too-many-locals answers=answers, captions=captions, semantic_fields=",".join(semantic_fields) if semantic_fields else None, + semantic_configuration=semantic_configuration, select=select if isinstance(select, six.string_types) else None, skip=skip, top=top, diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_configuration.py index 5970e89273a9..4b0f2e1c7405 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_configuration.py @@ -25,6 +25,8 @@ class SearchClientConfiguration(Configuration): :param endpoint: The endpoint URL of the search service. :type endpoint: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -33,12 +35,14 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None + super(SearchClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") - super(SearchClientConfiguration, self).__init__(**kwargs) self.endpoint = endpoint - self.api_version = "2021-04-30-Preview" + self.api_version = api_version kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_search_client.py index 23bef882f6a4..41531631c529 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_search_client.py @@ -37,6 +37,9 @@ class SearchClient(SearchClientOperationsMixin): :vartype indexes: azure.search.documents.indexes.operations.IndexesOperations :param endpoint: The endpoint URL of the search service. :type endpoint: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -46,7 +49,7 @@ def __init__( ): # type: (...) -> None _base_url = '{endpoint}' - self._config = SearchClientConfiguration(endpoint, **kwargs) + self._config = SearchClientConfiguration(endpoint=endpoint, **kwargs) self._client = PipelineClient(base_url=_base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/__init__.py index ec41d54fc046..d58f5fc3b7f8 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/__init__.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/__init__.py @@ -8,3 +8,9 @@ from ._search_client import SearchClient __all__ = ['SearchClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_configuration.py index 6406a91d32e3..08da048dba6a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_configuration.py @@ -21,6 +21,8 @@ class SearchClientConfiguration(Configuration): :param endpoint: The endpoint URL of the search service. :type endpoint: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -28,12 +30,14 @@ def __init__( endpoint: str, **kwargs: Any ) -> None: + super(SearchClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") - super(SearchClientConfiguration, self).__init__(**kwargs) self.endpoint = endpoint - self.api_version = "2021-04-30-Preview" + self.api_version = api_version kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_search_client.py index 98dc5ee13869..ec1bfde29817 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_search_client.py @@ -32,6 +32,9 @@ class SearchClient(SearchClientOperationsMixin): :vartype indexes: azure.search.documents.indexes.aio.operations.IndexesOperations :param endpoint: The endpoint URL of the search service. :type endpoint: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -40,7 +43,7 @@ def __init__( **kwargs: Any ) -> None: _base_url = '{endpoint}' - self._config = SearchClientConfiguration(endpoint, **kwargs) + self._config = SearchClientConfiguration(endpoint=endpoint, **kwargs) self._client = AsyncPipelineClient(base_url=_base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_data_sources_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_data_sources_operations.py index b2f776ae8c12..96bea2a16fd5 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_data_sources_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_data_sources_operations.py @@ -18,7 +18,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._data_sources_operations import build_create_or_update_request, build_create_request, build_delete_request, build_get_request, build_list_request - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,6 +70,13 @@ async def create_or_update( :type skip_indexer_reset_requirement_for_cache: bool :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword prefer: For HTTP PUT requests, instructs the service to return the created/updated + resource on success. The default value is "return=representation". Note that overriding this + default value may result in unsupported behavior. + :paramtype prefer: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerDataSource, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSource @@ -82,6 +88,8 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + prefer = kwargs.pop('prefer', "return=representation") # type: str + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -91,12 +99,14 @@ async def create_or_update( request = build_create_or_update_request( data_source_name=data_source_name, + prefer=prefer, + api_version=api_version, content_type=content_type, + json=json, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, skip_indexer_reset_requirement_for_cache=skip_indexer_reset_requirement_for_cache, - json=json, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) @@ -148,6 +158,9 @@ async def delete( :type if_none_match: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -159,12 +172,15 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_delete_request( data_source_name=data_source_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, @@ -203,6 +219,9 @@ async def get( :type data_source_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerDataSource, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSource @@ -214,12 +233,15 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_request( data_source_name=data_source_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get.metadata['url'], ) @@ -262,6 +284,9 @@ async def list( :type select: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListDataSourcesResult, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.ListDataSourcesResult @@ -273,11 +298,14 @@ async def list( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_list_request( + api_version=api_version, select=select, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.list.metadata['url'], @@ -319,6 +347,9 @@ async def create( :type data_source: ~azure.search.documents.indexes.models.SearchIndexerDataSource :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerDataSource, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSource @@ -330,6 +361,7 @@ async def create( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -338,9 +370,10 @@ async def create( json = self._serialize.body(data_source, 'SearchIndexerDataSource') request = build_create_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.create.metadata['url'], ) request = _convert_request(request) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexers_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexers_operations.py index fd8df28bdb71..cd335404eb7a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexers_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexers_operations.py @@ -18,7 +18,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._indexers_operations import build_create_or_update_request, build_create_request, build_delete_request, build_get_request, build_get_status_request, build_list_request, build_reset_docs_request, build_reset_request, build_run_request - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,6 +56,9 @@ async def reset( :type indexer_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -68,12 +70,15 @@ async def reset( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_reset_request( indexer_name=indexer_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.reset.metadata['url'], ) @@ -117,6 +122,9 @@ async def reset_docs( :type keys_or_ids: ~azure.search.documents.indexes.models.DocumentKeysOrIds :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -128,6 +136,7 @@ async def reset_docs( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -140,10 +149,11 @@ async def reset_docs( request = build_reset_docs_request( indexer_name=indexer_name, + api_version=api_version, content_type=content_type, + json=json, overwrite=overwrite, x_ms_client_request_id=_x_ms_client_request_id, - json=json, template_url=self.reset_docs.metadata['url'], ) request = _convert_request(request) @@ -179,6 +189,9 @@ async def run( :type indexer_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -190,12 +203,15 @@ async def run( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_run_request( indexer_name=indexer_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.run.metadata['url'], ) @@ -250,6 +266,13 @@ async def create_or_update( :type disable_cache_reprocessing_change_detection: bool :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword prefer: For HTTP PUT requests, instructs the service to return the created/updated + resource on success. The default value is "return=representation". Note that overriding this + default value may result in unsupported behavior. + :paramtype prefer: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexer, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexer @@ -261,6 +284,8 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + prefer = kwargs.pop('prefer', "return=representation") # type: str + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -270,13 +295,15 @@ async def create_or_update( request = build_create_or_update_request( indexer_name=indexer_name, + prefer=prefer, + api_version=api_version, content_type=content_type, + json=json, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, skip_indexer_reset_requirement_for_cache=skip_indexer_reset_requirement_for_cache, disable_cache_reprocessing_change_detection=disable_cache_reprocessing_change_detection, - json=json, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) @@ -328,6 +355,9 @@ async def delete( :type if_none_match: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -339,12 +369,15 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_delete_request( indexer_name=indexer_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, @@ -383,6 +416,9 @@ async def get( :type indexer_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexer, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexer @@ -394,12 +430,15 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_request( indexer_name=indexer_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get.metadata['url'], ) @@ -442,6 +481,9 @@ async def list( :type select: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListIndexersResult, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.ListIndexersResult @@ -453,11 +495,14 @@ async def list( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_list_request( + api_version=api_version, select=select, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.list.metadata['url'], @@ -499,6 +544,9 @@ async def create( :type indexer: ~azure.search.documents.indexes.models.SearchIndexer :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexer, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexer @@ -510,6 +558,7 @@ async def create( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -518,9 +567,10 @@ async def create( json = self._serialize.body(indexer, 'SearchIndexer') request = build_create_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.create.metadata['url'], ) request = _convert_request(request) @@ -560,6 +610,9 @@ async def get_status( :type indexer_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerStatus, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexerStatus @@ -571,12 +624,15 @@ async def get_status( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_status_request( indexer_name=indexer_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get_status.metadata['url'], ) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexes_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexes_operations.py index eb788bd34818..c886eb4d9b9f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexes_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexes_operations.py @@ -20,7 +20,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._indexes_operations import build_analyze_request, build_create_or_update_request, build_create_request, build_delete_request, build_get_request, build_get_statistics_request, build_list_request - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -59,6 +58,9 @@ async def create( :type index: ~azure.search.documents.indexes.models.SearchIndex :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndex, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndex @@ -70,6 +72,7 @@ async def create( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -78,9 +81,10 @@ async def create( json = self._serialize.body(index, 'SearchIndex') request = build_create_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.create.metadata['url'], ) request = _convert_request(request) @@ -122,12 +126,17 @@ def list( :type select: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListIndexesResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models.ListIndexesResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListIndexesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -140,6 +149,7 @@ def prepare_request(next_link=None): _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_list_request( + api_version=api_version, select=select, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.list.metadata['url'], @@ -156,6 +166,7 @@ def prepare_request(next_link=None): _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_list_request( + api_version=api_version, select=select, x_ms_client_request_id=_x_ms_client_request_id, template_url=next_link, @@ -229,6 +240,13 @@ async def create_or_update( :type if_none_match: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword prefer: For HTTP PUT requests, instructs the service to return the created/updated + resource on success. The default value is "return=representation". Note that overriding this + default value may result in unsupported behavior. + :paramtype prefer: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndex, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndex @@ -240,6 +258,8 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + prefer = kwargs.pop('prefer', "return=representation") # type: str + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -249,12 +269,14 @@ async def create_or_update( request = build_create_or_update_request( index_name=index_name, + prefer=prefer, + api_version=api_version, content_type=content_type, + json=json, allow_index_downtime=allow_index_downtime, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, - json=json, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) @@ -308,6 +330,9 @@ async def delete( :type if_none_match: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -319,12 +344,15 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_delete_request( index_name=index_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, @@ -363,6 +391,9 @@ async def get( :type index_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndex, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndex @@ -374,12 +405,15 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_request( index_name=index_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get.metadata['url'], ) @@ -420,6 +454,9 @@ async def get_statistics( :type index_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GetIndexStatisticsResult, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.GetIndexStatisticsResult @@ -431,12 +468,15 @@ async def get_statistics( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_statistics_request( index_name=index_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get_statistics.metadata['url'], ) @@ -480,6 +520,9 @@ async def analyze( :type request: ~azure.search.documents.indexes.models.AnalyzeRequest :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeResult, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.AnalyzeResult @@ -491,6 +534,7 @@ async def analyze( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -500,9 +544,10 @@ async def analyze( request = build_analyze_request( index_name=index_name, + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.analyze.metadata['url'], ) request = _convert_request(request) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_search_client_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_search_client_operations.py index 1ae2ee9e4c00..03aee1c77f92 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_search_client_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_search_client_operations.py @@ -18,7 +18,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._search_client_operations import build_get_service_statistics_request - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,6 +33,9 @@ async def get_service_statistics( :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceStatistics, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.ServiceStatistics @@ -45,11 +47,14 @@ async def get_service_statistics( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_service_statistics_request( + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get_service_statistics.metadata['url'], ) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_skillsets_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_skillsets_operations.py index 222b83a7461d..5d39cfef4d6d 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_skillsets_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_skillsets_operations.py @@ -18,7 +18,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._skillsets_operations import build_create_or_update_request, build_create_request, build_delete_request, build_get_request, build_list_request, build_reset_skills_request - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,6 +75,13 @@ async def create_or_update( :type disable_cache_reprocessing_change_detection: bool :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword prefer: For HTTP PUT requests, instructs the service to return the created/updated + resource on success. The default value is "return=representation". Note that overriding this + default value may result in unsupported behavior. + :paramtype prefer: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerSkillset, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset @@ -87,6 +93,8 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + prefer = kwargs.pop('prefer', "return=representation") # type: str + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -96,13 +104,15 @@ async def create_or_update( request = build_create_or_update_request( skillset_name=skillset_name, + prefer=prefer, + api_version=api_version, content_type=content_type, + json=json, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, skip_indexer_reset_requirement_for_cache=skip_indexer_reset_requirement_for_cache, disable_cache_reprocessing_change_detection=disable_cache_reprocessing_change_detection, - json=json, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) @@ -154,6 +164,9 @@ async def delete( :type if_none_match: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -165,12 +178,15 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_delete_request( skillset_name=skillset_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, @@ -209,6 +225,9 @@ async def get( :type skillset_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerSkillset, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset @@ -220,12 +239,15 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_request( skillset_name=skillset_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get.metadata['url'], ) @@ -268,6 +290,9 @@ async def list( :type select: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListSkillsetsResult, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.ListSkillsetsResult @@ -279,11 +304,14 @@ async def list( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_list_request( + api_version=api_version, select=select, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.list.metadata['url'], @@ -325,6 +353,9 @@ async def create( :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerSkillset, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset @@ -336,6 +367,7 @@ async def create( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -344,9 +376,10 @@ async def create( json = self._serialize.body(skillset, 'SearchIndexerSkillset') request = build_create_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.create.metadata['url'], ) request = _convert_request(request) @@ -389,6 +422,9 @@ async def reset_skills( :type skill_names: list[str] :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -400,6 +436,7 @@ async def reset_skills( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -410,9 +447,10 @@ async def reset_skills( request = build_reset_skills_request( skillset_name=skillset_name, + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.reset_skills.metadata['url'], ) request = _convert_request(request) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_synonym_maps_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_synonym_maps_operations.py index de86d3288d0e..e039de73f51f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_synonym_maps_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_synonym_maps_operations.py @@ -18,7 +18,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._synonym_maps_operations import build_create_or_update_request, build_create_request, build_delete_request, build_get_request, build_list_request - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,6 +67,13 @@ async def create_or_update( :type if_none_match: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword prefer: For HTTP PUT requests, instructs the service to return the created/updated + resource on success. The default value is "return=representation". Note that overriding this + default value may result in unsupported behavior. + :paramtype prefer: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SynonymMap, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SynonymMap @@ -79,6 +85,8 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + prefer = kwargs.pop('prefer', "return=representation") # type: str + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -88,11 +96,13 @@ async def create_or_update( request = build_create_or_update_request( synonym_map_name=synonym_map_name, + prefer=prefer, + api_version=api_version, content_type=content_type, + json=json, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, - json=json, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) @@ -144,6 +154,9 @@ async def delete( :type if_none_match: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -155,12 +168,15 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_delete_request( synonym_map_name=synonym_map_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, @@ -199,6 +215,9 @@ async def get( :type synonym_map_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SynonymMap, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SynonymMap @@ -210,12 +229,15 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_request( synonym_map_name=synonym_map_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get.metadata['url'], ) @@ -258,6 +280,9 @@ async def list( :type select: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListSynonymMapsResult, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.ListSynonymMapsResult @@ -269,11 +294,14 @@ async def list( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_list_request( + api_version=api_version, select=select, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.list.metadata['url'], @@ -315,6 +343,9 @@ async def create( :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SynonymMap, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SynonymMap @@ -326,6 +357,7 @@ async def create( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -334,9 +366,10 @@ async def create( json = self._serialize.body(synonym_map, 'SynonymMap') request = build_create_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.create.metadata['url'], ) request = _convert_request(request) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/__init__.py index cc1a6e75a0d6..248818b6f95a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/__init__.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/__init__.py @@ -94,6 +94,7 @@ from ._models_py3 import PatternReplaceTokenFilter from ._models_py3 import PatternTokenizer from ._models_py3 import PhoneticTokenFilter + from ._models_py3 import PrioritizedFields from ._models_py3 import RequestOptions from ._models_py3 import ResourceCounter from ._models_py3 import ScoringFunction @@ -122,6 +123,9 @@ from ._models_py3 import SearchIndexerStatus from ._models_py3 import SearchIndexerWarning from ._models_py3 import SearchResourceEncryptionKey + from ._models_py3 import SemanticConfiguration + from ._models_py3 import SemanticField + from ._models_py3 import SemanticSettings from ._models_py3 import SentimentSkill from ._models_py3 import SentimentSkillV3 from ._models_py3 import ServiceCounters @@ -240,6 +244,7 @@ from ._models import PatternReplaceTokenFilter # type: ignore from ._models import PatternTokenizer # type: ignore from ._models import PhoneticTokenFilter # type: ignore + from ._models import PrioritizedFields # type: ignore from ._models import RequestOptions # type: ignore from ._models import ResourceCounter # type: ignore from ._models import ScoringFunction # type: ignore @@ -268,6 +273,9 @@ from ._models import SearchIndexerStatus # type: ignore from ._models import SearchIndexerWarning # type: ignore from ._models import SearchResourceEncryptionKey # type: ignore + from ._models import SemanticConfiguration # type: ignore + from ._models import SemanticField # type: ignore + from ._models import SemanticSettings # type: ignore from ._models import SentimentSkill # type: ignore from ._models import SentimentSkillV3 # type: ignore from ._models import ServiceCounters # type: ignore @@ -432,6 +440,7 @@ 'PatternReplaceTokenFilter', 'PatternTokenizer', 'PhoneticTokenFilter', + 'PrioritizedFields', 'RequestOptions', 'ResourceCounter', 'ScoringFunction', @@ -460,6 +469,9 @@ 'SearchIndexerStatus', 'SearchIndexerWarning', 'SearchResourceEncryptionKey', + 'SemanticConfiguration', + 'SemanticField', + 'SemanticSettings', 'SentimentSkill', 'SentimentSkillV3', 'ServiceCounters', diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models.py index efb7f70d0e7d..8846b8cf2868 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models.py @@ -5319,6 +5319,58 @@ def __init__( self.domain = kwargs.get('domain', None) +class PrioritizedFields(msrest.serialization.Model): + """Describes the title, content, and keywords fields to be used for semantic ranking, captions, highlights, and answers. + + :ivar title_field: Defines the title field to be used for semantic ranking, captions, + highlights, and answers. If you don't have a title field in your index, leave this blank. + :vartype title_field: ~azure.search.documents.indexes.models.SemanticField + :ivar prioritized_content_fields: Defines the content fields to be used for semantic ranking, + captions, highlights, and answers. For the best result, the selected fields should contain text + in natural language form. The order of the fields in the array represents their priority. + Fields with lower priority may get truncated if the content is long. + :vartype prioritized_content_fields: list[~azure.search.documents.indexes.models.SemanticField] + :ivar prioritized_keywords_fields: Defines the keyword fields to be used for semantic ranking, + captions, highlights, and answers. For the best result, the selected fields should contain a + list of keywords. The order of the fields in the array represents their priority. Fields with + lower priority may get truncated if the content is long. + :vartype prioritized_keywords_fields: + list[~azure.search.documents.indexes.models.SemanticField] + """ + + _attribute_map = { + 'title_field': {'key': 'titleField', 'type': 'SemanticField'}, + 'prioritized_content_fields': {'key': 'prioritizedContentFields', 'type': '[SemanticField]'}, + 'prioritized_keywords_fields': {'key': 'prioritizedKeywordsFields', 'type': '[SemanticField]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword title_field: Defines the title field to be used for semantic ranking, captions, + highlights, and answers. If you don't have a title field in your index, leave this blank. + :paramtype title_field: ~azure.search.documents.indexes.models.SemanticField + :keyword prioritized_content_fields: Defines the content fields to be used for semantic + ranking, captions, highlights, and answers. For the best result, the selected fields should + contain text in natural language form. The order of the fields in the array represents their + priority. Fields with lower priority may get truncated if the content is long. + :paramtype prioritized_content_fields: + list[~azure.search.documents.indexes.models.SemanticField] + :keyword prioritized_keywords_fields: Defines the keyword fields to be used for semantic + ranking, captions, highlights, and answers. For the best result, the selected fields should + contain a list of keywords. The order of the fields in the array represents their priority. + Fields with lower priority may get truncated if the content is long. + :paramtype prioritized_keywords_fields: + list[~azure.search.documents.indexes.models.SemanticField] + """ + super(PrioritizedFields, self).__init__(**kwargs) + self.title_field = kwargs.get('title_field', None) + self.prioritized_content_fields = kwargs.get('prioritized_content_fields', None) + self.prioritized_keywords_fields = kwargs.get('prioritized_keywords_fields', None) + + class RequestOptions(msrest.serialization.Model): """Parameter group. @@ -5836,6 +5888,9 @@ class SearchIndex(msrest.serialization.Model): creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used. :vartype similarity: ~azure.search.documents.indexes.models.Similarity + :ivar semantic_settings: Defines parameters for a search index that influence semantic + capabilities. + :vartype semantic_settings: ~azure.search.documents.indexes.models.SemanticSettings :ivar e_tag: The ETag of the index. :vartype e_tag: str """ @@ -5859,6 +5914,7 @@ class SearchIndex(msrest.serialization.Model): 'normalizers': {'key': 'normalizers', 'type': '[LexicalNormalizer]'}, 'encryption_key': {'key': 'encryptionKey', 'type': 'SearchResourceEncryptionKey'}, 'similarity': {'key': 'similarity', 'type': 'Similarity'}, + 'semantic_settings': {'key': 'semantic', 'type': 'SemanticSettings'}, 'e_tag': {'key': '@odata\\.etag', 'type': 'str'}, } @@ -5905,6 +5961,9 @@ def __init__( creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used. :paramtype similarity: ~azure.search.documents.indexes.models.Similarity + :keyword semantic_settings: Defines parameters for a search index that influence semantic + capabilities. + :paramtype semantic_settings: ~azure.search.documents.indexes.models.SemanticSettings :keyword e_tag: The ETag of the index. :paramtype e_tag: str """ @@ -5922,6 +5981,7 @@ def __init__( self.normalizers = kwargs.get('normalizers', None) self.encryption_key = kwargs.get('encryption_key', None) self.similarity = kwargs.get('similarity', None) + self.semantic_settings = kwargs.get('semantic_settings', None) self.e_tag = kwargs.get('e_tag', None) @@ -7043,6 +7103,92 @@ def __init__( self.identity = kwargs.get('identity', None) +class SemanticConfiguration(msrest.serialization.Model): + """Defines a specific configuration to be used in the context of semantic capabilities. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Required. The name of the semantic configuration. + :vartype name: str + :ivar prioritized_fields: Required. Describes the title, content, and keyword fields to be used + for semantic ranking, captions, highlights, and answers. At least one of the three sub + properties (titleField, prioritizedKeywordsFields and prioritizedContentFields) need to be set. + :vartype prioritized_fields: ~azure.search.documents.indexes.models.PrioritizedFields + """ + + _validation = { + 'name': {'required': True}, + 'prioritized_fields': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'prioritized_fields': {'key': 'prioritizedFields', 'type': 'PrioritizedFields'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: Required. The name of the semantic configuration. + :paramtype name: str + :keyword prioritized_fields: Required. Describes the title, content, and keyword fields to be + used for semantic ranking, captions, highlights, and answers. At least one of the three sub + properties (titleField, prioritizedKeywordsFields and prioritizedContentFields) need to be set. + :paramtype prioritized_fields: ~azure.search.documents.indexes.models.PrioritizedFields + """ + super(SemanticConfiguration, self).__init__(**kwargs) + self.name = kwargs['name'] + self.prioritized_fields = kwargs['prioritized_fields'] + + +class SemanticField(msrest.serialization.Model): + """A field that is used as part of the semantic configuration. + + :ivar field_name: + :vartype field_name: str + """ + + _attribute_map = { + 'field_name': {'key': 'fieldName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword field_name: + :paramtype field_name: str + """ + super(SemanticField, self).__init__(**kwargs) + self.field_name = kwargs.get('field_name', None) + + +class SemanticSettings(msrest.serialization.Model): + """Defines parameters for a search index that influence semantic capabilities. + + :ivar configurations: The semantic configurations for the index. + :vartype configurations: list[~azure.search.documents.indexes.models.SemanticConfiguration] + """ + + _attribute_map = { + 'configurations': {'key': 'configurations', 'type': '[SemanticConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword configurations: The semantic configurations for the index. + :paramtype configurations: list[~azure.search.documents.indexes.models.SemanticConfiguration] + """ + super(SemanticSettings, self).__init__(**kwargs) + self.configurations = kwargs.get('configurations', None) + + class SentimentSkill(SearchIndexerSkill): """Text analytics positive-negative sentiment analysis, scored as a floating point value in a range of zero to 1. diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models_py3.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models_py3.py index 4a8562656ef1..02816617f783 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models_py3.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models_py3.py @@ -5714,6 +5714,62 @@ def __init__( self.domain = domain +class PrioritizedFields(msrest.serialization.Model): + """Describes the title, content, and keywords fields to be used for semantic ranking, captions, highlights, and answers. + + :ivar title_field: Defines the title field to be used for semantic ranking, captions, + highlights, and answers. If you don't have a title field in your index, leave this blank. + :vartype title_field: ~azure.search.documents.indexes.models.SemanticField + :ivar prioritized_content_fields: Defines the content fields to be used for semantic ranking, + captions, highlights, and answers. For the best result, the selected fields should contain text + in natural language form. The order of the fields in the array represents their priority. + Fields with lower priority may get truncated if the content is long. + :vartype prioritized_content_fields: list[~azure.search.documents.indexes.models.SemanticField] + :ivar prioritized_keywords_fields: Defines the keyword fields to be used for semantic ranking, + captions, highlights, and answers. For the best result, the selected fields should contain a + list of keywords. The order of the fields in the array represents their priority. Fields with + lower priority may get truncated if the content is long. + :vartype prioritized_keywords_fields: + list[~azure.search.documents.indexes.models.SemanticField] + """ + + _attribute_map = { + 'title_field': {'key': 'titleField', 'type': 'SemanticField'}, + 'prioritized_content_fields': {'key': 'prioritizedContentFields', 'type': '[SemanticField]'}, + 'prioritized_keywords_fields': {'key': 'prioritizedKeywordsFields', 'type': '[SemanticField]'}, + } + + def __init__( + self, + *, + title_field: Optional["SemanticField"] = None, + prioritized_content_fields: Optional[List["SemanticField"]] = None, + prioritized_keywords_fields: Optional[List["SemanticField"]] = None, + **kwargs + ): + """ + :keyword title_field: Defines the title field to be used for semantic ranking, captions, + highlights, and answers. If you don't have a title field in your index, leave this blank. + :paramtype title_field: ~azure.search.documents.indexes.models.SemanticField + :keyword prioritized_content_fields: Defines the content fields to be used for semantic + ranking, captions, highlights, and answers. For the best result, the selected fields should + contain text in natural language form. The order of the fields in the array represents their + priority. Fields with lower priority may get truncated if the content is long. + :paramtype prioritized_content_fields: + list[~azure.search.documents.indexes.models.SemanticField] + :keyword prioritized_keywords_fields: Defines the keyword fields to be used for semantic + ranking, captions, highlights, and answers. For the best result, the selected fields should + contain a list of keywords. The order of the fields in the array represents their priority. + Fields with lower priority may get truncated if the content is long. + :paramtype prioritized_keywords_fields: + list[~azure.search.documents.indexes.models.SemanticField] + """ + super(PrioritizedFields, self).__init__(**kwargs) + self.title_field = title_field + self.prioritized_content_fields = prioritized_content_fields + self.prioritized_keywords_fields = prioritized_keywords_fields + + class RequestOptions(msrest.serialization.Model): """Parameter group. @@ -6256,6 +6312,9 @@ class SearchIndex(msrest.serialization.Model): creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used. :vartype similarity: ~azure.search.documents.indexes.models.Similarity + :ivar semantic_settings: Defines parameters for a search index that influence semantic + capabilities. + :vartype semantic_settings: ~azure.search.documents.indexes.models.SemanticSettings :ivar e_tag: The ETag of the index. :vartype e_tag: str """ @@ -6279,6 +6338,7 @@ class SearchIndex(msrest.serialization.Model): 'normalizers': {'key': 'normalizers', 'type': '[LexicalNormalizer]'}, 'encryption_key': {'key': 'encryptionKey', 'type': 'SearchResourceEncryptionKey'}, 'similarity': {'key': 'similarity', 'type': 'Similarity'}, + 'semantic_settings': {'key': 'semantic', 'type': 'SemanticSettings'}, 'e_tag': {'key': '@odata\\.etag', 'type': 'str'}, } @@ -6298,6 +6358,7 @@ def __init__( normalizers: Optional[List["LexicalNormalizer"]] = None, encryption_key: Optional["SearchResourceEncryptionKey"] = None, similarity: Optional["Similarity"] = None, + semantic_settings: Optional["SemanticSettings"] = None, e_tag: Optional[str] = None, **kwargs ): @@ -6340,6 +6401,9 @@ def __init__( creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used. :paramtype similarity: ~azure.search.documents.indexes.models.Similarity + :keyword semantic_settings: Defines parameters for a search index that influence semantic + capabilities. + :paramtype semantic_settings: ~azure.search.documents.indexes.models.SemanticSettings :keyword e_tag: The ETag of the index. :paramtype e_tag: str """ @@ -6357,6 +6421,7 @@ def __init__( self.normalizers = normalizers self.encryption_key = encryption_key self.similarity = similarity + self.semantic_settings = semantic_settings self.e_tag = e_tag @@ -7566,6 +7631,99 @@ def __init__( self.identity = identity +class SemanticConfiguration(msrest.serialization.Model): + """Defines a specific configuration to be used in the context of semantic capabilities. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Required. The name of the semantic configuration. + :vartype name: str + :ivar prioritized_fields: Required. Describes the title, content, and keyword fields to be used + for semantic ranking, captions, highlights, and answers. At least one of the three sub + properties (titleField, prioritizedKeywordsFields and prioritizedContentFields) need to be set. + :vartype prioritized_fields: ~azure.search.documents.indexes.models.PrioritizedFields + """ + + _validation = { + 'name': {'required': True}, + 'prioritized_fields': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'prioritized_fields': {'key': 'prioritizedFields', 'type': 'PrioritizedFields'}, + } + + def __init__( + self, + *, + name: str, + prioritized_fields: "PrioritizedFields", + **kwargs + ): + """ + :keyword name: Required. The name of the semantic configuration. + :paramtype name: str + :keyword prioritized_fields: Required. Describes the title, content, and keyword fields to be + used for semantic ranking, captions, highlights, and answers. At least one of the three sub + properties (titleField, prioritizedKeywordsFields and prioritizedContentFields) need to be set. + :paramtype prioritized_fields: ~azure.search.documents.indexes.models.PrioritizedFields + """ + super(SemanticConfiguration, self).__init__(**kwargs) + self.name = name + self.prioritized_fields = prioritized_fields + + +class SemanticField(msrest.serialization.Model): + """A field that is used as part of the semantic configuration. + + :ivar field_name: + :vartype field_name: str + """ + + _attribute_map = { + 'field_name': {'key': 'fieldName', 'type': 'str'}, + } + + def __init__( + self, + *, + field_name: Optional[str] = None, + **kwargs + ): + """ + :keyword field_name: + :paramtype field_name: str + """ + super(SemanticField, self).__init__(**kwargs) + self.field_name = field_name + + +class SemanticSettings(msrest.serialization.Model): + """Defines parameters for a search index that influence semantic capabilities. + + :ivar configurations: The semantic configurations for the index. + :vartype configurations: list[~azure.search.documents.indexes.models.SemanticConfiguration] + """ + + _attribute_map = { + 'configurations': {'key': 'configurations', 'type': '[SemanticConfiguration]'}, + } + + def __init__( + self, + *, + configurations: Optional[List["SemanticConfiguration"]] = None, + **kwargs + ): + """ + :keyword configurations: The semantic configurations for the index. + :paramtype configurations: list[~azure.search.documents.indexes.models.SemanticConfiguration] + """ + super(SemanticSettings, self).__init__(**kwargs) + self.configurations = configurations + + class SentimentSkill(SearchIndexerSkill): """Text analytics positive-negative sentiment analysis, scored as a floating point value in a range of zero to 1. diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_data_sources_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_data_sources_operations.py index f0fca120b0d5..cda17413b05a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_data_sources_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_data_sources_operations.py @@ -22,11 +22,11 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False # fmt: off def build_create_or_update_request( @@ -34,14 +34,14 @@ def build_create_or_update_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + prefer = kwargs.pop('prefer', "return=representation") # type: str + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] if_match = kwargs.pop('if_match', None) # type: Optional[str] if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] skip_indexer_reset_requirement_for_cache = kwargs.pop('skip_indexer_reset_requirement_for_cache', None) # type: Optional[bool] - prefer = "return=representation" - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/datasources(\'{dataSourceName}\')') @@ -84,11 +84,11 @@ def build_delete_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] if_match = kwargs.pop('if_match', None) # type: Optional[str] if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/datasources(\'{dataSourceName}\')') @@ -126,9 +126,9 @@ def build_get_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/datasources(\'{dataSourceName}\')') @@ -161,10 +161,10 @@ def build_list_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str select = kwargs.pop('select', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/datasources') @@ -194,10 +194,10 @@ def build_create_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/datasources') @@ -273,6 +273,13 @@ def create_or_update( :type skip_indexer_reset_requirement_for_cache: bool :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword prefer: For HTTP PUT requests, instructs the service to return the created/updated + resource on success. The default value is "return=representation". Note that overriding this + default value may result in unsupported behavior. + :paramtype prefer: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerDataSource, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSource @@ -284,6 +291,8 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + prefer = kwargs.pop('prefer', "return=representation") # type: str + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -293,12 +302,14 @@ def create_or_update( request = build_create_or_update_request( data_source_name=data_source_name, + prefer=prefer, + api_version=api_version, content_type=content_type, + json=json, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, skip_indexer_reset_requirement_for_cache=skip_indexer_reset_requirement_for_cache, - json=json, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) @@ -351,6 +362,9 @@ def delete( :type if_none_match: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -362,12 +376,15 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_delete_request( data_source_name=data_source_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, @@ -407,6 +424,9 @@ def get( :type data_source_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerDataSource, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSource @@ -418,12 +438,15 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_request( data_source_name=data_source_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get.metadata['url'], ) @@ -467,6 +490,9 @@ def list( :type select: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListDataSourcesResult, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.ListDataSourcesResult @@ -478,11 +504,14 @@ def list( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_list_request( + api_version=api_version, select=select, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.list.metadata['url'], @@ -525,6 +554,9 @@ def create( :type data_source: ~azure.search.documents.indexes.models.SearchIndexerDataSource :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerDataSource, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSource @@ -536,6 +568,7 @@ def create( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -544,9 +577,10 @@ def create( json = self._serialize.body(data_source, 'SearchIndexerDataSource') request = build_create_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.create.metadata['url'], ) request = _convert_request(request) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexers_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexers_operations.py index 30a3129eec29..bfb715d66d56 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexers_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexers_operations.py @@ -22,11 +22,11 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False # fmt: off def build_reset_request( @@ -34,9 +34,9 @@ def build_reset_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexers(\'{indexerName}\')/search.reset') @@ -70,11 +70,11 @@ def build_reset_docs_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] overwrite = kwargs.pop('overwrite', False) # type: Optional[bool] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexers(\'{indexerName}\')/search.resetdocs') @@ -112,9 +112,9 @@ def build_run_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexers(\'{indexerName}\')/search.run') @@ -148,6 +148,8 @@ def build_create_or_update_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + prefer = kwargs.pop('prefer', "return=representation") # type: str + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] if_match = kwargs.pop('if_match', None) # type: Optional[str] @@ -155,8 +157,6 @@ def build_create_or_update_request( skip_indexer_reset_requirement_for_cache = kwargs.pop('skip_indexer_reset_requirement_for_cache', None) # type: Optional[bool] disable_cache_reprocessing_change_detection = kwargs.pop('disable_cache_reprocessing_change_detection', None) # type: Optional[bool] - prefer = "return=representation" - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexers(\'{indexerName}\')') @@ -201,11 +201,11 @@ def build_delete_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] if_match = kwargs.pop('if_match', None) # type: Optional[str] if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexers(\'{indexerName}\')') @@ -243,9 +243,9 @@ def build_get_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexers(\'{indexerName}\')') @@ -278,10 +278,10 @@ def build_list_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str select = kwargs.pop('select', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexers') @@ -311,10 +311,10 @@ def build_create_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexers') @@ -345,9 +345,9 @@ def build_get_status_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexers(\'{indexerName}\')/search.status') @@ -412,6 +412,9 @@ def reset( :type indexer_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -423,12 +426,15 @@ def reset( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_reset_request( indexer_name=indexer_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.reset.metadata['url'], ) @@ -473,6 +479,9 @@ def reset_docs( :type keys_or_ids: ~azure.search.documents.indexes.models.DocumentKeysOrIds :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -484,6 +493,7 @@ def reset_docs( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -496,10 +506,11 @@ def reset_docs( request = build_reset_docs_request( indexer_name=indexer_name, + api_version=api_version, content_type=content_type, + json=json, overwrite=overwrite, x_ms_client_request_id=_x_ms_client_request_id, - json=json, template_url=self.reset_docs.metadata['url'], ) request = _convert_request(request) @@ -536,6 +547,9 @@ def run( :type indexer_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -547,12 +561,15 @@ def run( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_run_request( indexer_name=indexer_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.run.metadata['url'], ) @@ -608,6 +625,13 @@ def create_or_update( :type disable_cache_reprocessing_change_detection: bool :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword prefer: For HTTP PUT requests, instructs the service to return the created/updated + resource on success. The default value is "return=representation". Note that overriding this + default value may result in unsupported behavior. + :paramtype prefer: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexer, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexer @@ -619,6 +643,8 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + prefer = kwargs.pop('prefer', "return=representation") # type: str + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -628,13 +654,15 @@ def create_or_update( request = build_create_or_update_request( indexer_name=indexer_name, + prefer=prefer, + api_version=api_version, content_type=content_type, + json=json, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, skip_indexer_reset_requirement_for_cache=skip_indexer_reset_requirement_for_cache, disable_cache_reprocessing_change_detection=disable_cache_reprocessing_change_detection, - json=json, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) @@ -687,6 +715,9 @@ def delete( :type if_none_match: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -698,12 +729,15 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_delete_request( indexer_name=indexer_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, @@ -743,6 +777,9 @@ def get( :type indexer_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexer, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexer @@ -754,12 +791,15 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_request( indexer_name=indexer_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get.metadata['url'], ) @@ -803,6 +843,9 @@ def list( :type select: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListIndexersResult, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.ListIndexersResult @@ -814,11 +857,14 @@ def list( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_list_request( + api_version=api_version, select=select, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.list.metadata['url'], @@ -861,6 +907,9 @@ def create( :type indexer: ~azure.search.documents.indexes.models.SearchIndexer :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexer, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexer @@ -872,6 +921,7 @@ def create( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -880,9 +930,10 @@ def create( json = self._serialize.body(indexer, 'SearchIndexer') request = build_create_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.create.metadata['url'], ) request = _convert_request(request) @@ -923,6 +974,9 @@ def get_status( :type indexer_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerStatus, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexerStatus @@ -934,12 +988,15 @@ def get_status( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_status_request( indexer_name=indexer_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get_status.metadata['url'], ) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexes_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexes_operations.py index fceea50c44a2..15e3777a4c17 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexes_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexes_operations.py @@ -23,21 +23,21 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False # fmt: off def build_create_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexes') @@ -67,10 +67,10 @@ def build_list_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str select = kwargs.pop('select', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexes') @@ -101,14 +101,14 @@ def build_create_or_update_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + prefer = kwargs.pop('prefer', "return=representation") # type: str + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] allow_index_downtime = kwargs.pop('allow_index_downtime', None) # type: Optional[bool] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] if_match = kwargs.pop('if_match', None) # type: Optional[str] if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] - prefer = "return=representation" - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexes(\'{indexName}\')') @@ -151,11 +151,11 @@ def build_delete_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] if_match = kwargs.pop('if_match', None) # type: Optional[str] if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexes(\'{indexName}\')') @@ -193,9 +193,9 @@ def build_get_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexes(\'{indexName}\')') @@ -229,9 +229,9 @@ def build_get_statistics_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexes(\'{indexName}\')/search.stats') @@ -265,10 +265,10 @@ def build_analyze_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/indexes(\'{indexName}\')/search.analyze') @@ -335,6 +335,9 @@ def create( :type index: ~azure.search.documents.indexes.models.SearchIndex :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndex, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndex @@ -346,6 +349,7 @@ def create( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -354,9 +358,10 @@ def create( json = self._serialize.body(index, 'SearchIndex') request = build_create_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.create.metadata['url'], ) request = _convert_request(request) @@ -399,11 +404,16 @@ def list( :type select: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListIndexesResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.models.ListIndexesResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListIndexesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -416,6 +426,7 @@ def prepare_request(next_link=None): _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_list_request( + api_version=api_version, select=select, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.list.metadata['url'], @@ -432,6 +443,7 @@ def prepare_request(next_link=None): _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_list_request( + api_version=api_version, select=select, x_ms_client_request_id=_x_ms_client_request_id, template_url=next_link, @@ -506,6 +518,13 @@ def create_or_update( :type if_none_match: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword prefer: For HTTP PUT requests, instructs the service to return the created/updated + resource on success. The default value is "return=representation". Note that overriding this + default value may result in unsupported behavior. + :paramtype prefer: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndex, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndex @@ -517,6 +536,8 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + prefer = kwargs.pop('prefer', "return=representation") # type: str + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -526,12 +547,14 @@ def create_or_update( request = build_create_or_update_request( index_name=index_name, + prefer=prefer, + api_version=api_version, content_type=content_type, + json=json, allow_index_downtime=allow_index_downtime, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, - json=json, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) @@ -586,6 +609,9 @@ def delete( :type if_none_match: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -597,12 +623,15 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_delete_request( index_name=index_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, @@ -642,6 +671,9 @@ def get( :type index_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndex, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndex @@ -653,12 +685,15 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_request( index_name=index_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get.metadata['url'], ) @@ -700,6 +735,9 @@ def get_statistics( :type index_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GetIndexStatisticsResult, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.GetIndexStatisticsResult @@ -711,12 +749,15 @@ def get_statistics( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_statistics_request( index_name=index_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get_statistics.metadata['url'], ) @@ -761,6 +802,9 @@ def analyze( :type request: ~azure.search.documents.indexes.models.AnalyzeRequest :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeResult, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.AnalyzeResult @@ -772,6 +816,7 @@ def analyze( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -781,9 +826,10 @@ def analyze( request = build_analyze_request( index_name=index_name, + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.analyze.metadata['url'], ) request = _convert_request(request) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_search_client_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_search_client_operations.py index 48151d99bb06..287ff42f575d 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_search_client_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_search_client_operations.py @@ -22,20 +22,20 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False # fmt: off def build_get_service_statistics_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/servicestats') @@ -72,6 +72,9 @@ def get_service_statistics( :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceStatistics, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.ServiceStatistics @@ -83,11 +86,14 @@ def get_service_statistics( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_service_statistics_request( + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get_service_statistics.metadata['url'], ) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_skillsets_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_skillsets_operations.py index 5c212d7074c0..10f49b25159b 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_skillsets_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_skillsets_operations.py @@ -22,11 +22,11 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False # fmt: off def build_create_or_update_request( @@ -34,6 +34,8 @@ def build_create_or_update_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + prefer = kwargs.pop('prefer', "return=representation") # type: str + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] if_match = kwargs.pop('if_match', None) # type: Optional[str] @@ -41,8 +43,6 @@ def build_create_or_update_request( skip_indexer_reset_requirement_for_cache = kwargs.pop('skip_indexer_reset_requirement_for_cache', None) # type: Optional[bool] disable_cache_reprocessing_change_detection = kwargs.pop('disable_cache_reprocessing_change_detection', None) # type: Optional[bool] - prefer = "return=representation" - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/skillsets(\'{skillsetName}\')') @@ -87,11 +87,11 @@ def build_delete_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] if_match = kwargs.pop('if_match', None) # type: Optional[str] if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/skillsets(\'{skillsetName}\')') @@ -129,9 +129,9 @@ def build_get_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/skillsets(\'{skillsetName}\')') @@ -164,10 +164,10 @@ def build_list_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str select = kwargs.pop('select', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/skillsets') @@ -197,10 +197,10 @@ def build_create_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/skillsets') @@ -231,10 +231,10 @@ def build_reset_skills_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/skillsets(\'{skillsetName}\')/search.resetskills') @@ -320,6 +320,13 @@ def create_or_update( :type disable_cache_reprocessing_change_detection: bool :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword prefer: For HTTP PUT requests, instructs the service to return the created/updated + resource on success. The default value is "return=representation". Note that overriding this + default value may result in unsupported behavior. + :paramtype prefer: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerSkillset, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset @@ -331,6 +338,8 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + prefer = kwargs.pop('prefer', "return=representation") # type: str + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -340,13 +349,15 @@ def create_or_update( request = build_create_or_update_request( skillset_name=skillset_name, + prefer=prefer, + api_version=api_version, content_type=content_type, + json=json, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, skip_indexer_reset_requirement_for_cache=skip_indexer_reset_requirement_for_cache, disable_cache_reprocessing_change_detection=disable_cache_reprocessing_change_detection, - json=json, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) @@ -399,6 +410,9 @@ def delete( :type if_none_match: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -410,12 +424,15 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_delete_request( skillset_name=skillset_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, @@ -455,6 +472,9 @@ def get( :type skillset_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerSkillset, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset @@ -466,12 +486,15 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_request( skillset_name=skillset_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get.metadata['url'], ) @@ -515,6 +538,9 @@ def list( :type select: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListSkillsetsResult, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.ListSkillsetsResult @@ -526,11 +552,14 @@ def list( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_list_request( + api_version=api_version, select=select, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.list.metadata['url'], @@ -573,6 +602,9 @@ def create( :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerSkillset, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset @@ -584,6 +616,7 @@ def create( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -592,9 +625,10 @@ def create( json = self._serialize.body(skillset, 'SearchIndexerSkillset') request = build_create_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.create.metadata['url'], ) request = _convert_request(request) @@ -638,6 +672,9 @@ def reset_skills( :type skill_names: list[str] :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -649,6 +686,7 @@ def reset_skills( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -659,9 +697,10 @@ def reset_skills( request = build_reset_skills_request( skillset_name=skillset_name, + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.reset_skills.metadata['url'], ) request = _convert_request(request) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_synonym_maps_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_synonym_maps_operations.py index fd1190e573c3..f9d19d6b6352 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_synonym_maps_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_synonym_maps_operations.py @@ -22,11 +22,11 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False # fmt: off def build_create_or_update_request( @@ -34,13 +34,13 @@ def build_create_or_update_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + prefer = kwargs.pop('prefer', "return=representation") # type: str + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] if_match = kwargs.pop('if_match', None) # type: Optional[str] if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] - prefer = "return=representation" - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/synonymmaps(\'{synonymMapName}\')') @@ -81,11 +81,11 @@ def build_delete_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] if_match = kwargs.pop('if_match', None) # type: Optional[str] if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/synonymmaps(\'{synonymMapName}\')') @@ -123,9 +123,9 @@ def build_get_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/synonymmaps(\'{synonymMapName}\')') @@ -158,10 +158,10 @@ def build_list_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str select = kwargs.pop('select', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/synonymmaps') @@ -191,10 +191,10 @@ def build_create_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] - api_version = "2021-04-30-Preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/synonymmaps') @@ -267,6 +267,13 @@ def create_or_update( :type if_none_match: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword prefer: For HTTP PUT requests, instructs the service to return the created/updated + resource on success. The default value is "return=representation". Note that overriding this + default value may result in unsupported behavior. + :paramtype prefer: str + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SynonymMap, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SynonymMap @@ -278,6 +285,8 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + prefer = kwargs.pop('prefer', "return=representation") # type: str + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -287,11 +296,13 @@ def create_or_update( request = build_create_or_update_request( synonym_map_name=synonym_map_name, + prefer=prefer, + api_version=api_version, content_type=content_type, + json=json, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, - json=json, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) @@ -344,6 +355,9 @@ def delete( :type if_none_match: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -355,12 +369,15 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_delete_request( synonym_map_name=synonym_map_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, if_match=if_match, if_none_match=if_none_match, @@ -400,6 +417,9 @@ def get( :type synonym_map_name: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SynonymMap, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SynonymMap @@ -411,12 +431,15 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_get_request( synonym_map_name=synonym_map_name, + api_version=api_version, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.get.metadata['url'], ) @@ -460,6 +483,9 @@ def list( :type select: str :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListSynonymMapsResult, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.ListSynonymMapsResult @@ -471,11 +497,14 @@ def list( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id request = build_list_request( + api_version=api_version, select=select, x_ms_client_request_id=_x_ms_client_request_id, template_url=self.list.metadata['url'], @@ -518,6 +547,9 @@ def create( :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap :param request_options: Parameter group. :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SynonymMap, or the result of cls(response) :rtype: ~azure.search.documents.indexes.models.SynonymMap @@ -529,6 +561,7 @@ def create( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _x_ms_client_request_id = None @@ -537,9 +570,10 @@ def create( json = self._serialize.body(synonym_map, 'SynonymMap') request = build_create_request( + api_version=api_version, content_type=content_type, - x_ms_client_request_id=_x_ms_client_request_id, json=json, + x_ms_client_request_id=_x_ms_client_request_id, template_url=self.create.metadata['url'], ) request = _convert_request(request) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py index d2b6c5d64960..83ce6fc2da08 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py @@ -108,6 +108,7 @@ PIIDetectionSkillMaskingMode, PhoneticEncoder, PhoneticTokenFilter, + PrioritizedFields, RegexFlags, SearchIndexer, SearchIndexerCache, @@ -124,6 +125,9 @@ SearchIndexerKnowledgeStoreTableProjectionSelector, SearchIndexerLimits, SearchIndexerStatus, + SemanticConfiguration, + SemanticField, + SemanticSettings, ScoringFunction, ScoringFunctionAggregation, ScoringFunctionInterpolation, @@ -260,6 +264,7 @@ "PIIDetectionSkillMaskingMode", "PhoneticEncoder", "PhoneticTokenFilter", + "PrioritizedFields", "RegexFlags", "ScoringFunction", "ScoringFunctionAggregation", @@ -286,6 +291,9 @@ "SearchIndexerStatus", "SearchResourceEncryptionKey", "SearchableField", + "SemanticConfiguration", + "SemanticField", + "SemanticSettings", "SentimentSkill", "SentimentSkillLanguage", "SentimentSkillVersion", diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_index.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_index.py index 778ea41176a5..d803d85a69cb 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_index.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_index.py @@ -258,7 +258,7 @@ def _from_generated(cls, search_field): analyzer_name=search_field.analyzer, search_analyzer_name=search_field.search_analyzer, index_analyzer_name=search_field.index_analyzer, - normalizer=normalizer, + normalizer_name=normalizer, synonym_map_names=search_field.synonym_maps, fields=fields, ) @@ -524,6 +524,8 @@ class SearchIndex(msrest.serialization.Model): creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used. :paramtype similarity: ~azure.search.documents.indexes.models.SimilarityAlgorithm + :keyword semantic_settings: Defines parameters for a search index that influence semantic capabilities. + :paramtype semantic_settings: ~azure.search.documents.indexes.models.SemanticSettings :keyword e_tag: The ETag of the index. :paramtype e_tag: str """ @@ -550,6 +552,7 @@ class SearchIndex(msrest.serialization.Model): "type": "SearchResourceEncryptionKey", }, "similarity": {"key": "similarity", "type": "SimilarityAlgorithm"}, + "semantic_settings": {"key": "semantic", "type": "SemanticSettings"}, "e_tag": {"key": "@odata\\.etag", "type": "str"}, } @@ -568,6 +571,7 @@ def __init__(self, **kwargs): self.normalizers = kwargs.get("normalizers", None) self.encryption_key = kwargs.get("encryption_key", None) self.similarity = kwargs.get("similarity", None) + self.semantic_settings = kwargs.get("semantic_settings", None) self.e_tag = kwargs.get("e_tag", None) def _to_generated(self): @@ -607,6 +611,7 @@ def _to_generated(self): if self.encryption_key else None, similarity=self.similarity, + semantic_settings=self.semantic_settings, e_tag=self.e_tag, ) @@ -656,6 +661,7 @@ def _from_generated(cls, search_index): search_index.encryption_key ), similarity=search_index.similarity, + semantic_settings=search_index.semantic_settings, e_tag=search_index.e_tag, )