Changeset View
Changeset View
Standalone View
Standalone View
swh/search/interface.py
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | def origin_update(self, documents: Iterable[OriginDict]) -> None: | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("origin/search") | @remote_api_endpoint("origin/search") | ||||
def origin_search( | def origin_search( | ||||
self, | self, | ||||
*, | *, | ||||
query: str = "", | |||||
url_pattern: Optional[str] = None, | url_pattern: Optional[str] = None, | ||||
metadata_pattern: Optional[str] = None, | metadata_pattern: Optional[str] = None, | ||||
with_visit: bool = False, | with_visit: bool = False, | ||||
visit_types: Optional[List[str]] = None, | visit_types: Optional[List[str]] = None, | ||||
min_nb_visits: int = 0, | min_nb_visits: int = 0, | ||||
min_last_visit_date: str = "", | min_last_visit_date: str = "", | ||||
min_last_eventful_visit_date: str = "", | min_last_eventful_visit_date: str = "", | ||||
min_last_revision_date: str = "", | min_last_revision_date: str = "", | ||||
min_last_release_date: str = "", | min_last_release_date: str = "", | ||||
min_date_created: str = "", | min_date_created: str = "", | ||||
min_date_modified: str = "", | min_date_modified: str = "", | ||||
min_date_published: str = "", | min_date_published: str = "", | ||||
programming_languages: Optional[List[str]] = None, | programming_languages: Optional[List[str]] = None, | ||||
licenses: Optional[List[str]] = None, | licenses: Optional[List[str]] = None, | ||||
keywords: Optional[List[str]] = None, | keywords: Optional[List[str]] = None, | ||||
sort_by: Optional[List[str]] = None, | sort_by: Optional[List[str]] = None, | ||||
page_token: Optional[str] = None, | page_token: Optional[str] = None, | ||||
limit: int = 50, | limit: int = 50, | ||||
) -> PagedResult[MinimalOriginDict]: | ) -> PagedResult[MinimalOriginDict]: | ||||
"""Searches for origins matching the `url_pattern`. | """Searches for origins matching the `url_pattern`. | ||||
Args: | Args: | ||||
query: Find origins according the queries written as per the | |||||
swh-search query language syntax. | |||||
url_pattern: Part of the URL to search for | url_pattern: Part of the URL to search for | ||||
metadata_pattern: Keywords to look for | metadata_pattern: Keywords to look for | ||||
(across all the fields of intrinsic_metadata) | (across all the fields of intrinsic_metadata) | ||||
with_visit: Whether origins with no visit are to be | with_visit: Whether origins with no visits are to be filtered out | ||||
filtered out | |||||
visit_types: Only origins having any of the provided visit types | visit_types: Only origins having any of the provided visit types | ||||
(e.g. git, svn, pypi) will be returned | (e.g. git, svn, pypi) will be returned | ||||
min_nb_visits: Filter origins that have number of visits >= | min_nb_visits: Filter origins that have number of visits >= | ||||
the provided value | the provided value | ||||
min_last_visit_date: Filter origins that have | min_last_visit_date: Filter origins that have | ||||
last_visit_date on or after the provided date(ISO format) | last_visit_date on or after the provided date(ISO format) | ||||
min_last_eventful_visit_date: Filter origins that have | min_last_eventful_visit_date: Filter origins that have | ||||
last_eventful_visit_date (eventful = snapshot_id changed) | last_eventful_visit_date (eventful = snapshot_id changed) | ||||
Show All 31 Lines |