From ccc674834e2254af090ce0f4f8f2d4c7bb05cae1 Mon Sep 17 00:00:00 2001
From: Magic <82341152+MagicTheDev@users.noreply.github.com>
Date: Tue, 2 Apr 2024 21:05:35 -0500
Subject: [PATCH] add: meilisearch
---
.idea/workspace.xml | 23 +++++++++++++----------
gamewide/search/track.py | 6 +++---
utility/config.py | 1 +
3 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b9c0f6d..fe3dc86 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,10 @@
-
+
+
+
+
@@ -185,14 +188,6 @@
1706581825121
-
-
- 1711069041236
-
-
-
- 1711069041236
-
1711226380697
@@ -577,7 +572,15 @@
1712108422059
-
+
+
+ 1712109296696
+
+
+
+ 1712109296696
+
+
diff --git a/gamewide/search/track.py b/gamewide/search/track.py
index 9a3f946..83bf0c9 100644
--- a/gamewide/search/track.py
+++ b/gamewide/search/track.py
@@ -5,10 +5,10 @@
import asyncio
-
async def main():
config = Config()
- client = AsyncClient('http://85.10.200.219:7700', config.redis_pw, verify=False)
+ print(config.meili_pw)
+ client = AsyncClient('http://85.10.200.219:7700', config.meili_pw, verify=False)
db_client = MongoDatabase(stats_db_connection=config.stats_mongodb, static_db_connection=config.static_mongodb)
pipeline = [{"$match": {"$nor": [{"members": {"$lt": 10}}, {"level": {"$lt": 3}}, {"capitalLeague": "Unranked"}]}}, {"$group": {"_id": "$tag"}}]
@@ -39,5 +39,5 @@ async def main():
# An index is where the documents are stored.
index = client.index('players')
- await index.add_documents_in_batches(documents=docs_to_insert, batch_size=1_000, primary_key="id", compress=True)
+ await index.add_documents_in_batches(documents=docs_to_insert, batch_size=100_000, primary_key="id", compress=True)
await asyncio.sleep(15)
diff --git a/utility/config.py b/utility/config.py
index c515dbb..0826fc4 100644
--- a/utility/config.py
+++ b/utility/config.py
@@ -16,6 +16,7 @@ class Config:
tracking_type = getenv("TYPE")
+ meili_pw = getenv("MEILI_PW")
master_api_config = {
"bot_clan" : (41, 45),