This introduces the search functionality previously discussed here.
What was done
[x] Updated migrations
[x] Added signal to update the indexing automatically
[x] Tests (need help on where to put it)
[x] Add the search on the API
[x] ~Change the styling (need help on how it should look)~
Notes
One issue is that the indexing is not done automatically, hence the signals.py file. In other to index old data, you can run the following:
from django.contrib.postgres.search import SearchVector
from main.models import Post
Post.objects.update(search_post=SearchVector('title') + SearchVector('body'))
Context
This introduces the search functionality previously discussed here.
What was done
Notes
One issue is that the indexing is not done automatically, hence the
signals.py
file. In other to index old data, you can run the following: