Aggregation Exercise
sudo service elasticsearch restartcurl https://elasticsearch-courseware.icssolutions.ca/examples/data-sets/movies.txt -o movies.txt curl -XPOST 'localhost:9200/_bulk' -H 'content-type: application/json' --data-binary "@movies.txt"curl 'localhost:9200/movies/movies/_search?pretty=true'curl -XPOST 'localhost:9200/movies/movies/_search?pretty=true' \ -H 'content-type:application/json' \ -d ' { "size": 0, "aggs": { "actor_name": { "terms": { "field": "Starring.CastCrewName.keyword" } } } }'curl -XPOST 'localhost:9200/movies/movies/_search?pretty=true' \ -H 'content-type:application/json' \ -d ' { "size": 0, "aggs": { "actor_name": { "terms": { "field": "Starring.CastCrewName.keyword" }, "aggs": { "rating": { "avg": { "field": "StarRating" } } } } } } '
Last updated