from db.mod_db import EsBase
index = "literal_meaning"
import datetime,time,os,sys

class ExplainEs:
    def __init__(self, es=None):
        if es is None:
            self.esBase = EsBase()
        else:
            self.esBase = es
    def select_explain(self,word):
        query = {
            "query": {
                "bool": {
                    "must": [
                       {
                        "term": {
                            "word": word
                        }
                    }
            ]
        }
    }
    }
        return self.esBase.select(index=index,body=query)
