diff --git a/README.md b/README.md index 40a9cff..7e607e0 100644 --- a/README.md +++ b/README.md @@ -89,4 +89,16 @@ with SearchSession() as session: .fetch() ) print(result) +``` + +## aggregations +group by path and count unique remote_ip +``` python +with SearchSession() as session: + result = ( + session.select(UserLog) + .aggregate(Terms('path').nested(Cardinality('remote_ip'))) + ) + print(result) + # result -> {'path': 1, 'path2': 2} ``` \ No newline at end of file