Created
October 31, 2012 22:54
-
-
Save mcantelon/3990484 to your computer and use it in GitHub Desktop.
Check if index exists
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
conn = pyes.ES('127.0.0.1:9200') | |
indexes = conn.get_indices() | |
if 'fpr_file' not in indexes: | |
# Grab relevant FPR data from the DB | |
results = get_fpr_table() | |
# Setup indexing for some Elastic Search action. | |
for row in results: | |
conn.index(row, 'fpr_file', 'fpr_files') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment