Search - Core - Query package

Boolean Filter

class citrination_client.search.core.query.boolean_filter.BooleanFilter(logic=None, weight=None, exists=None, equal=None, filter=None, **kwargs)

Bases: pypif.util.serializable.Serializable

Boolean filter that can be applied to any field.

__init__(logic=None, weight=None, exists=None, equal=None, filter=None, **kwargs)

Constructor.

Parameters
  • logic – Logic for this filter. Must be equal to one of “MUST”, “MUST_NOT”, “SHOULD”, or “OPTIONAL”.

  • weight – Weight for the filter.

  • exists – True/False to simply test whether the field exists and has a non-null value.

  • equal – String with the phrase to match against.

  • filter – List of BooleanFilter objects with sub-filters.

equal
exists
filter
logic
weight

Data Query module

class citrination_client.search.core.query.data_query.DataQuery(logic=None, weight=None, simple=None, simple_weight=None, dataset=None, system=None, file=None, query=None, **kwargs)

Bases: pypif.util.serializable.Serializable

Query against dataset metadata, PIF content, file content, or some combination of those types.

__init__(logic=None, weight=None, simple=None, simple_weight=None, dataset=None, system=None, file=None, query=None, **kwargs)

Constructor.

Parameters
  • logic – The logic to apply to the query (‘SHOULD’, ‘MUST’, ‘MUST_NOT’, or ‘OPTIONAL’).

  • weight – Weight for the query.

  • simple – String with the simple search to run against all fields.

  • simple_weight – Dictionary of relative paths to their weights for simple queries.

  • dataset – One or more DatasetQuery objects with queries against dataset metadata.

  • system – One or more PifSystemQuery objects with queries against PIF systems

  • file (FileQuery) – One or more FileQuery objects with queries against file content or metadata.

  • query – Nested list of DataQuery objects.

dataset
file
logic
query
simple
simple_weight
system
weight

Data Scope module

class citrination_client.search.core.query.data_scope.DataScope(query=None, **kwargs)

Bases: pypif.util.serializable.Serializable

Query to against data.

__init__(query=None, **kwargs)

Constructor.

Parameters

query – One or more DataQuery objects with the queries to run.

query

Filter module

class citrination_client.search.core.query.filter.Filter(logic=None, weight=None, exists=None, equal=None, min=None, max=None, exact=None, filter=None, **kwargs)

Bases: pypif.util.serializable.Serializable

Filter that can be applied to any field.

__init__(logic=None, weight=None, exists=None, equal=None, min=None, max=None, exact=None, filter=None, **kwargs)

Constructor.

Parameters
  • logic – Logic for this filter. Must be equal to one of “MUST”, “MUST_NOT”, “SHOULD”, or “OPTIONAL”.

  • weight – Weight for the filter.

  • exists – True/False to simply test whether the field exists and has a non-null value.

  • equal – String with the phrase to match against.

  • min – String with the minimum value of a range to match against.

  • max – String with the maximum value of a range to match against.

  • exact – True/False to set whether the “equal” filter should be an exact match.

  • filter – List of Filter objects with sub-filters.

equal
exact
exists
filter
logic
max
min
weight

Multi Query module

class citrination_client.search.core.query.multi_query.MultiQuery(queries=None, **kwargs)

Bases: pypif.util.serializable.Serializable

Base class for all multi-search requests.

__init__(queries=None, **kwargs)

Constructor.

Parameters

queries – One or more queries to run.

queries