Full-text search is a way to search the text of any model field for a specific word or phrase. In this video, learn how to enable full-text search using the SearchFilter built into the Django REST framework, in order to search through product titles and descriptions.
- [Instructor] We have a list of products … that can be filtered by ID, … or whether they're on sale or not. … Now let's enable full text search so we … can search through product names and descriptions. … We are going to use the SearchFilter, which is … a filter back end built into Django REST framework. … We use it in the same way as the Django filter back end, … by adding it to the product list's filter back ends list. … We import it, from REST framework filters. … And add it as a filter back end. … And set up the search fields. … This setting is used by the search filter back end … to map from the URL query parameters, to the … model fields of the serialized model. … Let's test it out. … When we refresh the page with the server running, … and click filters, we see a new filter option … has appeared. We can type in mineral water, … and search for product names and descriptions … that match. … Let's clear the search and try another option. … And now we want to search for another word …
- Creating a serializer
- Working with API views
- Filtering back ends
- Enabling pagination
- Executing CRUD operations
- Managing serializer fields
- Testing API views
Skill Level Intermediate
Deploying Django Apps: Make Your Site Go Livewith Nick Walter2h 43m Intermediate
Demo project overview1m 19s
1. Serializing, Listing, Filtering, and Paginating Models
2. Create, Retrieve, Update, and Delete (CRUD) Operations for Models
3. Managing Serializer Fields, Relations, and Validation
4. Testing API Views
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.