Skip to content

Instantly share code, notes, and snippets.

@flyingclimber
Last active November 12, 2016 04:35
Show Gist options
  • Save flyingclimber/6c5b9f0667de1c399a882ca4569b29c7 to your computer and use it in GitHub Desktop.
Save flyingclimber/6c5b9f0667de1c399a882ca4569b29c7 to your computer and use it in GitHub Desktop.
Bodega->ElasticSearch bridge
from bodega import Bodega
from elasticsearch import Elasticsearch
es = Elasticsearch()
index = Bodega()
merchants = index.index.get_merchants()
for merchant in merchants:
doc = {
'merchant': merchant,
'category': merchants[merchant]
}
res = es.index(index='test-bodega', doc_type='text', body=doc)
print(res['created'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment