Changeset View
Changeset View
Standalone View
Standalone View
swh/web/common/service.py
Show First 20 Lines • Show All 260 Lines • ▼ Show 20 Lines | Returns: | ||||
list of origin information as dict. | list of origin information as dict. | ||||
""" | """ | ||||
origins = storage.origin_search(url_pattern, offset, limit, regexp, | origins = storage.origin_search(url_pattern, offset, limit, regexp, | ||||
with_visit) | with_visit) | ||||
return map(converters.from_origin, origins) | return map(converters.from_origin, origins) | ||||
def search_origin_metadata(fulltext, offset=0, limit=50): | |||||
"""Search for origins whose metadata match a provided string pattern. | |||||
Args: | |||||
fulltext: the string pattern to search for in origin metadata | |||||
offset: number of found origins to skip before returning results | |||||
limit: the maximum number of found origins to return | |||||
Returns: | |||||
list of origin metadata as dict. | |||||
""" | |||||
return idx_storage.origin_intrinsic_metadata_search_fulltext( | |||||
conjunction=[fulltext], limit=limit) | |||||
def lookup_person(person_id): | def lookup_person(person_id): | ||||
"""Return information about the person with id person_id. | """Return information about the person with id person_id. | ||||
Args: | Args: | ||||
person_id as string | person_id as string | ||||
Returns: | Returns: | ||||
person information as dict. | person information as dict. | ||||
▲ Show 20 Lines • Show All 753 Lines • Show Last 20 Lines |