Dataset Queries

Dataset Query

class citrination_client.search.dataset.query.dataset_query.DatasetQuery(logic=None, weight=None, simple=None, simple_weight=None, id=None, is_featured=None, name=None, description=None, owner=None, email=None, updated_at=None, query=None, **kwargs)

Bases: pypif.util.serializable.Serializable

Class to store information about a dataset query.

__init__(logic=None, weight=None, simple=None, simple_weight=None, id=None, is_featured=None, name=None, description=None, owner=None, email=None, updated_at=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.

  • id – One or more Filter objects with filters against the id field.

  • is_featured – One or more BooleanFilter objects with filters against the isFeatured field.

  • name – One or more Filter objects with filters against the name field.

  • description – One or more Filter objects with filters against the description field.

  • owner – One or more Filter objects with filters against the owner field.

  • email – One or more Filter objects with filters against the email field.

  • updated_at – One or more Filter objects with filters against the time that the dataset was last updated.

  • query – One or more DatasetQuery objects with nested queries.

Dataset Returning Query

class citrination_client.search.dataset.query.dataset_returning_query.DatasetReturningQuery(query=None, from_index=None, size=None, random_results=None, random_seed=None, score_relevance=None, return_max_score=None, timeout=None, count_pifs=None, **kwargs)

Bases: citrination_client.search.core.query.base_returning_query.BaseReturningQuery

Query used to return information about datasets. Citrination does not support pagination past the 50,000th result. Please chose values for from_index and size that do not exceed this limit.

__init__(query=None, from_index=None, size=None, random_results=None, random_seed=None, score_relevance=None, return_max_score=None, timeout=None, count_pifs=None, **kwargs)

Constructor.

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

  • from_index – Index of the first hit that should be returned.

  • size – Total number of hits the should be returned.

  • random_results – Whether to return a random set of records.

  • random_seed – The random seed to use.

  • score_relevance – Whether to use relevance scoring.

  • return_max_score – Whether to return the maximum score.

  • timeout – The number of milliseconds to wait for the query to execute.

  • count_pifs – Whether to return counts of PIFs for each dataset.