module documentation
(source)

This module contains the logic for searching in a notebook.

Supported operators:

  • "NOT", "not" and "-"
  • "AND", "and", "+" and "&&"
  • "OR", "or" and "||"

Order of precedence: AND, OR, NOT so "foo AND NOT bar OR baz" means AND(foo, OR(NOT(bar), baz))

Supported keywords:

  • Content
  • Name
  • Section: alias for "Name XXX or Name: XXX:*"
  • Namespace: alias for "Name XXX or Name: XXX:*" -- backward compatible
  • Links: forward - alias for linksfrom
  • LinksFrom: forward
  • LinksTo: backward
  • ContentOrName: the default, like Name: *X* or Content: X
  • Tag: look for a single tag

For the Content field we need to request the actual page contents, all other fields we get from the index and are more efficient to query.

For link keywords only a '*' at the right side is allowed For the name keyword a '*' is allowed on both sides For content '*' can occur on both sides, but does not match whitespace

Class PageSelection This class is just a container of path objects
Class Query No summary
Class QueryGroup Wrapper for a sub group of a query. Just a list of QueryTerms with an associated operator (either AND or OR).
Class QueryTerm Wrapper for a single term in a query. Consists of a keyword, a string and a flag for inverse (NOT operator).
Class SearchSelection No summary
Constant KEYWORDS Undocumented
Constant OPERATOR_AND Undocumented
Constant OPERATOR_NOT Undocumented
Constant OPERATOR_OR Undocumented
Variable keyword_re Undocumented
Variable logger Undocumented
Variable operators Undocumented
Variable operators_re Undocumented
Variable tag_re Undocumented
KEYWORDS: tuple[str, ...] = (source)

Undocumented

Value
('content',
 'name',
 'namespace',
 'section',
 'contentorname',
 'links',
 'linksfrom',
...
OPERATOR_AND: int = (source)

Undocumented

Value
2
OPERATOR_NOT: int = (source)

Undocumented

Value
3
OPERATOR_OR: int = (source)

Undocumented

Value
1
keyword_re = (source)

Undocumented

logger = (source)

Undocumented

operators = (source)

Undocumented

operators_re = (source)

Undocumented

tag_re = (source)

Undocumented