mitodl / micromasters

Portal for learners and course teams to access MITx Micromasters® programs
https://mm.mit.edu
BSD 3-Clause "New" or "Revised" License
29 stars 17 forks source link

Remove learner from search index when no longer enrolled #4066

Open pdpinch opened 6 years ago

pdpinch commented 6 years ago

I'm not sure how best to do this, but Max discovered (in #3964) a number of users/enrollments in the elasticsearch index where the user is no longer enrolled. We don't seem to be removing learners from the index.

Unfortunately, I don't think there's any easy way to know that a learner's enrollments have been removed. They just stop being returned when we update their cachedEnrollments every 6 hours.

annagav commented 6 years ago

@pdpinch, When a user un-enrolls we tend to keep the final grades the user acquired. Do we want to keep in the index only current enrollments? independently of final grades?

pdpinch commented 6 years ago

I suspect that would be most useful to our users (course staff). What do we do currently?

@maxliu what are your thoughts on this?

annagav commented 6 years ago

Currently we serialize enrollments for index based on current enrollments or existence of a final grade.

maxliu commented 6 years ago

related data. 1) users who in ES but not in PG for DEDP2T2017 ; dedp_2T2017_in_es_not_in_pg_07_17_2018.xlsx (on Keybase) 2) checking if user in PG : https://bi.odl.mit.edu/queries/441/source 3) check if user in ES : https://micromasters.mit.edu/learners/?q=nnnn <- learner's username

@pdpinch Please let me know if you need more detailed data.