swh.search.api.client module¶
-
class
swh.search.api.client.
RemoteSearch
(url, api_exception=None, timeout=None, chunk_size=4096, reraise_exceptions=None, **kwargs)[source]¶ Bases:
swh.core.api.RPCClient
Proxy to a remote search API
-
backend_class
¶ alias of
swh.search.interface.SearchInterface
-
check
()¶ Dedicated method to execute some specific check per implementation.
-
flush
() → None¶ Blocks until all previous calls to _update() are completely applied.
-
origin_search
(*, url_pattern: Optional[str] = None, metadata_pattern: Optional[str] = None, with_visit: bool = False, visit_types: Optional[List[str]] = None, page_token: Optional[str] = None, limit: int = 50) → swh.core.api.classes.PagedResult[swh.search.interface.MinimalOriginDict, str]¶ 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.
-
origin_update
(documents: Iterable[swh.search.interface.OriginDict]) → None¶ Persist documents to the search backend.
-