realms-wiki/realms/modules/search/models.py

17 lines
429 B
Python
Raw Normal View History

2014-11-10 18:54:46 +02:00
from realms import elastic
from realms.lib.model import HookMixin
class Search(HookMixin):
@classmethod
def index(cls, index, doc_type, id_=None, body=None):
return elastic.index(index=index, doc_type=doc_type, id=id_, body=body)
@classmethod
def wiki(cls, query):
return elastic.search(index='wiki', body={"query": {"match_all": {}}})
@classmethod
def users(cls, query):
pass