[Python] Azure Management now showing size for search service index

Discussão em 'Python' iniciado por Stack, Maio 19, 2025.

  1. Stack

    Stack Membro Participativo

    With is code I can get the number of documents in an azure search service index.

    credential = DefaultAzureCredential()
    search_client = SearchClient(endpoint, index_name, credential)
    document_count = search_client.get_document_count()


    this

    index_stats = search_client.get_index_statistics()


    fails with

    SearchClient' object has no attribute 'get_index_statistics'


    despite it is mentioned in the documentation as pointed out in the answers.

    There might be way to get this information by service statitics api. Is the a way to get the total size of a search service index with python for RBAC controlled search services?

    Continue reading...

Compartilhe esta Página