Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Here is sample elasticsearch DSL for the types of queries we make currently.

get_course_user

Expand
titleget_course_user

Code Block
http://localhost:19001/api/v0/learners/edx?course_id=course-v1%3AedX%2BDemoX%2BDemo_Course

Code Block
{
  'query': {
    'bool': {
      'must': [
        {'term': {'course_id':'course-v1:edX+DemoX+Demo_Course'}},
        {'term': {'username': 'edx'}}
      ]
    }
  }
}

This can be implemented with the following SQL.

Code Block
SELECT * FROM user_activity
WHERE
	course_id='course-v1:edX+DemoX+Demo_Course' AND
	username='abigail123';

Code Block
http://localhost:19001/api/v0/learners/edx?course_id=course-v1%3AedX%2BDemoX%2BDemo_Course

Code Block
{
  'query': {
    'bool': {
      'must': [
        {'term': {'course_id':'course-v1:edX+DemoX+Demo_Course'}},
        {'term': {'username': 'edx'}}
      ]
    }
  }
}

...