datacube.index.abstract.AbstractDatasetResource.search_returning#

abstract AbstractDatasetResource.search_returning(field_names=None, custom_offsets=None, limit=None, archived=False, order_by=None, **query)[source]#

Perform a search, returning only the specified fields.

This method can be faster than normal search() if you don’t need all fields of each dataset.

It also allows for returning rows other than datasets, such as a row per uri when requesting field ‘uri’.

Parameters:
  • field_names (Optional[Iterable[str]]) – Names of desired fields (default = all known search fields, unless custom_offsets is set, see below)

  • custom_offsets (Optional[Mapping[str, Tuple[Union[str, int], ...]]]) – A dictionary of offsets in the metadata doc for custom fields custom offsets are returned in addition to fields named in field_names. Default is None, field_names only. If field_names is None, and custom_offsets are provided, only the custom offsets are included, over-riding the normal field_names default.

  • limit (int | None) – Limit number of dataset (None/default = unlimited)

  • archived (bool | None) – False (default): Return active datasets only. None: Include archived and active datasets. True: Return archived datasets only.

  • order_by (Optional[Iterable[Any]]) – a field name, field, function or clause by which to sort output. None is unsorted and may allow faster return of first result depending on the index driver’s implementation.

  • geopolygon – Spatial search polygon (only supported if index supports_spatial_indexes)

  • query (str | float | int | Range | datetime | Not) – search query parameters

Return type:

Iterable[tuple]

Returns:

Namedtuple of requested fields, for each matching dataset.