  
      def get_search_terms(self, request):
          """
          Search terms are set by a ?search=... query parameter,
          and may be comma and/or whitespace delimited.
          """
          params = request.query_params.get(self.search_param, '')
          params = params.replace('\x00', '')  # strip null characters
          params = params.replace(',', ' ')
          return params.split()
 
</s> remove     def setUp(self):
 </s> add     @classmethod
    def setUpTestData(cls): </s> remove from django.core.exceptions import ImproperlyConfigured
 </s> add from django.core.exceptions import FieldDoesNotExist, ImproperlyConfigured
        and may be whitespace delimited.
  
      def get_search_terms(self, request):
          """
          Search terms are set by a ?search=... query parameter,
        and may be whitespace delimited.
          """
          params = request.query_params.get(self.search_param, '')
          params = params.replace('\x00', '')  # strip null characters
          params = params.replace(',', ' ')
          return params.split()
keep keep keep keep replace keep keep keep keep keep
 Align SearchFilter behaviour to django.contrib.admin search (#9017)

* Use subquery to remove duplicates in SearchFilter

* Align SearchFilter behaviour to django.contrib.admin

* Add compatibility with older django/python versions

* Allow search to split also by comma after smart split

* Use generator to build search conditions to reduce iterations

* Improve search documentation

* Update docs/api-guide/filtering.md

---------

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com> 
rest_framework/filters.py