Skip to content
This repository was archived by the owner on Feb 21, 2022. It is now read-only.

Commit fee0108

Browse files
gjuro87aexvir
authored andcommitted
feat(search): added django command for listing the meilisearch index
1 parent c206ea8 commit fee0108

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import meilisearch
2+
import structlog
3+
from django.conf import settings
4+
from django.core.management.base import BaseCommand
5+
6+
log = structlog.get_logger()
7+
8+
9+
class Command(BaseCommand):
10+
help = "List MeiliSearch indexes"
11+
12+
def handle(self, *args, **options):
13+
14+
client = meilisearch.Client(settings.MEILI_HOST, settings.MEILI_MASTER_KEY)
15+
16+
indexes = client.get_indexes()
17+
18+
log.info(indexes)

0 commit comments

Comments
 (0)