***

title: get_stats
slug: /reference/python/agents/search/search-engine/get-stats
description: Return statistics about the search index.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Return statistics about the search index, including chunk counts, file counts,
average chunk size, file type distribution, language distribution, and index
configuration.

## **Parameters**

None.

## **Returns**

`dict[str, Any]` -- A dictionary containing:

* `total_chunks` (int) -- total number of chunks in the index
* `total_files` (int) -- number of distinct source files
* `avg_chunk_size` (int) -- average chunk size in characters
* `file_types` (dict) -- count of files by type (markdown, python, etc.)
* `languages` (dict) -- count of chunks by language
* `config` (dict) -- index configuration

## **Example**

```python {4}
from signalwire.search import SearchEngine

engine = SearchEngine(backend="sqlite", index_path="./docs.swsearch")
stats = engine.get_stats()

print(f"Index contains {stats['total_chunks']} chunks from {stats['total_files']} files")
print(f"Average chunk size: {stats['avg_chunk_size']} characters")
for ftype, count in stats["file_types"].items():
    print(f"  {ftype}: {count} files")
```