-1
私はelasticを使用してREST APIを作成している間、私のデータレイヤーとしてelasticを使用しようとしています。ここでEVE Elastic for Rest API
はいくつかの詳細です:
1.My弾性インデックス:
Index Name : employee
{
"employee": {
"mappings": {
"master": {
"properties": {
"EMPLID": {"type": "string"},
"ENAME": {"type": "string”},
"SKILLS": {"type": "string”}
}
}
}
}
}
2.My app.pyファイル
import eve
from eve_elastic import Elastic
config = {'DOMAIN': {}}
app = eve.Eve(__name__, config, data=Elastic)
app.run()
3.My Settings.pyが
ファイルRESOURCE_METHODS = ['GET']
ITEM_METHODS = ['GET']
PUBLIC_RESOURCE_METHODS = ['GET']
PUBLIC_ITEM_METHODS = ['GET']
DOMAIN = {
'employee': {
'schema': {
'emplid': {
'type': 'string'
}
},
'datasource': {
'backend': 'elastic'
}
}
}
私の質問は何ですか? yをとsettings.py
に追加して、emplid
を入力として受け入れ、ename
を出力とする単純なREST APIを作成します。
おかげ
私は、弾性部を知らないが、あなたは文書で、[クイックスタート](http://python-eve.org/quickstart.html)をチェックしていますか? – gcw