test case

This commit is contained in:
BennyThink
2021-01-31 14:26:53 +08:00
parent ac02ff7567
commit cd09cd9c7e
6 changed files with 1167 additions and 14 deletions

View File

@@ -205,10 +205,10 @@ class YYeTsOnline(YYeTsBase):
class YYeTsOffline(YYeTsBase):
label = "yyets offline"
def __init__(self):
def __init__(self, db="yyets", col="resource"):
super().__init__()
self.mongo = pymongo.MongoClient(host=MONGO)
self.collection = self.mongo["yyets"]["resource"]
self.collection = self.mongo[db][col]
def search_preview(self, search_text: str) -> dict:
logging.info("[%s] Loading offline data from MongoDB...", self.label)