Skip to content

Commit

Permalink
docs(ddo,events): clarify indexing field
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Apr 2, 2024
1 parent 1d2a75f commit 4413e4c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions documentation/en/actor-events-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,13 @@ type EventEntry struct {
}
```

A `flags` field is used to convey metadata or hints about the entry, currently this is used to provide an indication of the suitability of that field for indexing when stored or when used for querying.
A `flags` field is used to convey metadata or hints about the entry, currently this is used to provide an indication of the suitability of that field for indexing. Suitability for indexing is only a hint, and typically relates to the queriability of the content of that field.

* A `flag` of `0x00` indicates that neither the key nor value are suitable for indexing.
* A `flag` of `0x01` indicates that the key only is suitable for indexing.
* A `flag` of `0x02` indicates that the value is suitable for indexing.
* A `flag` of `0x03` indicates that both the key and value are suitable for indexing.

Suitability for indexing is a hint, and will typically indicate the uniqueness of the content. For example if a value has an arbitrary number, such as a `piece-size`, it's unlikely to be suitable for building an index for. However, if a field such as a `"provider"` contains an actor ID, it is likely to be suitable for indexing because queries may be made for all events from a particular actor.

Typically events contain entires that use either use `0x01` or `0x03` flags.

The structured logging style of composition should be seen in contrast to an alternative representation as a plain map or struct where the keys represent the fields of the event and the values represent the values of those fields. Some entries may duplicate keys, in which case that particular field of the event could be represented as an array. Builtin actor events are sufficiently well defined that translation to such a format is possible, but left up to the user.
Expand Down

0 comments on commit 4413e4c

Please sign in to comment.