Esempio n. 1
0
def simple_analyze_text():
    # [START simple_analyze_text]
    from azure.core.credentials import AzureKeyCredential
    from azure.search.documents.indexes import SearchIndexClient
    from azure.search.documents.indexes.models import AnalyzeTextOptions

    client = SearchIndexClient(service_endpoint, AzureKeyCredential(key))

    analyze_request = AnalyzeTextOptions(text="One's <two/>",
                                         analyzer_name="standard.lucene")

    result = client.analyze_text(index_name, analyze_request)
    print(result.as_dict())
 def test_analyze_text(self, api_key, endpoint, index_name, **kwargs):
     client = SearchIndexClient(endpoint, AzureKeyCredential(api_key))
     analyze_request = AnalyzeTextOptions(text="One's <two/>",
                                          analyzer_name="standard.lucene")
     result = client.analyze_text(index_name, analyze_request)
     assert len(result.tokens) == 2
Esempio n. 3
0
 async def _test_analyze_text(self, client, index_name):
     analyze_request = AnalyzeTextOptions(text="One's <two/>",
                                          analyzer_name="standard.lucene")
     result = await client.analyze_text(index_name, analyze_request)
     assert len(result.tokens) == 2