def METHOD_NAME(cls, data, id_=None, index_refresh='false', **kwargs):
    """Create a new record instance and store it in elasticsearch.
    :param data: Dict with the record metadata.
    :param id_: Specify a UUID to use for the new record, instead of
                automatically generated.
    :param index_refresh: If `true` then refresh the affected shards to
        make this operation visible to search, if `wait_for` then wait for
        a refresh to make this operation visible to search, if `false`
        (the default) then do nothing with refreshes.
        Valid choices: 'true', 'false', 'wait_for'
    :returns: A new :class:`Record` instance.
    """
    if id_:
        data['pid'] = id_
    record = cls(data, model=None, **kwargs)
    # Run pre create extensions
    for e in cls._extensions:
        e.pre_create(record)
    if current_app.config.get('RERO_ILS_ENABLE_OPERATION_LOG_VALIDATION'):
        # Validate also encodes the data
        # For backward compatibility we pop them here.
        format_checker = kwargs.pop('format_checker', None)
        validator = kwargs.pop('validator', None)
        if '$schema' not in record:
            record['$schema'] = current_jsonschemas.path_to_url(
                cls._schema)
        record._validate(
            format_checker=format_checker,
            validator=validator,
            use_model=False
        )
    current_search_client.index(
        index=cls.get_index(record),
        body=record.dumps(),
        id=record['pid'],
        refresh=index_refresh
    )
    # Run post create extensions
    for e in cls._extensions:
        e.post_create(record)
    return record