Logging of search queries and clicks

Logging which search queries are executed, as well as which results are clicked on by a user, is strongly recommended for two reasons:

  1. The algorithm can learn from a user's search behaviour and refine the user's know-how profile.
  2. KPI statistics about the number of searches provide an important indicator for how a network is performing.

Logging search queries

POST /search/log/query
Parameter Type Default Required Description
query string - The search query that was used.
query_type string - An optional query type.

Json Payload

{
    "query": "Is Sherlock really dead?",
    "query_type": "autocomplete"
}

Create a log entry for the given search query. An optional type of the search query can be specified, so that KPI statistics can differentiate between e.g. manually entered search queries and queries selected from autocomplete suggestions.

A search query id is returned, which should be used as a reference for logging clicks on questions in the results of this query.

Response

{
    "search_query_id": 1
}

Logging search clicks

POST /search/log/:questionId/click
Parameter Type Default Required Description
search_query_id integer - The id that was returned when logging the search query.
rank integer - Optionally, the position of the clicked question in the search results.

Json Payload

{
    "search_query_id": "2"
}

Create a log entry when a user clicks on one of the results after using the question search. The search query that was used needs to be logged beforehand, which creates a search query id that must be used as a parameter to this request.

Optionally, the rank of the question that was clicked on within the search results can also be logged, which makes a more detailed analysis of the search behaviour of users possible.

Logging similar question clicks

POST /search/log/:questionId/similar-question-click
Parameter Type Default Required Description
title string - The title that was used to obtain the similar questions.
description string - The description that was used to obtain the similar questions.
rank integer - Optionally, the position of the clicked question in the similar question results.

Create a log entry when a user clicks on one of the results after using the similar question search while writing a new question. The values of the title and description input fields that were used to obtain the similar questions, can be provided as a reference.

Optionally, the rank of the question that was clicked on within the similar questions can also be logged, which makes a more detailed analysis of the search behaviour of users possible.