I have a really simple blog application and I want to add a really simple search feature to it.
There are 3 key fields to my model.
class BlogPost(models
If you want it to work just like the admin, you could try my mini-lib Django simple search. It's basically a port of the admin search functionality. Install it with pip:
pip install django-simple-search
and use it like:
from simple_search import search_filter
from .models import BlogPost
search_fields = ['^title', 'intro', 'content']
query = 'search term here'
posts = BlogPost.objects.filter(search_filter(search_fields, query))
I also wrote a blog post about it: https://gregbrown.co/projects/django-simple-search