ODataV4Search

ODataV4Search#

class eodag.plugins.search.qssearch.ODataV4Search(provider, config)[source]#

A specialisation of a QueryStringSearch that does a two step search to retrieve all products metadata. All configuration parameters of QueryStringSearch are also available for this plugin. In addition, the following parameters can be configured:

Parameters:
  • provider (str) – provider name

  • config (PluginConfig) –

    Search plugin configuration:

    • per_product_metadata_query (bool): should be set to true if the metadata is not given in the search result and a two step search has to be performed; default: false

    • metadata_pre_mapping (MetadataPreMapping) : a dictionary which can be used to simplify further metadata extraction. For example, going from $.Metadata[?(@.id="foo")].value to $.Metadata.foo.value. It has the keys:

    • free_text_search_operations: (optional) A tree structure of the form:

      # noqa: E800
      <search-param>:     # e.g: $search
          union: # how to join the operations below (e.g: ' AND ' -->
              # '(op1 AND op2) AND (op3 OR op4)')
          wrapper: # a pattern for how each operation will be wrapped
                  # (e.g: '({})' --> '(op1 AND op2)')
          operations:     # The operations to build
          <opname>:     # e.g: AND
              - <op1>    # e.g:
                      # 'sensingStartDate:[{startTimeFromAscendingNode}Z TO *]'
              - <op2>    # e.g:
                  # 'sensingStopDate:[* TO {completionTimeFromAscendingNode}Z]'
              ...
          ...
      ...
      

      With the structure above, each operation will become a string of the form: (<op1> <opname> <op2>), then the operations will be joined together using the union string and finally if the number of operations is greater than 1, they will be wrapped as specified by the wrapper config key.

__init__(provider, config)[source]#
Parameters:

Methods

__init__(provider, config)

build_query_string(product_type, query_dict)

Build The query string using the search parameters

build_sort_by(sort_by_arg)

Build the sorting part of the query string or body by transforming the sort_by argument into a provider-specific string or dictionary

clear()

Clear search context

collect_search_urls([prep])

Build paginated urls

count_hits(count_url[, result_type])

Count the number of results satisfying some criteria

discover_product_types(**kwargs)

Fetch product types list from provider using discover_product_types conf

discover_product_types_per_page(**kwargs)

Fetch product types list from provider using discover_product_types conf using paginated kwargs["fetch_url"]

discover_queryables(**kwargs)

Fetch queryables list from provider using discover_queryables conf

do_search([prep])

A two step search can be performed if the metadata are not given into the search result

get_assets_from_mapping(provider_item)

Create assets based on the assets_mapping in the provider's config and an item returned by the provider

get_collections(prep, **kwargs)

Get the collection to which the product belongs

get_metadata_mapping([product_type])

Get the plugin metadata mapping configuration (product type specific if exists)

get_metadata_search_url(entity)

Build the metadata link for the given entity

get_product_type_cfg_value(key[, default])

Get the value of a configuration option specific to the current product type.

get_product_type_def_params(product_type[, ...])

Get the provider product type definition parameters and specific settings

get_sort_by_arg(kwargs)

Extract the sort_by argument from the kwargs or the provider default sort configuration

list_queryables(filters, ...[, ...])

Get queryables

map_product_type(product_type, **kwargs)

Get the provider product type from eodag product type

normalize_results(results, **kwargs)

Build EOProducts from provider results

query([prep])

Perform a search on an OpenSearch-like interface

queryables_from_metadata_mapping([...])

Extract queryable parameters from product type metadata mapping.

validate(search_params, auth)

Validate a search request.

Attributes

extract_properties

plugins

auth

next_page_url

next_page_query_obj

total_items_nb

need_count