Feedback

VERSION 1.3.1

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 =
3 FeedbackEvent(
4 sessionId = sessionId,
5 type = FeedbackEventType.Accept,
6 resultId = ServiceFeedbackResultId(searchResultId),
7 position = selectedSearchResultIndex,
8 actionTime = dateTime,
9 )
10search.sendFeedback(feedbackEvent)