(zettel (meta (back "00001007700000 00001007720000") (backward "00001007700000 00001007720000") (box-number "1") (created "20250624162823") (forward "00001006020000 00001007701000 00001007720300") (modified "20250626174233") (published "20250626174233") (role "manual") (syntax "zmk") (tags "#manual #search #zettelstore") (title "Query: Thread Directive")) (rights 4) (encoding "") (content "A thread directive is similar to the [[context directive|00001007720300]] by calculating zettel associated with a list of zettel identifier.\nThere are three thread directives, beginning with the keywords ''FOLGE'', ''SEQUEL'', and ''THREAD''.\n\nWith the help of the ''FOLGE'' directive, you can list all zettel that belong to the same \"\"train of thought\"\".\nIt is possible to list all folge zettel only or only precursor zettel.\nAdditionally, you can specify the maximum number to be listed.\nA ''FOLGE'' directive considers only the metadata keys only metadata keys [[''folge''|00001006020000#folge]] and [[''precursor''|00001006020000#precursor]].\n\nSimilarly, the ''SEQUEL'' directive allows you to list all \"\"branching ideas\"\"\nYou can limit the search to only sequel or only prequel zettel, and you can also restrict the result size.\nThe ''SEQUEL'' directive works exclusively with the metadata keys [[''sequel''|00001006020000#sequel]] and [[''prequel''|00001006020000#prequel]].\n\nThe ''THREAD'' directive combines the functionality of the other two directives.\nIt lists all zettel (or a subset) that can be reached via the four metadata keys mentioned.\n\nOptionally yyou may specify additional parameters after the directive keyword, separated by space characters.\nThese include:\n* ''BACKWARD'': Search for zettel only via backward links, i.e. ''precursor'' and/or ''prequel''\n* ''FORWARD'': Search for zettel only via forward links, i.e. ''folge'' and/or ''sequel''\n* ''DIRECTED'': Search for zettel only in the same direction as the one that led to the current zettel.\n If the zettel is one of the initial zettel, search in both directions.\n\n ''DIRECTED'' is equivalent to ''FORWARD'' if the current zettel is a starting point of a ''folge'' and/or ''sequel'' sequence.\n It is equivalent to ''BACKWARD'' at the end of such a sequence (or at the beginning of a ''precursor'' and/or ''prequel'' sequence).\n* ''MAX'': Followed by one or more space characters and a positive integer, sets the maximum number of resulting Zettel (default: 0 = unlimited)\n\n\nIf neither BACKWARD nor FORWARD is specified, the search includes both backward and forward links.\n\nIf both ''BACKWARD'' and ''FORWARD'' are specified, the search for context zettel will be performed as ''DIRECTED''.\nInternally, ''DIRECTED'' is just a shorthand for specifying both ''BACKWARD'' and ''FORWARD''.\n\nIf any of the three direction specifiers ''BACKWARD'', ''FORWARD'', and ''DIRECTED'' is specified more than once, parsing of the thread directive is stopped.\nAll following text is then interpreted either as other directives or as a search term.\n\nThe resulting list is sorted by the relative distance to the originating zettel.\n\nThese directives may be specified only once as a query directive.\nA second occurence of ''FOLGE'', ''SEQUEL'' or ''THREAD'' is interpreted as a [[search expression|00001007701000]]."))