The RemNote Query Language is used to describe what Rem you want to display in a Search Portal. You can use a wide variety of criteria and be much more specific than when using standard searches (e.g., in Ctrl+P search or reference search).
The Query Builder
There are two ways to write queries: by directly typing text, and by using the Query Builder, which provides a graphical interface for designing queries. You can open the Query Builder by clicking on the filter icon next to a search portal.
You can switch back and forth between using the Query Builder and directly editing the search query in the text box at any time. New users should start with the Query Builder.
Query Filters and Operators
Options in the Query Builder are shown in bold; the syntax used when manually writing a query is shown in
Here, SomeRem represents a Rem Reference inserted into the query with
[[. (If you're using the Query Builder, you don't have to type
[[; reference search will start automatically when you click in the right-hand drop-down, Cat in the screenshot above.)
Has Reference To (
SomeRem): Matches Rem that reference SomeRem.
Is Tagged With (
#SomeRem): Matches Rem tagged with SomeRem, as well as Rem tagged with any Rem that SomeRem is tagged with (tag inheritance).
Is Directly Tagged With (
!#SomeRem): Matches Rem tagged with SomeRem (no tag inheritance).
Documents That Have (
@SomeRem): Matches documents that contain SomeRem, either as a direct descendant or as a portal. (Documents that contain a reference to SomeRem are not included; if you want this behavior, try
*SomeRem, explained below.)
In Document (
^SomeRem): Matches Rem that you can see if you open the document SomeRem. This includes Rem in fixed portals, but not search portals, and does not include Rem that are children of collapsed Rem.
Descendant Of (
^^SomeRem): Matches Rem that are direct descendants of SomeRem. This does not include Rem in portals, but does include Rem that are children of collapsed Rem.
Any Connection To (
*SomeRem): Matches Rem that are connected to SomeRem through any kind of link (reference, tag, descendant, etc.).
Has Text (
"text"): Matches Rem that contain the string of text within the quotation marks.
Has Rem Type (
remType:none): Matches Rem that are Concepts, Descriptors, or neither.
~: The tilde never matches anything. When writing a query manually, you can use this as a placeholder for an expression to be inserted later.
Search terms above can be combined into expressions using
not, and grouped using Query Groups (in the visual query builder) or parentheses (in manually written queries). Here, X, Y, and Z represent connections or miscellaneous search terms from the lists above.
In manually written queries,
or have the same precedence and are evaluated from left to right.
not has higher precedence than either.
X and Y: Matches Rem that match both terms X and Y.
X or Y: Matches Rem that match either term X or term Y, or both.
not X: Matches Rem that do not match term X.
X and (Y or Z): Matches Rem that match both X, and either Y or Z.
X and not Y or Z: Matches Rem that match X, but do not match Y; or Rem that match Z, irrespective of whether they match X or Y.