python - Computing an index that accounts for score and date within Google App Engine Datastore -


i'm working on google app engine (python) based site allows user generated content, , voting (like/dislike) on content.

our designer has, rather nebulously, spec'd front page should balance between recent content , popular content, assumption these creating score value weights likes/dislikes vs time-since-creation. ultimately, goals (1) bad content gets filtered out quickly, (2) content continues popular stays longer, , (3) new content has chance @ staying long enough enough votes determine if or bad.

i can compute score based on likes/dislikes. incorporating time factor produce single score can indexed doesn't seem feasible. need reindex content every day adjust score, seems cost prohibitive once have sizable amount of content. so, i'm @ loss potential solutions.

i've suggested where time box (all time, daily, weekly), says users unlikely @ tabs other default view. also, if filtered based on last week, i'd need sort on time, , secondary popularity sort meaningless since submissions times virtually unique.

any suggestions on solutions might overlooking?

would google's prediction api or bigquery able handle better?

such system called "frecency", , there's number of ways it. 1 way have votes 'decay' on time; i've implemented in past on app engine storing current score , last-updated; vote applies exponential decay score based on last-updated time, before storing both, , background process runs few times day update score , decay time of posts haven't received votes in while. thus, post's score tends towards 0 unless consistently receives upvotes.

another, simpler system, serial-number posts. whenever upvotes post, increment number. thus, natural ordering creation order, votes serve 'reshuffle' things, putting more upvoted posts ahead of newer less voted posts.


Comments