Ejemplo n.º 1
0
def create_ds_mapping(dbm, form_model):
    es = get_elasticsearch_handle()
    fields = form_model.fields
    fields.append(TextField(name="projects", code='projects', label='projects'))
    fields.append(TextField(name="groups", code='groups', label='My Groups'))
    fields.append(TextField(name="customgroups", code='customgroups', label='Custom groups'))
    es.put_mapping(dbm.database_name, REPORTER_ENTITY_TYPE[0], get_fields_mapping(REPORTER_ENTITY_TYPE[0], fields))
Ejemplo n.º 2
0
def create_datasender_mapping(dbm, form_model):
    es = get_elasticsearch_handle()
    fields = form_model.fields
    fields.append(TextField(name="projects", code='projects',
                            label='projects'))
    es.put_mapping(dbm.database_name, REPORTER_ENTITY_TYPE[0],
                   get_fields_mapping(form_model.form_code, fields))
Ejemplo n.º 3
0
def add_custom_group_field_to_data_sender_mapping(db_name):
    logger = logging.getLogger(db_name)
    logger.info('Starting Migration')

    es = get_elasticsearch_handle()
    fields = [
        TextField(name="customgroups",
                  code='customgroups',
                  label='Custom groups')
    ]
    es.put_mapping(db_name, 'reporter', get_fields_mapping('reg', fields))

    logger.info('Completed Migration')
    mark_as_completed(db_name)