Commit 2edea329 authored by Alessandro CERIONI's avatar Alessandro CERIONI
Browse files

Adding document type (page, post). Inserting the content coming from the CMS...

Adding document type (page, post). Inserting the content coming from the CMS into the "content-fr" attribute.
parent 421a7281
......@@ -4,7 +4,11 @@ def process_posts( posts ):
for post in posts:
output_post = post.copy()
output_post = dict()
output_post['content-fr'] = post
output_post['uuid'] = post['uuid']
output_post['type'] = 'post'
output_posts.append(output_post)
......@@ -18,7 +22,11 @@ def process_pages( pages ):
for page in pages:
output_page = page.copy()
output_page = dict()
output_page['content-fr'] = page
output_page['uuid'] = page['uuid']
output_page['type'] = 'page'
output_pages.append(output_page)
......
......@@ -81,7 +81,7 @@ def index_docs( cfg, content_type, docs ):
# #del doc['uuid']
# except:
# header['index']['_id'] = hashlib.md5( json.dumps(doc, sort_keys=True).encode("utf-8") ).hexdigest()
header['index']['_id'] = doc['id']
header['index']['_id'] = doc['content-fr']['id']
#print(header)
es_body += '{0}\n{1}\n'.format(json.dumps(header), json.dumps(doc))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment