swh.search.interface module

class swh.search.interface.MinimalOriginDict(**kwargs)[source]

Bases: dict

Mandatory keys of an :cls:`OriginDict`

url: str
class swh.search.interface.OriginDict(**kwargs)[source]

Bases: dict

Argument passed to SearchInterface.origin_update().

visit_types: List[str]
has_visits: bool
url: str
class swh.search.interface.SearchInterface[source]

Bases: object

check()[source]

Dedicated method to execute some specific check per implementation.

flush()None[source]

Blocks until all previous calls to _update() are completely applied.

origin_update(documents: Iterable[swh.search.interface.OriginDict])None[source]

Persist documents to the search backend.

Searches for origins matching the url_pattern.

Parameters
  • url_pattern – Part of the URL to search for

  • with_visit – Whether origins with no visit are to be filtered out

  • visit_types – Only origins having any of the provided visit types (e.g. git, svn, pypi) will be returned

  • page_token – Opaque value used for pagination

  • limit – number of results to return

Returns

PagedResult of origin dicts matching the search criteria. If next_page_token is None, there is no longer data to retrieve.