swh.search.elasticsearch module#

swh.search.elasticsearch.token_encode(index_to_tokenize: Dict[bytes, Any]) str[source]#

Tokenize as string an index page result from a search

swh.search.elasticsearch.token_decode(page_token: str) Dict[bytes, Any][source]#

Read the page_token

class swh.search.elasticsearch.ElasticSearch(hosts: List[str], indexes: Dict[str, Dict[str, str]] = {})[source]#

Bases: object

check()[source]#
deinitialize() None[source]#

Removes all indices from the Elasticsearch backend

initialize() None[source]#

Declare Elasticsearch indices, aliases and mappings

flush() None[source]#
origin_update(documents: Iterable[OriginDict]) None[source]#
origin_get(url: str) Dict[str, Any] | None[source]#
origin_delete(url: str) bool[source]#
visit_types_count() Counter[source]#