created: 20211128212902292
from-version: 5.1.23
modified: 20230710073322863
rp-input: all titles from previous filter runs
rp-output: the titles that are present in both the result of this filter run and the output from previous runs
rp-purpose: find the intersection of titles from previous runs with titles in this filter
tags: [[Named Filter Run Prefix]]
title: Intersection Filter Run Prefix
type: text/vnd.tiddlywiki

<$railroad text="""
\start none
\end none
( ":intersection" | - )
[[run|"Filter Run"]]
"""/>

The filter output from previous runs is set aside. The `:intersection` filter run is started with all tiddler titles as input. Once this filter run has completed, the output is compared to the set-aside output. A new output is produced that contains only titles that appeared in both the set-aside output and the latest output. The order of titles in the output is preserved from the accumulated results.

!! Difference from `:and` / `+`

The key difference between `:intersection` and `:and` (or `+`) is what they receive as ''input'':

* `:and` / `+` feeds the ''accumulated results so far'' as input to the filter run. Operators in the run can only see and work with titles already in the results.
* `:intersection` feeds ''all tiddler titles'' as input to the filter run (just like an unprefixed run), then keeps only titles that also appear in the accumulated results.

This means `:intersection` can match titles using operators that need to start from the full tiddler pool. See [[Interchangeable Filter Run Prefixes]] for more details.

[[Intersection Filter Run Prefix (Examples)]]
