Skip to content

Commit

Permalink
add: meilisearch
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicTheDev committed Apr 3, 2024
1 parent 4d5485e commit ccc6748
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
23 changes: 13 additions & 10 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions gamewide/search/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}]
Expand Down Expand Up @@ -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)
1 change: 1 addition & 0 deletions utility/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Config:

tracking_type = getenv("TYPE")

meili_pw = getenv("MEILI_PW")

master_api_config = {
"bot_clan" : (41, 45),
Expand Down

0 comments on commit ccc6748

Please sign in to comment.