prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Allow to search for products by SKU in admin dashboard
  ### What I'm trying to achieve
  I'm looking to find a product by its SKU
  
  ### Describe a proposed solution
  Tweak search engine settings to return products with full/partial SKU match.
  
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `saleor/search/backends/postgresql_storefront.py`
  Content:
  ```
  1 from django.contrib.postgres.search import TrigramSimilarity
  2 from django.db.models import Q
  3 
  4 from ...product.models import Product
  5 
  6 
  7 def search(phrase):
  8     """Return matching products for storefront views.
  9 
  10     Fuzzy storefront search that is resistant to small typing errors made
  11     by user. Name is matched using trigram similarity, description uses
  12     standard postgres full text search.
  13 
  14     Args:
  15         phrase (str): searched phrase
  16 
  17     """
  18     name_sim = TrigramSimilarity("name", phrase)
  19     published = Q(is_published=True)
  20     ft_in_description = Q(description__search=phrase)
  21     name_similar = Q(name_sim__gt=0.2)
  22     return Product.objects.annotate(name_sim=name_sim).filter(
  23         (ft_in_description | name_similar) & published
  24     )
  25
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/saleor/search/backends/postgresql_storefront.py b/saleor/search/backends/postgresql_storefront.py
  --- a/saleor/search/backends/postgresql_storefront.py
  +++ b/saleor/search/backends/postgresql_storefront.py
  @@ -16,9 +16,9 @@
   
       """
       name_sim = TrigramSimilarity("name", phrase)
  -    published = Q(is_published=True)
       ft_in_description = Q(description__search=phrase)
  +    ft_by_sku = Q(variants__sku__search=phrase)
       name_similar = Q(name_sim__gt=0.2)
       return Product.objects.annotate(name_sim=name_sim).filter(
  -        (ft_in_description | name_similar) & published
  +        (ft_in_description | name_similar | ft_by_sku)
       )
  
verification_info: {"golden_diff": "diff --git a/saleor/search/backends/postgresql_storefront.py b/saleor/search/backends/postgresql_storefront.py\n--- a/saleor/search/backends/postgresql_storefront.py\n+++ b/saleor/search/backends/postgresql_storefront.py\n@@ -16,9 +16,9 @@\n \n     \"\"\"\n     name_sim = TrigramSimilarity(\"name\", phrase)\n-    published = Q(is_published=True)\n     ft_in_description = Q(description__search=phrase)\n+    ft_by_sku = Q(variants__sku__search=phrase)\n     name_similar = Q(name_sim__gt=0.2)\n     return Product.objects.annotate(name_sim=name_sim).filter(\n-        (ft_in_description | name_similar) & published\n+        (ft_in_description | name_similar | ft_by_sku)\n     )\n", "issue": "Allow to search for products by SKU in admin dashboard\n### What I'm trying to achieve\r\nI'm looking to find a product by its SKU\r\n\r\n### Describe a proposed solution\r\nTweak search engine settings to return products with full/partial SKU match.\r\n\r\n\n", "before_files": [{"content": "from django.contrib.postgres.search import TrigramSimilarity\nfrom django.db.models import Q\n\nfrom ...product.models import Product\n\n\ndef search(phrase):\n    \"\"\"Return matching products for storefront views.\n\n    Fuzzy storefront search that is resistant to small typing errors made\n    by user. Name is matched using trigram similarity, description uses\n    standard postgres full text search.\n\n    Args:\n        phrase (str): searched phrase\n\n    \"\"\"\n    name_sim = TrigramSimilarity(\"name\", phrase)\n    published = Q(is_published=True)\n    ft_in_description = Q(description__search=phrase)\n    name_similar = Q(name_sim__gt=0.2)\n    return Product.objects.annotate(name_sim=name_sim).filter(\n        (ft_in_description | name_similar) & published\n    )\n", "path": "saleor/search/backends/postgresql_storefront.py"}], "after_files": [{"content": "from django.contrib.postgres.search import TrigramSimilarity\nfrom django.db.models import Q\n\nfrom ...product.models import Product\n\n\ndef search(phrase):\n    \"\"\"Return matching products for storefront views.\n\n    Fuzzy storefront search that is resistant to small typing errors made\n    by user. Name is matched using trigram similarity, description uses\n    standard postgres full text search.\n\n    Args:\n        phrase (str): searched phrase\n\n    \"\"\"\n    name_sim = TrigramSimilarity(\"name\", phrase)\n    ft_in_description = Q(description__search=phrase)\n    ft_by_sku = Q(variants__sku__search=phrase)\n    name_similar = Q(name_sim__gt=0.2)\n    return Product.objects.annotate(name_sim=name_sim).filter(\n        (ft_in_description | name_similar | ft_by_sku)\n    )\n", "path": "saleor/search/backends/postgresql_storefront.py"}]}