def create_new_index(index_name=None): """ Create a new index for addons in ES. Intended to be used by reindexation (and tests), generally a bad idea to call manually. """ if index_name is None: index_name = AddonIndexer.get_index_alias() index_settings = copy.deepcopy(INDEX_SETTINGS) if waffle.switch_is_active('es-use-classic-similarity'): # http://bit.ly/es5-similarity-module-docs index_settings['similarity'] = { 'default': { 'type': 'classic' } } config = { 'mappings': get_mappings(), 'settings': { # create_index will add its own index settings like number of # shards and replicas. 'index': index_settings }, } create_index(index_name, config)
def create_new_index(index_name=None): """ Create a new index for search-related documents in ES. Intended to be used by reindexation (and tests), generally a bad idea to call manually. """ if index_name is None: index_name = BaseSearchIndexer.get_index_alias() index_settings = copy.deepcopy(INDEX_SETTINGS) if waffle.switch_is_active('es-use-classic-similarity'): # http://bit.ly/es5-similarity-module-docs index_settings['similarity'] = { 'default': { 'type': 'classic' } } config = { 'mappings': get_mappings(), 'settings': { # create_index will add its own index settings like number of # shards and replicas. 'index': index_settings }, } create_index(index_name, config)
def create_new_index(index_name=None): if index_name is None: index_name = get_alias() config = { 'mappings': get_mappings(), } create_index(index_name, config)
def create_new_index(index=None, config=None): if config is None: config = {} if index is None: index = get_alias() config['mappings'] = get_mappings() create_index(index, config)
def create_new_index(cls, index_name): config = { 'mappings': { cls.get_doctype_name(): cls.get_mapping() } } create_index(index_name, config)
def create_new_index(index_name=None, config=None): if config is None: config = {} if index_name is None: index_name = get_alias() config['mappings'] = get_mappings() create_index(index_name, config)
def create_new_index(index=None, config=None): if config is None: config = {} if index is None: index = get_alias() config['settings'] = {'index': INDEX_SETTINGS} config['mappings'] = get_mappings() create_index(index, config)
def create_new_index(index_name=None, config=None): """ Create a new index for search-related documents in ES. Intended to be used by reindexation (and tests), generally a bad idea to call manually. """ if config is None: config = {} if index_name is None: index_name = BaseSearchIndexer.get_index_alias() config['settings'] = {'index': INDEX_SETTINGS} config['mappings'] = get_mappings() create_index(index_name, config)
def create_new_index(index_name=None): """ Create a new index for search-related documents in ES. Intended to be used by reindexation (and tests), generally a bad idea to call manually. """ if index_name is None: index_name = BaseSearchIndexer.get_index_alias() config = { 'mappings': get_mappings(), 'settings': { # create_index will add its own index settings like number of # shards and replicas. 'index': INDEX_SETTINGS }, } create_index(index_name, config)
def create_new_index(cls, index_name): """ Create a new index for addons in ES. Intended to be used by reindexation (and tests), generally a bad idea to call manually. """ index_settings = copy.deepcopy(cls.index_settings) config = { 'mappings': { cls.get_doctype_name(): cls.get_mapping(), }, 'settings': { # create_index will add its own index settings like number of # shards and replicas. 'index': index_settings }, } create_index(index_name, config)
def create_new_index(index_name=None): """ Create a new index for addons in ES. Intended to be used by reindexation (and tests), generally a bad idea to call manually. """ if index_name is None: index_name = AddonIndexer.get_index_alias() index_settings = copy.deepcopy(INDEX_SETTINGS) config = { 'mappings': get_mappings(), 'settings': { # create_index will add its own index settings like number of # shards and replicas. 'index': index_settings }, } create_index(index_name, config)