Commit c96bf07b by Greg Price

Merge pull request #3817 from edx/gprice/forum-search-event-page

Add page num to forum search tracking log events
parents 38e882e8 eb0e6c90
...@@ -1841,13 +1841,15 @@ After a user executes a text search in the navigation sidebar of the Discussion ...@@ -1841,13 +1841,15 @@ After a user executes a text search in the navigation sidebar of the Discussion
``event`` **Fields**: ``event`` **Fields**:
+---------------------+---------------+---------------------------------------------------------------------+ +---------------------+---------------+----------------------------------------------------------------------------------------------------+
| Field | Type | Details | | Field | Type | Details |
+=====================+===============+=====================================================================+ +=====================+===============+====================================================================================================+
| ``query`` | string | The text entered into the search box by the user. | | ``query`` | string | The text entered into the search box by the user. |
+---------------------+---------------+---------------------------------------------------------------------+ +---------------------+---------------+----------------------------------------------------------------------------------------------------+
| ``total_results`` | integer | The total number of results matching the query. | | ``page`` | integer | Results are returned in sets of 20 per page. Identifies the page of results requested by the user. |
+---------------------+---------------+---------------------------------------------------------------------+ +---------------------+---------------+----------------------------------------------------------------------------------------------------+
| ``total_results`` | integer | The total number of results matching the query. |
+---------------------+---------------+----------------------------------------------------------------------------------------------------+
.. _Instructor_Event_Types: .. _Instructor_Event_Types:
...@@ -2127,4 +2129,4 @@ members also generate enrollment events. ...@@ -2127,4 +2129,4 @@ members also generate enrollment events.
enrollment. When this feature is used to unenroll students from a course, the enrollment. When this feature is used to unenroll students from a course, the
server emits a ``edx.course.enrollment.deactivated`` for each unenrollment. server emits a ``edx.course.enrollment.deactivated`` for each unenrollment.
For details about the enrollment events, see :ref:`enrollment`. For details about the enrollment events, see :ref:`enrollment`.
\ No newline at end of file
...@@ -61,6 +61,7 @@ class Thread(models.Model): ...@@ -61,6 +61,7 @@ class Thread(models.Model):
if query_params.get('text'): if query_params.get('text'):
search_query = query_params['text'] search_query = query_params['text']
course_id = query_params['course_id'] course_id = query_params['course_id']
requested_page = params['page']
total_results = response.get('total_results') total_results = response.get('total_results')
# Record search result metric to allow search quality analysis. # Record search result metric to allow search quality analysis.
# course_id is already included in the context for the event tracker # course_id is already included in the context for the event tracker
...@@ -68,13 +69,15 @@ class Thread(models.Model): ...@@ -68,13 +69,15 @@ class Thread(models.Model):
'edx.forum.searched', 'edx.forum.searched',
{ {
'query': search_query, 'query': search_query,
'page': requested_page,
'total_results': total_results, 'total_results': total_results,
} }
) )
log.info( log.info(
'forum_text_search query="{search_query}" course_id={course_id} total_results={total_results}'.format( 'forum_text_search query="{search_query}" course_id={course_id} page={requested_page} total_results={total_results}'.format(
search_query=search_query, search_query=search_query,
course_id=course_id, course_id=course_id,
requested_page=requested_page,
total_results=total_results total_results=total_results
) )
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment