Qualio Docs

API Documentation from the Qualio Team

TagFilter

A node of the tag filter expression tree.

The NLP expression like "Any document with such tags, that it has at lest one tag with name X, or it has two tags with names Y and Z correspondingly" could be expressed using boolean logic as "X OR (Y AND Z)" (assuming that AND applies to separate two tags attached to same document).

Example

Document 1 tags: X U V
Document 2 tags: Y Z W
Document 3 tags: Y U W
  • Document 1 matches "X" part of the "X OR (Y AND Z)" expression.
  • Document 2 matches "Y AND Z" part of the "X OR (Y AND Z)" expression.
  • Document 3 does not match "X OR (Y AND Z)" expression, becase it only has tag Y and not Z.

The GraphQL expression tree for "X OR (Y AND Z)" would look as follows:

{
    or: [
        { name: "X" },
        and: [
            { name: "Y" },
            { name: "Z" }
        ]
    ]
}

This can be also written in shorter form as follows:

{
    name: "X",
    and: [
        { name: "Y" },
        { name: "Z" }
    ]
}

NOTE The children of the top level node are always implicitly forming OR expression. Note that A OR B OR C is equivalent to tagIn: [A, B, C], thus feels natural that OR is default at the top level.

Input Fields

name (String)
or ([TagFilter!])
and ([TagFilter!])