Created
August 5, 2021 09:41
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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