Skip to content

Instantly share code, notes, and snippets.

@joeywhelan
Created April 23, 2023 16:52
request = AggregateRequest('(@txn_date:2021\-12* @txn_currency:{USD} @txn_amt:[(500, inf])')\
.group_by('@expense_category', reducers.sum('@txn_amt').alias('total_spend'))\
.sort_by(Desc('@total_spend'))
result = client.ft(IDX_NAME).aggregate(request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment