跳转到主要内容

未知

项目描述

Muffin-ElasticSearch – 一个简单的适用于 muffin 框架的Elasticsearch插件。

Build Status

要求

  • python >= 3.4

  • muffin >= 0.5.5

  • aioes == 0.4

安装

Muffin-ElasticSearch 应使用pip进行安装

pip install muffin-elasticsearch

使用

muffin-elasticsearch 添加到muffin插件列表

import muffin


app = muffin.Application(
    'example',

    PLUGINS=(
        'muffin_elasticsearch',
    )
)

并使用 Elasticsearch 插件

@app.register('/search')
class Example(muffin.Handler):

    @asyncio.coroutine
    def post(self, request):
        body = yield from request.json()
        result = yield from app.ps.elasticsearch.create(
            index='my-index',
            doc_type='test',
            id=42,
            body=body
        )
        return muffin.json_response(
            data=result, status=201
        )


    @asyncio.coroutine
    def get(self, request):
        ret = yield from app.ps.elasticsearch.get(
            index='my-index',
            doc_type='test-type',
            id=42
        )
        return muffin.json_response(data=result)

选项

ELASTICSEARCH_ENDPOINTS

Elasticsearch服务器列表 (['localhost:9200'])

错误跟踪器

如果您有任何建议、错误报告或烦恼,请向https://github.com/drgarcia1986/muffin-elasticsearch/issues 的问题跟踪器报告

贡献

Muffin-ElasticSearch的开发发生在:https://github.com/drgarcia1986/muffin-elasticsearch

贡献者

许可证

许可协议MIT许可证

项目详情


下载文件

下载适合您平台的文件。如果您不确定该选择哪一个,请了解更多关于安装包的信息。

源代码分发

muffin-elasticsearch-0.0.2.tar.gz (3.8 kB 查看哈希值)

上传时间 源代码

支持者