in src/elasticsearch_createindex.py [0:0]
def create_episode_index():
mappings = '''
{
"mappings": {
"properties": {
"audio_url":{
"type": "keyword"
},
"audio_type":{
"type": "keyword"
},
"transcript":{
"type": "text"
},
"audio_s3_location": {
"type": "keyword"
},
"published_time":{
"type": "date",
"format": "yyyy:MM:dd HH:mm:ss"
},
"summary": {
"type": "text"
},
"source_feed":{
"type": "keyword"
}
}
}
}
'''
start = time.time()
logger.info("mappings to create for index: " + mappings)
res = es.indices.create(index=FULL_EPISODE_INDEX, body=mappings)
round_trip = time.time() - start
logger.info(json.dumps(res, indent=2))
logger.info('REQUEST_TIME es_client.indices.create {:10.4f}'.format(round_trip))