Last active
November 12, 2016 04:35
-
-
Save flyingclimber/6c5b9f0667de1c399a882ca4569b29c7 to your computer and use it in GitHub Desktop.
Bodega->ElasticSearch bridge
This file contains 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
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