Django Search

preview_player
Показать описание
In this Django search tutorial, more specifically, django full text search we look at the django PostgreSQL tools for implementing django full text search for either django templates or django rest framework search. We move through the gears first building a simple search bar in django and then start to look at the options for full text search using PostgreSQL full text search features. In this tutorial we try and introduce you to contains, icontains, search, SearchVector, SearchRank, SearchRank Weights, TrigramSimilarity, TrigramDistance and Headline. Finally we take you through the process of building a GIN index and showcase the potential performance increase.

00:00 Introduction
Part 1 - Setup
05:24 Build a simple django search bar app
11:26 Docker compose
21:28 Preparing django fixtures
34:17 Templating

Code Repository for the setup app:
Select the App-Template

Part 2 - Textual search operators
44:14 contains and icontains
Part 3 - The search lookup
49:24 Search
Part 4 Search Vector
58:17 Using SearchVector
Part 5 Search Ranking
1:00:51 Using SerachRank
Part 6 Search Ranking Weights
01:04:43 Ranking weights
Part 7 Trigram or Trigraph Concepts
1:08:55 TrigramSimilarity
1:15:44 TrigramDistance
Part 8 Headline
1:18:08 Using Search headline
Part 9 Database indexes
1:21:03 Creating a GIN index

Code Repository:

🐱‍🏍Would you like to SUPPORT US FURTHER so that we can make even more great content - Please consider joining our members community.

👍SUBSCRIBE to get more free tutorials, courses and code snippets!
Рекомендации по теме
Комментарии
Автор

Thank you for all the videos you dropped on Django. You have spotlighted some features that are buried within the Django documenting that some people might have not seen due to Django’s vast documentation. This showcases the power of Django’s features.

jonmonts
Автор

Wow, Zander, that's brilliant. The topic is rarely covered in tutorials and you did a really good job explaining search options.

arturkabitcher
Автор

dude you deserve getting an award for this!! love the way you teaching

zourdy
Автор

thank you man, and I never imagined getting rick role in the middle of a Django tutorial :))

amirhosseinmoayedi
Автор

Hi Zander and welcome back to the django ecommerce series. Thanks

fernandtape
Автор

Thank you for putting this video on YouTube, it was really helpful.

bubulray
Автор

***IMPORTANT***

If someone has problems with Django authentication in Postgres or you cant see migrates in pgAdmin, check if you have installed Postgres in your local machine and delete it because conflict occurs and many errors happen

PEACEOFLIFE
Автор

Thank you, it is possible to combine between TrigramSimilarity and SearchRank

mohamedsoliman
Автор

lovely tutorial..could please do a tutorial base on deployment with apache or gunicorn or uwsgi or asgi etc 🤷‍♂️🤷‍♂️🤷‍♂️ especially with windows OS

chowadagod
Автор

Thanks to your lecture, I reviewed bread and butter of django, docker setup, and learned how to improve query performance by using General Inverted Index.
May I ask what is prefix-match labels in postgres? It would means that Postgres finds data whether prefix are matching or not, but I'm not sure of it.

Suggestion: It would be good to add a statement about q variable, since we might get 'UnboundLocalError'
Thank you Xander. I really appreciate it.

seungcheolshin
Автор

you so much for this video. I learned a lot. but I have a problem with the index part. It doesn't improve the query time at all, I don't know what the problem is!

XeUs
Автор

in practice - title and author would have a many to many relationship, since a book can have many authors and an author has many books....

so how does all this work with many to many relationships?

dickheadrecs
Автор

This is great, I'm trying to remove the dependency to elasticsearch in our project. Do you have any advise on how to put everything together (Triagram, SearchRank, full text search) to get search results as close as what elasticsearch would return?

GerardoSabetta
Автор

Hello everyone, I would like to congratulate you on the quality of your videos.
I would like to know if you plan to make a video on django elasticsearch dsl drf?
I would like to learn a little more but the documentation is too big and I get lost

oscarmuneza
Автор

Sir,
Requesting you to create Google form kind of feature in django, if possible.

MrRahul
Автор

Thank you!
May I know why do you need to use Docker instead of the regular PGAdmin4? Will this work when deploying the app in AWS Elastic Beanstalk?
How do you search using TrigamSimilarity with multiple inputs from the form fields and model fields?

Thanks!

MannyTalaroc
Автор

At the end of your video, Book.objects.filter(title__trigram_similar=q).annotate(similar=TrigramSimilarity('title', q)).order_by('-similar') returns an empty list on my machine soI can't tell if GIN_index is working. Could you give us a similar code line that would return some book objects in few milliseconds?

etiennerobert
Автор

Will u do video in django microservice

kailasvs
Автор

please answer me question on e-commerce project wich is :

when i add item to the basket without login i have session id, and when i login i have different session id but it still remember the item i put in the basket ?
is it using the cycle_key() function to obtain new session id while retaining the data inside the old session !?

abdelrhmanahmed
Автор

Can API's be written too for FTS? Please reply

navaneethangn