Feedback

VERSION 1.0.0

Sending feedback

The Feedback API collects the user’s interactions with the search functionality in apps. This feedback further improves search results.

The API is lightweight and takes very little code to use. Providing feedback will improve search results for all end-users of the search service. The Feedback API is used throughout a search session. A search session starts with a user typing a keyword and looking for a specific result. Users may "select" a result to see its details or "accept" a result as a conclusion.

To use the Feedback API, start by generating a UUIDv4 session ID. It will be used in Search request and Feedback request. Pass it to search or autocomplete options during a search session.

1sessionId = UUID.randomUUID()
2
3val query = "TomTom"
4val searchOptions = SearchOptions(query = query, sessionId = sessionId)
5val result = search.search(searchOptions)

When users interact with the search results, create a FeedbackEvent with the same session ID generated in the last step and relevant fields such as type. Call sendFeedback to send the event.

1val searchResultId = searchResponse.results[selectedSearchResultIndex].searchResultId
2val feedbackEvent = FeedbackEvent(
3 sessionId = sessionId,
4 type = FeedbackEventType.Accept,
5 resultId = ServiceFeedbackResultId(searchResultId),
6 position = selectedSearchResultIndex,
7 actionTime = dateTime
8)
9search.sendFeedback(feedbackEvent)