|
@@ -37,10 +37,11 @@ class db():
|
|
|
if "keyword" in filter and len(filter["keyword"]) >0:
|
|
if "keyword" in filter and len(filter["keyword"]) >0:
|
|
|
db_filter["kw"]={"$all": filter["keyword"]}
|
|
db_filter["kw"]={"$all": filter["keyword"]}
|
|
|
|
|
|
|
|
- print(db_filter)
|
|
|
|
|
- #{'site': 'site', 'mindate': 'mind', 'maxddate': 'maxd', 'minweight': 'minwe'}
|
|
|
|
|
-
|
|
|
|
|
- return [ self.jsonable(p) for p in self.c_articles.find(db_filter,{"html":0,"text":0}).limit(limit) ]
|
|
|
|
|
|
|
+ #print(db_filter)
|
|
|
|
|
+ q = self.c_articles.find(db_filter,{"html":0,"text":0}).limit(limit)
|
|
|
|
|
+ count = q.count()
|
|
|
|
|
+ return { 'articles': [ self.jsonable(p) for p in q ],
|
|
|
|
|
+ 'count' : count }
|
|
|
|
|
|
|
|
def articles(self, id=None, limit=100):
|
|
def articles(self, id=None, limit=100):
|
|
|
if id is None:
|
|
if id is None:
|