Skip to content

Searches

cinnamon-rolls edited this page Jul 9, 2021 · 1 revision

Searches

The simplest search definition is a single string, which will match all files in the database to a single tag, e.g.

"evil tag"

The single string definition is completely equivalent to passing an array of strings with only one element

["foo"]

If an array is given with multiple elements, then it will match all files in the database that have all of those tags e.g.

["foo", "bar", "barfoo (...)"]

To perform an "OR" search, use the following syntax, which is defined recursively

{
  "op": "union",
  "of": [
    "search definition...",
    "search definition...",
    "search definition (as many or as little as you'd like)..."
  ]
}

Tags can be negated by putting a - in front of the tag's name, and namespaces can be searched with wildcards using the * character, e.g. character:*

Special Definitions

These special definitions are included for debugging and experimental purposes

Boolean

When the root element of a search is a boolean value (true or false), then the search will either return all files in the database or no files at all respectively.

Null/Undefined

When the root element of the search document is null, or is otherwise left undefined, then the search will return no files at all (equivalent to false)