Skip to content

Commit

Permalink
aesthetics
Browse files Browse the repository at this point in the history
  • Loading branch information
RasonJ committed Apr 20, 2024
1 parent 5f61fcd commit 8490804
Showing 1 changed file with 34 additions and 15 deletions.
49 changes: 34 additions & 15 deletions documentation/schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,27 @@
- **Ubi Logging Client**: is in charge of indexing user events, such as onClick, in the **event store** along with the `query_id` that links to the underlying, technical query DSL and the results' `object_id`'s.

*Note:* We break out the roles of "search" and "Ubi logging" here, but many implementations will likely use the same OpenSearch client instance for both roles of searching and index writing.


```mermaid
graph TB
style L fill:none
subgraph L["`*Legend*`"]
subgraph ss[Standard Search]
direction LR
style ln1a fill:blue
ln1a[ ]--->ln1b[ ];
end
subgraph Ubi flow
direction LR
ln2a[ ].->|new|ln2b[ ];
style ln1c fill:red
ln1c[ ]-->|query_id|ln1d[ ];
end
end
linkStyle 0 stroke-width:2px,stroke:#0A1CCF
```

```mermaid
%%{init: {
"flowchart": {"htmlLabels": false},
Expand All @@ -17,45 +37,44 @@
}%%
graph TB
style OS stroke-width:2px, stroke:#0A1CCF, fill:#62affb, opacity:.5
style OS stroke-width:2px, stroke:#0A1CCF, fill:#62affb, opacity:.5
subgraph OS[OpenSearch Cluster fa:fa-database]
E[( Ubi Events )]
Docs[(Document Index)] --3) DSL & object_id's--> Q[( Ubi Queries )];
Q -."4) query_id".-> Docs ;
end
style *client-side* stroke-width:2px, stroke:#EC6363
Q -."4) query_id".-> Docs ;
end
style *client-side* stroke-width:2px, stroke:#EC6363
subgraph "`*client-side*`"
style User stroke-width:4px, stroke:#EC636
User["`*User*`" fa:fa-user]
App
Search
U
style App fill:#EC6363,opacity:.5
subgraph App[UserApp fa:fa-store]
subgraph App[       UserApp fa:fa-store]
Search( Search Client )
U( Ubi Client )
end
User--1) raw search string-->Search;
User--1) raw search string-->Search;
end
Search--2) search string-->Docs
Docs -. 6) query_id & objects...->Search ;
Docs -- 6) query_id & objects--->Search ;
Search --results--> User
Search-.7) query_id.->U;
User--8) selects
object_id:123-->U;
User -.8) selects object_id:123.->U;
U-."9) index event:{query_id, onClick, object_id:123}".->E;
linkStyle 3,0,5 stroke-width:2px,fill:none,stroke:#0A1CCF
linkStyle 2,3,5,0 stroke-width:2px,fill:none,stroke:#0A1CCF
linkStyle 1,4,6,8 stroke-width:2px,fill:none,stroke:red
```



linkStyle 2,4,6,8,10 stroke-width:2px,fill:none,stroke:red


Although the named fields below follow a schema which lends to easier analytics, the schema is dynamic and allows for users to add new dynamic fields where there is need.

[`user_id`](#user_id) represents a user. When UBI is active, any query that this user does, will generate a new `query_id` for this `user_id`.
Expand Down

0 comments on commit 8490804

Please sign in to comment.