I am trying to use elastic as my data layer while using elastic to create a REST API .
Here are a few details :
-
My elastic Index:
Index Name : employee
{ "employee": { "mappings": { "master": { "properties": { "EMPLID": {"type": "string"}, "ENAME": {"type": "string”}, "SKILLS": {"type": "string”} } } } } }
- My app.py file import eve from eve_elastic import Elastic config = {'DOMAIN': {}} app = eve.Eve(name, config, data=Elastic) app.run()
-
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
