Skip to content

Instantly share code, notes, and snippets.

@mcantelon
Created October 31, 2012 22:54
Show Gist options
  • Save mcantelon/3990484 to your computer and use it in GitHub Desktop.
Save mcantelon/3990484 to your computer and use it in GitHub Desktop.
Check if index exists
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