Using search in Roam

One of Roam’s goals is to encourage networked thought, so it’s important to learn how to use search to connect your ideas.

While the Roam search functionality is not yet fully developed, the recent launch of the Roam Portal plugin and the improvement in the Ctrl-Shift-9 option has improved the options available.

Two types of search in Roam

There are two types of search within Roam:

  1. searching for specific content in relevant pages or blocks
  2. searching for pages or blocks so you can add references to them elsewhere.

These are the current options for both types of search:

1) Searching for content so you can look at relevant pages or blocks:

  1. Use the page search bar
  2. Use the search bar on the ‘All Pages’ page
  3. Use linked and unlinked references
  4. Use Ctrl-F to search an individual page
  5. Use the Roam Portal plugin.

Filters and queries are also ways of searching in Roam but I am not going to go into them here. (We’ve also written a primer on Searching with Queries.)

2) Searching for pages or block so you can add references to them elsewhere:

  1. Simple block and page search
  2. Advanced block search.

Searching for content

The option with the most functionality is the Roam Portal plugin which is a Chrome extension.

Use the page search bar

The Search bar which can be found at the top of all individual pages (and zoomed in blocks) is the most limited option.

 

Each search returns a maximum of 15 items with priority given to page titles. If there are fewer than 15 page titles with the search term included, it will also show blocks that include the search term. When you click on a block link, you will be taken directly to that block rather than the page it features in.

Use the search bar on the All Pages page

The Search bar on the All Pages page provides more comprehensive results as it shows all instances of your search term. The search results can be sorted in either ascending or descending order by page title, word count, mentions (ie. number of block references a page has), the date the page was last updated and the date it was created.

To use it, go to the All Pages link to the top of the left-hand sidebar.

Then type in your search term in the Search box, which is the second box down on the top-right of the screen.

To sort the results, you can click on the upward or downward arrows in the column titles.

If you click on a particular page link, the page will open in the main window. If you Shift-Click the page link, it will open in the sidebar.

The drawbacks of this option at the moment are that:

  • you can’t specify an exact match so you can get extraneous pages appearing in your search results
  • you can’t exclude other search terms
  • when you click on the link, you are taken to the top of the page rather than the particular block you may be looking for.

Use linked and unlinked references

Another way of searching in Roam is to go to the page that has your search term as its title and look at the linked and unlinked references at the bottom of the page.

And, if your search term doesn’t already exist as a page, you just need to create a new page and then look in unlinked references.

The benefit of this option over using the All Pages search bar is that you can see the content of individual block references within the lists of linked and unlinked references — rather than needing to click to a new page.

Use Ctrl-F to search an individual page

Typing Ctrl-f will bring up a search box, which will show you all instances of your search term on that particular page.

Use the Roam Portal plugin

The Roam Portal plugin is a new Chrome extension developed by Dharam Kapila, which significantly improves the search experience in Roam by using the Roam alpha API.

Here’s a list of Roam Portal’s current capabilities:

  • View your recently edited blocks
  • Search within all of your block results and embeds
  • Get a 3d/2d view of your Roam Graph
  • Tweet individual blocks
  • View search results sorted by date
  • Filter search results by date
  • Filter search results by page
  • Visualize and compare usage of your page and block references over time
  • Visualize usage of your pages and words over time
  • Visualize frequencies of similar pages and words
  • Create saved searches
  • Search for only exact phrases
  • Search for matches with similar spellings
  • Filter out code blocks in your search.

You’re not limited to your own personal databases as you can use Roam Portal to search any databases that are shared with you – or any public Roams.
You can install the Roam Portal Chrome extension here.

The Roam Portal information page can be found here — and detailed documentation can be found here.

Searching to create references

One of the key benefits of Roam is the ability to connect content by tagging pages and creating block references.

Unless you know the exact page title you want to use or have access to the block you want to reference in the sidebar, you will often need to do a search to find the page or block you want to reference.

You can do this in two ways.

Use simple block and page search

By typing (()) and then the term you want to include, all blocks which include that term will appear. Once you have found the block you want to reference, you select and then the block reference will be created.

 

To tag a page, you type [[]] and follow the same process as above.

Use advanced block search

This option provides more choice in finding blocks and pages because it allows you to navigate the hierarchies of parent and child blocks until you find the block you want to reference.

Summary instructions:

  • put your cursor in a block and type Ctrl-Shift-9 to bring up the search box
  • press Delete, Backspace or the Left arrow to move back up the hierarchical block path to a parent block
  • highlight a block and then press Tab, Enter or the Right arrow to add that block to the path and show the child blocks
  • to add a block reference:
    • either highlight a block and press Enter twice
    • or press Enter when there is no text in the Search bar and the last block in the path will be added.

Procedure

Important: Adding references only seems to work if you select blocks using the up or down arrows. I found the process wouldn’t work if I selected blocks by clicking on them with my mouse.

1. Put cursor in a block and type Ctrl-Shift-9 to bring up the search box.

2. If you are looking for a block on that particular page, start writing text in the Search bar. However, if you want to reference a block on another page, press Delete, Backspace or the Left arrow.

3. Start writing in text that relates to what you are searching for and blocks that feature that text will appear.

4. Press the Down arrow until you highlight the block you are interested in.

5. If you want to reference that particular block, press Enter twice.

6. If you want to explore the child blocks of that block, press Enter once and the child blocks will appear. You can then either use the Search bar to search for a particular block or use the Up arrow or Down arrow.

7. If you then decide you want to add the parent block as the reference (ie. the last block in the path), you should make sure there is no text in the Search bar and then press Enter.

8. If, at any point, you feel you are on the wrong block path, press Delete, Backspace or the Left arrow to move back up the hierarchical block path to a parent block. If you keep on doing this, you will get back to being able to search the whole database.

We will be producing a video on this process soon. In the meantime, you can see the three videos that Conor White-Sullivan has made on this feature combined into one here.

Tags:

Was this helpful?