def get_wh_index(): if 'WH_SEARCH_USER' in os.environ and 'WH_SEARCH_KEY' in os.environ: client = algoliasearch.Client(os.environ['WH_SEARCH_USER'], os.environ['WH_SEARCH_KEY']) index_name = os.environ[ 'WH_INDEX_NAME'] if 'WH_INDEX_NAME' in os.environ else "dev_KOTLINLANG_WEBHELP" return Index(client, index_name) return None
def get_index() -> Index: index_name = os.environ['INDEX_NAME'] if 'INDEX_NAME' in os.environ else "dev_KOTLINLANG" return Index(get_client(), index_name)