Query: Context Directive

00001007720300 · Info · (manual) · #manual #search #zettelstore (all) · Context

A context directive calculates the context of a list of zettel identifier. It starts with the keyword CONTEXT.

Optionally you may specify some context details, after the keyword CONTEXT, separated by space characters. These are:

If neither BACKWARD nor FORWARD is specified, the search for context zettel will follow both backward and forward links.

If both BACKWARD and FORWARD are specified, the search for context zettel will be performed as DIRECTED. Internally, DIRECTED is just a shorthand for specifying both BACKWARD and FORWARD.

If any of the three direction specifiers BACKWARD, FORWARD, and DIRECTED is specified more than once, parsing of the thread directive is stopped. All following text is then interpreted either as other directives or as a search term.

The cost of a context zettel is calculated iteratively:

The maximum cost is only checked for all zettel that are not directly reachable from the initial, specified list of zettel. This ensures that initial zettel that have only a highly used tag, will also produce some context zettel.

Despite its possibly complicated structure, this algorithm ensures in practice that the zettel context is a list of zettel, where the first elements are “near” to the specified zettel and the last elements are more “distant” to the specified zettel. It also penalties zettel that acts as a “hub” to other zettel, to make it more likely that only relevant zettel appear on the context list.

This directive may be specified only once as a query directive. A second occurence of CONTEXT is interpreted as a search expression. In most cases it is easier to adjust the maximum cost than to perform another context search, which is relatively expensive in terms of retrieving effort.