code: def get_queryset(self):
          
          entries = Entry.published.none()
  
          if self.request.GET:
              self.pattern = self.request.GET.get('pattern', '')
              if len(self.pattern) < 3:
                  self.error = _('The pattern is too short')
              else:
                  entries = Entry.published.search(self.pattern)
          else:
              self.error = _('No pattern to search found')
          return entries
docs: Overridde the get_queryset method to
          do some validations and build the search queryset.