Skip to main content

Categorization Index

A categorization index groups nodes based on their value of a given field.

TypeScript
new Garak.CategorizationIndex(
Store,
"index_on"
);
Rust
garak::CategorizationIndex::new(
&store,
"index_on"
);

Index On

This field will be used to categorize nodes. If the field value resolves to an array, the node will be categorized under each value of the array.

Include

Optionally, an include option may be specified, limiting which nodes get included in the categorization:

TypeScript
new Garak.CategorizationIndex(
Store,
"index_on",
{
include: {
"status": {
$eq: "active"
}
}
}
);

Nodes will only be added to the categorization if the include selector resolves to true. If a node originally had the include selector match, but has an update that results in the selector no longer matching, it will be removed from the index.