Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user_query as optional attribute to the Events Schema #35

Open
wrigleyDan opened this issue Jan 24, 2025 · 0 comments
Open

Add user_query as optional attribute to the Events Schema #35

wrigleyDan opened this issue Jan 24, 2025 · 0 comments

Comments

@wrigleyDan
Copy link

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:

Image

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:

Image

Proposed solution

  1. Add user_query as an optional field to the Events schema
  2. Add user_query to the mappings in the UBI plugin for the ubi_events index identical to the ubi_queries mappings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant