当前位置: 首页>>代码示例>>Python>>正文


Python ES.setup_mappings方法代码示例

本文整理汇总了Python中nefertari.elasticsearch.ES.setup_mappings方法的典型用法代码示例。如果您正苦于以下问题:Python ES.setup_mappings方法的具体用法?Python ES.setup_mappings怎么用?Python ES.setup_mappings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nefertari.elasticsearch.ES的用法示例。


在下文中一共展示了ES.setup_mappings方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: recreate_index

# 需要导入模块: from nefertari.elasticsearch import ES [as 别名]
# 或者: from nefertari.elasticsearch.ES import setup_mappings [as 别名]
 def recreate_index(self):
     self.log.info('Deleting index')
     ES.delete_index()
     self.log.info('Creating index')
     ES.create_index()
     self.log.info('Creating mappings')
     ES.setup_mappings()
开发者ID:mkdir404,项目名称:nefertari,代码行数:9,代码来源:es.py

示例2: includeme

# 需要导入模块: from nefertari.elasticsearch import ES [as 别名]
# 或者: from nefertari.elasticsearch.ES import setup_mappings [as 别名]
def includeme(config):
    Settings = dictset(config.registry.settings)
    config.include("nefertari.engine")
    config.include("nefertari")
    config.include("nefertari.view")
    config.include("nefertari.elasticsearch")

    # Process nefertari settings
    if Settings.asbool("debug"):
        log.warning("*** DEBUG DEBUG DEBUG mode ***")
        config.add_tween("nefertari.tweens.get_tunneling")

    if Settings.asbool("cors.enable"):
        config.add_tween("nefertari.tweens.cors")

    if Settings.asbool("ssl_middleware.enable"):
        config.add_tween("nefertari.tweens.ssl")

    if Settings.asbool("request_timing.enable"):
        config.add_tween("nefertari.tweens.request_timing")

    # Set root factory
    config.root_factory = NefertariRootACL

    # Process auth settings
    root = config.get_root_resource()
    ramses_auth = Settings.asbool("ramses.auth", False)
    root.auth = ramses_auth

    log.info("Parsing RAML")
    parsed_raml = pyraml.parser.load(Settings["ramses.raml_schema"])

    log.info("Starting models generation")
    generate_models(config, raml_resources=parsed_raml.resources)

    if ramses_auth:
        if getattr(config.registry, "auth_model", None) is None:
            from nefertari.authentication.models import AuthUser

            config.registry.auth_model = AuthUser
        from .auth import setup_auth_policies

        setup_auth_policies(config, parsed_raml)

    log.info("Starting server generation")
    generate_server(parsed_raml, config)

    log.info("Running nefertari.engine.setup_database")
    from nefertari.engine import setup_database

    setup_database(config)

    from nefertari.elasticsearch import ES

    ES.setup_mappings()

    if ramses_auth:
        config.include("ramses.auth")

    log.info("Server succesfully generated\n")
开发者ID:mjhea0,项目名称:ramses,代码行数:62,代码来源:__init__.py

示例3: includeme

# 需要导入模块: from nefertari.elasticsearch import ES [as 别名]
# 或者: from nefertari.elasticsearch.ES import setup_mappings [as 别名]
def includeme(config):
    Settings = dictset(config.registry.settings)
    config.include('nefertari.engine')
    config.include('nefertari')
    config.include('nefertari.view')

    # Process nefertari settings
    if Settings.asbool('debug'):
        log.warning('*** DEBUG DEBUG DEBUG mode ***')
        config.add_tween('nefertari.tweens.get_tunneling')

    if Settings.asbool('cors.enable'):
        config.add_tween('nefertari.tweens.cors')

    if Settings.asbool('ssl_middleware.enable'):
        config.add_tween('nefertari.tweens.ssl')

    if Settings.asbool('request_timing.enable'):
        config.add_tween('nefertari.tweens.request_timing')

    # Set root factory
    config.root_factory = NefertariRootACL

    # Process auth settings
    root = config.get_root_resource()
    ramses_auth = Settings.asbool('ramses.auth', False)
    root.auth = ramses_auth

    log.info('Parsing RAML')
    parsed_raml = pyraml.parser.load(Settings['ramses.raml_schema'])

    log.info('Starting models generation')
    generate_models(config, raml_resources=parsed_raml.resources)

    if ramses_auth:
        if getattr(config.registry, 'auth_model', None) is None:
            from nefertari.authentication.models import get_authuser_model
            config.registry.auth_model = get_authuser_model()
        from .auth import setup_auth_policies
        setup_auth_policies(config, parsed_raml)

    config.include('nefertari.elasticsearch')

    log.info('Starting server generation')
    generate_server(parsed_raml, config)

    log.info('Running nefertari.engine.setup_database')
    from nefertari.engine import setup_database
    setup_database(config)

    from nefertari.elasticsearch import ES
    ES.setup_mappings()

    if ramses_auth:
        config.include('ramses.auth')

    log.info('Server succesfully generated\n')
开发者ID:gitter-badger,项目名称:ramses,代码行数:59,代码来源:__init__.py

示例4: run

# 需要导入模块: from nefertari.elasticsearch import ES [as 别名]
# 或者: from nefertari.elasticsearch.ES import setup_mappings [as 别名]
    def run(self):
        ES.setup(self.settings)
        if self.options.recreate:
            self.recreate_index()
            models = engine.get_document_classes()
            model_names = [
                name for name, model in models.items()
                if getattr(model, '_index_enabled', False)]
        else:
            ES.setup_mappings()
            model_names = split_strip(self.options.models)

        self.index_models(model_names)
开发者ID:oleduc,项目名称:nefertari,代码行数:15,代码来源:es.py

示例5: includeme

# 需要导入模块: from nefertari.elasticsearch import ES [as 别名]
# 或者: from nefertari.elasticsearch.ES import setup_mappings [as 别名]
def includeme(config):
    from .generators import generate_server, generate_models
    Settings = dictset(config.registry.settings)
    config.include('nefertari.engine')

    config.registry.database_acls = Settings.asbool('database_acls')
    if config.registry.database_acls:
        config.include('nefertari_guards')

    config.include('nefertari')
    config.include('nefertari.view')
    config.include('nefertari.json_httpexceptions')

    # Process nefertari settings
    if Settings.asbool('enable_get_tunneling'):
        config.add_tween('nefertari.tweens.get_tunneling')

    if Settings.asbool('cors.enable'):
        config.add_tween('nefertari.tweens.cors')

    if Settings.asbool('ssl_middleware.enable'):
        config.add_tween('nefertari.tweens.ssl')

    if Settings.asbool('request_timing.enable'):
        config.add_tween('nefertari.tweens.request_timing')

    # Set root factory
    config.root_factory = NefertariRootACL

    # Process auth settings
    root = config.get_root_resource()
    root_auth = getattr(root, 'auth', False)

    log.info('Parsing RAML')
    raml_root = ramlfications.parse(Settings['ramses.raml_schema'])

    log.info('Starting models generation')
    generate_models(config, raml_resources=raml_root.resources)

    if root_auth:
        from .auth import setup_auth_policies, get_authuser_model
        if getattr(config.registry, 'auth_model', None) is None:
            config.registry.auth_model = get_authuser_model()
        setup_auth_policies(config, raml_root)

    config.include('nefertari.elasticsearch')

    log.info('Starting server generation')
    generate_server(raml_root, config)

    log.info('Running nefertari.engine.setup_database')
    from nefertari.engine import setup_database
    setup_database(config)

    from nefertari.elasticsearch import ES
    ES.setup_mappings()

    if root_auth:
        config.include('ramses.auth')

    log.info('Server succesfully generated\n')
开发者ID:alainlompo,项目名称:ramses,代码行数:63,代码来源:__init__.py


注:本文中的nefertari.elasticsearch.ES.setup_mappings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。