jina.drivers.querylang.filter

class jina.drivers.querylang.filter.FilterQL(lookups, *args, **kwargs)[source]

Bases: jina.drivers.QuerySetReader, jina.drivers.ContextAwareRecursiveMixin, jina.drivers.BaseRecursiveDriver

Filters incoming docs by evaluating a series of lookup rules.

This is often useful when the proceeding Pods require only a signal, not the full message.

Example :: - !FilterQL

with:

lookups: {modality: mode2}

  • !EncodeDriver
    with:

    method: encode

ensures that the EncodeDriver will only get documents which modality field value is mode2 by filtering those documents at the specific levels that do not comply with this condition

Parameters

lookups (Dict[str, Any]) – (dict) a dictionary where keys are interpreted by :class:`LookupLeaf to form a

an evaluation function. For instance, a dictionary { modality__in: [mode1, mode2] }, would create an evaluation function that will check if the field modality is found in [mode1, mode2] :param args: additional positional arguments which are just used for the parent initialization :param kwargs: additional key value arguments which are just used for the parent initialization

runtime: Optional[ZEDRuntime]