Overview of My Submission
I constructed an Installable Django Bundle referred to as redis-search-django
as part of Redis Hackathon on DEV. redis-search-django
is a Django bundle that gives auto indexing and looking out capabilities for Django Mannequin situations utilizing RediSearch.
redis-search-django
internally makes use of redis-om-python and redis-py
redis-search-django
is Out there on Python Bundle Index (PyPI): https://pypi.org/challenge/redis-search-django/
You may set up it by working: pip set up redis-search-django
Options
- Administration Command to create, replace and populate the RediSearch Index.
- Auto Index on Mannequin object Create, Replace and Delete.
- Auto Index on Associated Mannequin object Add, Replace, Take away and Delete.
- Simple to create Doc courses (Makes use of Django Mannequin Kind Class like construction).
- Index nested fashions (e.g:
OneToOneField
,ForeignKey
andManyToManyField
). - Search paperwork utilizing
redis-om
. - Search End result Pagination.
- Search End result Sorting.
- RediSearch End result to Django QuerySet.
- Faceted Search.
Submission Class:
Wacky Wildcards
(As a result of a Django Bundle doesn’t match into different Classes)
Language Used
Hyperlink to Code
Django Bundle Repository:
Django bundle that gives auto indexing and looking out capabilities for Django mannequin situations utilizing RediSearch.
A Django bundle that gives auto indexing and looking out capabilities for Django mannequin situations utilizing RediSearch.
- Administration Command to create, replace and populate the RediSearch Index.
- Auto Index on Mannequin object Create, Replace and Delete.
- Auto Index on Associated Mannequin object Add, Replace, Take away and Delete.
- Simple to create Doc courses (Makes use of Django Mannequin Kind Class like construction).
- Index nested fashions (e.g:
OneToOneField
,ForeignKey
andManyToManyField
). - Search paperwork utilizing
redis-om
. - Search End result Pagination.
- Search End result Sorting.
- RediSearch End result to Django QuerySet.
- Faceted Search.
- Python: 3.7, 3.8, 3.9, 3.10
- Django: 3.2, 4.0, 4.1
- redis-om: >= 0.0.27
Downloading Redis
The newest model of Redis is offered from Redis.io. You may as well set up Redis along with your working system’s bundle supervisor.
RediSearch and RedisJSON
redis-search-django
depends on the RediSearch and RedisJSON Redis modules to help wealthy queries and embedded fashions
You want these Redis…
Demo App Repository:
(README file accommodates the small print as per Hackathon Necessities)
I constructed an Installable Django Bundle referred to as redis-search-django
as part of Redis Hackathon on DEV
redis-search-django
is a bundle that gives auto indexing and looking out capabilities for Django mannequin situations utilizing RediSearch.
This can be a Demo App that makes use of redis-search-django
bundle to Showcase a Product Search Engine with auto indexing and looking out.
redis-search-django Documentation: https://github.com/saadmk11/redis-search-django
Options
- Administration Command to create, replace and populate the RediSearch Index.
- Auto Index on Mannequin object Create, Replace and Delete.
- Auto Index on Associated Mannequin object Add, Replace, Take away and Delete.
- Simple to create Doc courses (Makes use of Django Mannequin Kind Class like construction).
- Index nested fashions (e.g:
OneToOneField
,ForeignKey
andManyToManyField
). - Search paperwork utilizing
redis-om
. - Search End result Pagination.
- Search End result Sorting.
- RediSearch End result to Django QuerySet.
- Faceted Search.
App Screenshot
The way it works
Create Search
…
Further Assets / Information
use it
Create Search Doc from Django Mannequin. (Utilizing redis-search-django
)
1. For Django Mannequin:
# fashions.py
from django.db import fashions
class Class(fashions.Mannequin):
title = fashions.CharField(max_length=32)
slug = fashions.SlugField(max_length=64)
def __str__(self) -> str:
return self.title
2. You may create a doc class like this:
# paperwork.py
from redis_search_django.paperwork import JsonDocument
from .fashions import Class
class CategoryDocument(JsonDocument):
class Django:
mannequin = Class
fields = ["name", "slug"]
3. Run Django Administration Command Index
to create the index on Redis (Solely have to run as soon as to generate Index Schema on Redis):
python handle.py index
Word: This will even populate the index with current information from the database
Now class objects might be listed mechanically utilizing Redis on create/replace/delete occasions.
Extra Complicated Examples May be discovered right here: https://github.com/saadmk11/redis-search-django