I wanted to see how many unique link that a user has posted for every user and save something likeuser_id, number_of_post to a csv. Here is what I have come up so far
Thank you for your answer! I now have something like
s.aggs.bucket('users', 'terms', field='user.id').metric('url_count', 'cardinality', field='link')
r = s.execute()
for user in r.aggregations.users.buckets:
print(f'User {user.key} posted {user.url_count.value} links')
but theyonly return 10 results. If I change it to s=s[:], I would have a TransportError(502). Stackoverflow seems not haveing anything promising
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.