Simple Boolean Search Operators

Use case or problem

I use other software with a massive data set (much larger than my current Obsidian vault). That software allows the use of Boolean search operators in the search box. It’s very simple:

  • “quotation marks for specific strings”
  • Asterisks for ‘truncation/wildcard’ search (“mask*” yields results for “mask” “masks” “masking” etc.)
  • Question mark for single character wildcard (“ols?n” yields results for “olsen” and “olson”).

When I search for similar functionality on Obsidian, people are quick to point out that AND and OR boolean operators work. However, the above mentioned (*, ?) do not work. Answers eventually direct me to this page.
Unfortunately, I’m not a programmer, so the following explanation about “regular expressions” looks like complete gobbledygook:

/\d{4}-\d{2}-\d{2}/ matches an ISO 8601 date, such as 2022-01-01

This appears to have nothing to do with Boolean search operators.

Proposed solution

  • Include the asterisk “*” as a truncation/wildcard Boolean search operator
  • Include the question mark “?” as a single character wildcard Boolean search operator
  • Include other Boolean operators as simple symbols such as:
  • | = OR
  • & = AND
  • ! = NOT
3 Likes

+1 - agree with the suggestion.

Boolean operators are a really good thing. I’m a bit surprised that it’s not there yet. I have read claims on the net that this search would already be possible. For example with Omnisearch. But even the simplest operators don’t work here. Impro* NEAR Ästh* results in zero hits

1 Like

This would be useful (altho not something I need often). The ways to do it with regexes are more complicated / less intuitive.

The regular expression for this is OK: a period instead of a question mark (plus the slashes to tell Search that it’s a regex): /ols.n/. (The period will also match a space or punctuation, but I think in most cases that won’t matter.)

The Search help page mostly relies on external sources to explain regular expressions. When this feature request was written, the external source was very confusing. It has since been replaced with 2 much friendlier ones (https://help.obsidian.md/plugins/search#Use+regular+expressions). Possibly this section could use simpler or more examples before sending people off site, tho.

1 Like