old_contents: from __future__ import unicode_literals
  
  from django import forms
  from django.utils.translation import pgettext
  from .backends import elasticsearch
  
  
  class SearchForm(forms.Form):
      q = forms.CharField(
          label=pgettext('Search form label', 'Query'), required=True)
  
      def search(self):
          return elasticsearch.search(self.cleaned_data['q'])
  
new_contents: from __future__ import unicode_literals
  
  from django import forms
  from django.utils.translation import pgettext
  from .backends import picker
  
  
  class SearchForm(forms.Form):
      q = forms.CharField(
          label=pgettext('Search form label', 'Query'), required=True)
  
      def search(self):
          search = picker.pick_backend()
          return search(self.cleaned_data['q'])
  
subject: Use backend picker in storefront search form