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[swh.search.interface.OriginDict]) None[source]
origin_dump() Iterator[swh.model.model.Origin][source]