def simple_analyze_text(): # [START simple_analyze_text] from azure.core.credentials import AzureKeyCredential from azure.search.documents import SearchServiceClient, AnalyzeRequest service_client = SearchServiceClient(service_endpoint, AzureKeyCredential(key)) analyze_request = AnalyzeRequest(text="One's <two/>", analyzer="standard.lucene") result = service_client.analyze_text(index_name, analyze_request) print(result.as_dict())
def test_analyze_text(self, api_key, endpoint, index_name, **kwargs): client = SearchServiceClient(endpoint, AzureKeyCredential(api_key)) analyze_request = AnalyzeRequest(text="One's <two/>", analyzer="standard.lucene") result = client.analyze_text(index_name, analyze_request) assert len(result.tokens) == 2