mirror of
https://github.com/simon987/od-database.git
synced 2025-12-13 23:09:01 +00:00
Homepage stats now work with elasticsearch
This commit is contained in:
@@ -191,7 +191,7 @@ class Database:
|
||||
cursor.execute("DELETE FROM ApiToken WHERE token=?", (token, ))
|
||||
conn.commit()
|
||||
|
||||
def _get_websites(self) -> dict:
|
||||
def get_all_websites(self) -> dict:
|
||||
|
||||
# todo: mem cache that
|
||||
with sqlite3.connect(self.db_path) as conn:
|
||||
@@ -208,7 +208,7 @@ class Database:
|
||||
|
||||
def join_search_result(self, page: dict) -> dict:
|
||||
|
||||
websites = self._get_websites()
|
||||
websites = self.get_all_websites()
|
||||
|
||||
for hit in page["hits"]["hits"]:
|
||||
hit["_source"]["website_url"] = websites[hit["_source"]["website_id"]]
|
||||
|
||||
Reference in New Issue
Block a user