Skip to content

Commit

Permalink
vale
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh committed May 22, 2024
1 parent e390422 commit 46cc0d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions _search-plugins/ubi/sql-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,14 @@ from .ubi_log_queries
where query_id ='1065c70f-d46a-442f-8ce4-0b5e7a71a892'
order by timestamp
```

(In this generated data, the `query` field is plain text; however in the real implementation the query will be in the internal DSL of the query and parameters.)

<!-- vale off -->
query_response_id|query_id|user_id|query|query_response_objects_ids|session_id|timestamp
---|---|---|---|---|---|---
1065c70f-d46a-442f-8ce4-0b5e7a71a892|1065c70f-d46a-442f-8ce4-0b5e7a71a892|155_7e3471ff-14c8-45cb-bc49-83a056c37192|Blanditiis quo sint repudiandae a sit.|8659955|fa6e3b1c-3212-44d2-b16b-690b4aeddbba_1975|2027-04-17 10:16:45
<!-- vale on -->

In the event log
Search for the events that correspond to the query above, `1065c70f-d46a-442f-8ce4-0b5e7a71a892`.

Check warning on line 136 in _search-plugins/ubi/sql-queries.md

View workflow job for this annotation

GitHub Actions / vale

[vale] _search-plugins/ubi/sql-queries.md#L136

[OpenSearch.DirectionAboveBelow] Use 'previous, preceding, or earlier' instead of 'above' for versions or orientation within a document. Use 'above' and 'below' only for physical space or screen descriptions.
Raw output
{"message": "[OpenSearch.DirectionAboveBelow] Use 'previous, preceding, or earlier' instead of 'above' for versions or orientation within a document. Use 'above' and 'below' only for physical space or screen descriptions.", "location": {"path": "_search-plugins/ubi/sql-queries.md", "range": {"start": {"line": 136, "column": 52}}}, "severity": "WARNING"}
Expand Down
10 changes: 5 additions & 5 deletions _search-plugins/ubi/ubi-dashboard-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ nav_order: 7
---

# Build an analytic dashboard for UBI
Whether you've been collecting user events and queries for a while, or [you uploaded some sample events](https://github.com/o19s/chorus-opensearch-edition/blob/main/katas/003_import_preexisting_event_data.md), now you're ready to visualize them in the dashboard using User Behavior Insights.
Whether you've been collecting user events and queries for a while, or [you uploaded some sample events](https://github.com/o19s/chorus-opensearch-edition/blob/main/katas/003_import_preexisting_event_data.md), now you're ready to visualize them in the dashboard using User Behavior Insights (UBI).

Check failure on line 10 in _search-plugins/ubi/ubi-dashboard-tutorial.md

View workflow job for this annotation

GitHub Actions / vale

[vale] _search-plugins/ubi/ubi-dashboard-tutorial.md#L10

[Vale.Terms] Use 'OpenSearch' instead of 'opensearch'.
Raw output
{"message": "[Vale.Terms] Use 'OpenSearch' instead of 'opensearch'.", "location": {"path": "_search-plugins/ubi/ubi-dashboard-tutorial.md", "range": {"start": {"line": 10, "column": 137}}}, "severity": "ERROR"}


## 1) Fire up the OpenSearch dashboards
Expand Down Expand Up @@ -46,8 +46,8 @@ Most of the visualization require some sort of aggregate function on an bucket/f

Save that visualization and it will be added to your new dashboard. Now that you have a visualization on your dashboard, you can save your dashboard.

## 4) Add a "Tag Cloud" vizualization to your dashboard
Let's add a word cloud for trending searches. Choose the Tag Cloud visualization of the terms in the `message` field where the javascript client logs the raw text that the user searches on. (Note: the true query, as processed by OpenSearch with filters, boosting, and so on will be in the `.{store}_queries` index, but what we are looking at is the `message` field of the `.{store}_events` index, where the JavaScript client captures what the user actually typed. )
## 4) Add a "tag cloud" vizualization to your dashboard
Let's add a word cloud for trending searches. Choose the Tag Cloud visualization of the terms in the `message` field where the JavaScript client logs the raw text that the user searches on. (Note: the true query, as processed by OpenSearch with filters, boosting, and so on will be in the `.{store}_queries` index, but what we are looking at is the `message` field of the `.{store}_events` index, where the JavaScript client captures what the user actually typed. )
![Word Cloud]({{site.url}}{{site.baseurl}}/images/ubi/tag_cloud1.png "Word Cloud")

**But there's a problem!** The `message` field is on *every* event --not only query/search events-- and can be used in anyway the client developer decides to use it; so, it can contain error messages, debug messages, click information, and so on.
Expand All @@ -62,7 +62,7 @@ To add a histogram, first, add a vertical bar chart.

<img src="{{site.url}}{{site.baseurl}}/images/ubi/visualizations2.png" alt="Vertical Bar Chart" width="300"/>

The data field we want to examine is `event_attributes.position.ordinal`, meaning the user clicked on the *n*th item in a list. The y-axis will be the number of times that *n-th* was clicked. The x-axis will be the ordinal number itself that was clicked, using the `Histogram` aggregation.
The data field we want to examine is `event_attributes.position.ordinal`, meaning the user clicked on the *n-th* item in a list. The y-axis will be the number of times that *n-th* was clicked. The x-axis will be the ordinal number itself that was clicked, using the `Histogram` aggregation.

![Vertical Bar Chart]({{site.url}}{{site.baseurl}}/images/ubi/histogram.png "Vertical Bar Chart")

Expand All @@ -73,4 +73,4 @@ For example, let's see how the click position changes when there is a purchase,
Or let's see what event messages include "\*UBI\*" somewhere between the wildcards.
![UBI]({{site.url}}{{site.baseurl}}/images/ubi/ubi.png "UBI")

You now have a basic dashboard that lets you look at the data. In the next katas we'll focus on some typical ecommerce driven scenarios.
You now have a basic dashboard that lets you look at the data. In the next kata we'll focus on some typical ecommerce driven scenarios.

Check failure on line 76 in _search-plugins/ubi/ubi-dashboard-tutorial.md

View workflow job for this annotation

GitHub Actions / vale

[vale] _search-plugins/ubi/ubi-dashboard-tutorial.md#L76

[OpenSearch.Spelling] Error: kata. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.
Raw output
{"message": "[OpenSearch.Spelling] Error: kata. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.", "location": {"path": "_search-plugins/ubi/ubi-dashboard-tutorial.md", "range": {"start": {"line": 76, "column": 76}}}, "severity": "ERROR"}

0 comments on commit 46cc0d9

Please sign in to comment.