Skip to content

Instantly share code, notes, and snippets.

@ashishk1996
Created August 5, 2021 09:41
Show Gist options
  • Save ashishk1996/0aa7759cfc2e576c06d3ce5f25a4051c to your computer and use it in GitHub Desktop.
Save ashishk1996/0aa7759cfc2e576c06d3ce5f25a4051c to your computer and use it in GitHub Desktop.
Querying code for Algolia to check if replica index is queryable or not
# Python 3.8.2, 64bit, algoliasearch==2.5.0
from algoliasearch.search_client import SearchClient
#fetching data from algolia
ALGOLIA_APP_ID="<INSERT APP ID HERE>"
ALGOLIA_API_KEY="******************c1607" # ignore stars, only suffix is valid
client = SearchClient.create(ALGOLIA_APP_ID, ALGOLIA_API_KEY)
algoliaIndex = "v3_prod_author_recent"
index = client.init_index(algoliaIndex)
res = index.search('dummy data')
# Response
# RequestException: Index v3_prod_author_recent does not exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment