Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page view and package download stats #157

Open
akariv opened this issue Dec 26, 2017 · 0 comments
Open

Page view and package download stats #157

akariv opened this issue Dec 26, 2017 · 0 comments
Assignees
Milestone

Comments

@akariv
Copy link
Contributor

akariv commented Dec 26, 2017

From the server side, update our elasticsearch with package view and download stats:

For each view:

POST /datahub/dataset/{ownerid}/{dataset_name}/_update
{
    "script" : {
        "inline": "if (ctx._source.stat_views != null) {ctx._source.stat_views++; } else {ctx._source.stat_views = 1; }",
        "lang": "painless"
    }
}

For each download:

POST /datahub/dataset/{ownerid}/{dataset_name}/_update
{
    "script" : {
        "inline": "if (ctx._source.stat_downloads != null) {ctx._source.stat_downloads++; } else {ctx._source.stat_downloads = 1; }",
        "lang": "painless"
    }
}
@zelima zelima added this to the Backlog milestone Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants