خرید بک لینک

Vote count: 0

I am trying to use elastic as my data layer while using elastic to create a REST API .

Here are a few details :

  1. My elastic Index:

    Index Name : employee

    { "employee": { "mappings": { "master": { "properties": { "EMPLID": {"type": "string"}, "ENAME": {"type": "string”}, "SKILLS": {"type": "string”} } } } } }

    1. My app.py file import eve from eve_elastic import Elastic config = {'DOMAIN': {}} app = eve.Eve(name, config, data=Elastic) app.run()
  2. My Settings.py file

    RESOURCE_METHODS = ['GET'] ITEM_METHODS = ['GET'] PUBLIC_RESOURCE_METHODS = ['GET'] PUBLIC_ITEM_METHODS = ['GET']

    DOMAIN = { 'employee': { 'schema': { 'emplid': { 'type': 'string' } }, 'datasource': { 'backend': 'elastic' } } }

My Question is what should be my addition to the app.py and settings.py to create a simple REST API which will accept emplid as input and give ename as output .

Thanks

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 2 خرداد 1395 ساعت: 9:25

صفحه بندی