Skip to content

Commit

Permalink
zoom harvester - different elasticsearch index for each day for meeti…
Browse files Browse the repository at this point in the history
…ngs and sessions
  • Loading branch information
nataliemona authored and lbjay committed Oct 17, 2017
1 parent affa620 commit fe66fc2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions harvest_cli/zoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,23 @@ def zoom(date, destination, es_host, key, secret):

if destination == 'index':
es = es_connection(es_host)
meetings_index = "meetings-" + date.replace("-", ".")
sessions_index = "sessions-" + date.replace("-", ".")

try:
meeting_data = get_sessions_from(date, key, secret)

for meeting_doc, session_docs in meeting_data:
if destination == 'index':
es.index(
index="meetings",
index=meetings_index,
doc_type="meeting",
body=meeting_doc,
id=meeting_doc['uuid']
)
session_actions = [
dict(
_index='sessions',
_index=sessions_index,
_type='session',
_id=s['meeting'] + s['user_id'],
**s
Expand Down
2 changes: 1 addition & 1 deletion index_templates/meetings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"template": "meetings",
"template": "meetings-*",
"mappings": {
"meeting": {
"_all": {
Expand Down
2 changes: 1 addition & 1 deletion index_templates/sessions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"template": "sessions",
"template": "sessions-*",
"mappings": {
"session": {
"_all": {
Expand Down

0 comments on commit fe66fc2

Please sign in to comment.