The RemNote Query Language is used to describe what Rems 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 Rems that reference SomeRem.
Is Tagged With (
#SomeRem): Matches Rems tagged with SomeRem, as well as Rems tagged with any Rem that SomeRem is tagged with (tag inheritance).
Is Directly Tagged With (
!#SomeRem): Matches Rems 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 Rems that you can see if you open the document SomeRem. This includes Rems in fixed portals, but not search portals, and does not include Rems that are children of collapsed Rems.
Descendant Of (
^^SomeRem): Matches Rems that are direct descendants of SomeRem. This does not include Rems in portals, but does include Rems that are children of collapsed Rems.
Any Connection To (
*SomeRem): Matches Rems that are connected to SomeRem through any kind of link (reference, tag, descendant, etc.).
Has Text (
"text"): Matches Rems that contain the string of text within the quotation marks.
Has Rem Type (
remType:none): Matches Rems 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 Rems that match both terms X and Y.
X or Y: Matches Rems that match either term X or term Y, or both.
not X: Matches Rems that do not match term X.
X and (Y or Z): Matches Rems that match both X, and either Y or Z.
X and not Y or Z: Matches Rems that match X, but do not match Y; or Rems that match Z, irrespective of whether they match X or Y.