-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Add the attribute user_query to the Events Schema to provide a unified view on events related to user queries. Filtering the UBI dashboard to a single query gives the user an inconsistent view.
Background Information
At the moment user_query is a required attribute for the Query object (see https://o19s.github.io/ubi/docs/html/1.2.0/query.request.schema.html). As a consequence there is an explicit field mapping for the ubi_queries index in the user-behavior-insights plugin (see https://github.com/opensearch-project/user-behavior-insights/blob/main/src/main/resources/queries-mapping.json).
user_query is not included in the Events object schema. As a consequence there is no explicit field mapping for the ubi_events index in the user-behavior-insights plugin (see https://github.com/opensearch-project/user-behavior-insights/blob/main/src/main/resources/events-mapping.json).
However, in Chorus we track the user_query for click events that are implemented as Events. This leads to user queries being stored differently in the two indexes when the field is automatically generated in ubi_events and explicitly configured in ubi_queries. This prevents a unified dashboard view that pulls together information from both indexes (the dashboard in the UBI plugin https://github.com/opensearch-project/user-behavior-insights/tree/main/ubi-dashboards) when it comes to filtering the data.
(NB: this would happen in every application, is not related to Chorus alone).
Example
To include the average click position per query it is necessary to aggregate on the field user_query.keyword. When a user now wants to drill into the details for one specific query, for example red laptop case, he adds the filter user_query.keyword: red laptop case to the dashboard.
As a result the user sees nothing, as the explicit field mapping for the ubi_queries index does not know this field. It has the user query stored in the field user_query:
Doing it the other way round (filtering on the field user_query instead of user_query.keyword) leads to inaccurate results when including data from the ubi_events index. Here is an example for a Data Table to show the average click position with the set filter user_query: red laptop case:
Proposed solution
- Add
user_queryas an optional field to the Events schema - Add
user_queryto the mappings in the UBI plugin for theubi_eventsindex identical to theubi_queriesmappings

