We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Author dropdown not working as expected
<!-- What problem are we solving? What does the experience look like today? What are the symptoms? -->
Since the last deployment on July 13, the author dropdown on the edit form behaves differently. 
### Evidence / Screenshot (if possible)
<img width="1012" alt="Screenshot 2023-07-13 at 08 35 17" src="https://github.com/internetarchive/openlibrary/assets/17739465/389b1544-9d04-4de1-b218-0145867ec284">


### Relevant url?
<!-- `https://openlibrary.org/...` -->

### Steps to Reproduce
<!-- What steps caused you to find the bug? -->
1. Go to ...add book or edit book form
2. Do ... try to add Plato as an author

<!-- What actually happened after these steps? What did you expect to happen? -->
* Actual: the most obvious choice is missing (Plato, the philosopher). Instead, there are authors that have plato as part of the spelling of their names or less prolific authors with the last name Plato.
* Expected: The most likely choice, probably determined by spelling and number of works, should appear on the list.

### Details

- **Logged in (Y/N)?**
- **Browser type/version?**
- **Operating system?**
- **Environment (prod/dev/local)?** prod
<!-- If not sure, put prod -->

### Proposal & Constraints
<!-- What is the proposed solution / implementation? Is there a precedent of this approach succeeding elsewhere? -->

### Related files
<!-- Files related to this issue; this is super useful for new contributors who might want to help! If you're not sure, leave this blank; a maintainer will add them. -->

### Stakeholders
<!-- @ tag stakeholders of this bug -->
@cdrini 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `openlibrary/plugins/worksearch/autocomplete.py`
Content:
```
1 import itertools
2 import web
3 import json
4 
5 
6 from infogami.utils import delegate
7 from infogami.utils.view import safeint
8 from openlibrary.core.models import Thing
9 from openlibrary.plugins.upstream import utils
10 from openlibrary.plugins.worksearch.search import get_solr
11 from openlibrary.utils import (
12     find_olid_in_string,
13     olid_to_key,
14 )
15 
16 
17 def to_json(d):
18     web.header('Content-Type', 'application/json')
19     return delegate.RawText(json.dumps(d))
20 
21 
22 class autocomplete(delegate.page):
23     path = "/_autocomplete"
24     fq = ['-type:edition']
25     fl = 'key,type,name,title,score'
26     olid_suffix: str | None = None
27     query = 'title:"{q}"^2 OR title:({q}*) OR name:"{q}"^2 OR name:({q}*)'
28 
29     def db_fetch(self, key: str) -> Thing | None:
30         if thing := web.ctx.site.get(key):
31             return thing.as_fake_solr_record()
32         else:
33             return None
34 
35     def doc_wrap(self, doc: dict):
36         """Modify the returned solr document in place."""
37         if 'name' not in doc:
38             doc['name'] = doc.get('title')
39 
40     def GET(self):
41         return self.direct_get()
42 
43     def direct_get(self, fq: list[str] | None = None):
44         i = web.input(q="", limit=5)
45         i.limit = safeint(i.limit, 5)
46 
47         solr = get_solr()
48 
49         # look for ID in query string here
50         q = solr.escape(i.q).strip()
51         embedded_olid = None
52         if self.olid_suffix:
53             embedded_olid = find_olid_in_string(q, self.olid_suffix)
54 
55         if embedded_olid:
56             solr_q = f'key:"{olid_to_key(embedded_olid)}"'
57         else:
58             solr_q = self.query.format(q=q)
59 
60         fq = fq or self.fq
61         params = {
62             'q_op': 'AND',
63             'rows': i.limit,
64             **({'fq': fq} if fq else {}),
65             # limit the fields returned for better performance
66             'fl': self.fl,
67         }
68 
69         data = solr.select(solr_q, **params)
70         docs = data['docs']
71 
72         if embedded_olid and not docs:
73             # Grumble! Work not in solr yet. Create a dummy.
74             fake_doc = self.db_fetch(olid_to_key(embedded_olid))
75             if fake_doc:
76                 docs = [fake_doc]
77 
78         for d in docs:
79             self.doc_wrap(d)
80 
81         return to_json(docs)
82 
83 
84 class languages_autocomplete(delegate.page):
85     path = "/languages/_autocomplete"
86 
87     def GET(self):
88         i = web.input(q="", limit=5)
89         i.limit = safeint(i.limit, 5)
90         return to_json(
91             list(itertools.islice(utils.autocomplete_languages(i.q), i.limit))
92         )
93 
94 
95 class works_autocomplete(autocomplete):
96     path = "/works/_autocomplete"
97     fq = [
98         'type:work',
99         # Exclude orphaned editions from search results
100         'key:*W',
101     ]
102     fl = 'key,title,subtitle,cover_i,first_publish_year,author_name,edition_count'
103     olid_suffix = 'W'
104     query = 'title:"{q}"^2 OR title:({q}*)'
105 
106     def doc_wrap(self, doc: dict):
107         doc['full_title'] = doc['title']
108         if 'subtitle' in doc:
109             doc['full_title'] += ": " + doc['subtitle']
110         doc['name'] = doc.get('title')
111 
112 
113 class authors_autocomplete(autocomplete):
114     path = "/authors/_autocomplete"
115     fq = ['type:author']
116     fl = 'key,name,alternate_names,birth_date,death_date,work_count,works,subjects'
117     olid_suffix = 'A'
118     query = 'name:({q}*) OR alternate_names:({q}*)'
119 
120     def doc_wrap(self, doc: dict):
121         if 'top_work' in doc:
122             doc['works'] = [doc.pop('top_work')]
123         else:
124             doc['works'] = []
125         doc['subjects'] = doc.pop('top_subjects', [])
126 
127 
128 class subjects_autocomplete(autocomplete):
129     # can't use /subjects/_autocomplete because the subjects endpoint = /subjects/[^/]+
130     path = "/subjects_autocomplete"
131     fq = ['type:subject']
132     fl = 'key,name'
133     query = 'name:({q}*)'
134 
135     def GET(self):
136         i = web.input(type="")
137         fq = self.fq
138         if i.type:
139             fq = fq + [f'subject_type:{i.type}']
140 
141         return super().direct_get(fq=fq)
142 
143 
144 def setup():
145     """Do required setup."""
146     pass
147
```
--- 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()

```

diff --git a/openlibrary/plugins/worksearch/autocomplete.py b/openlibrary/plugins/worksearch/autocomplete.py
--- a/openlibrary/plugins/worksearch/autocomplete.py
+++ b/openlibrary/plugins/worksearch/autocomplete.py
@@ -113,9 +113,9 @@
 class authors_autocomplete(autocomplete):
     path = "/authors/_autocomplete"
     fq = ['type:author']
-    fl = 'key,name,alternate_names,birth_date,death_date,work_count,works,subjects'
+    fl = 'key,name,alternate_names,birth_date,death_date,work_count,top_work,top_subjects'
     olid_suffix = 'A'
-    query = 'name:({q}*) OR alternate_names:({q}*)'
+    query = 'name:({q}*) OR alternate_names:({q}*) OR name:"{q}"^2 OR alternate_names:"{q}"^2'
 
     def doc_wrap(self, doc: dict):
         if 'top_work' in doc:

{"golden_diff": "diff --git a/openlibrary/plugins/worksearch/autocomplete.py b/openlibrary/plugins/worksearch/autocomplete.py\n--- a/openlibrary/plugins/worksearch/autocomplete.py\n+++ b/openlibrary/plugins/worksearch/autocomplete.py\n@@ -113,9 +113,9 @@\n class authors_autocomplete(autocomplete):\n     path = \"/authors/_autocomplete\"\n     fq = ['type:author']\n-    fl = 'key,name,alternate_names,birth_date,death_date,work_count,works,subjects'\n+    fl = 'key,name,alternate_names,birth_date,death_date,work_count,top_work,top_subjects'\n     olid_suffix = 'A'\n-    query = 'name:({q}*) OR alternate_names:({q}*)'\n+    query = 'name:({q}*) OR alternate_names:({q}*) OR name:\"{q}\"^2 OR alternate_names:\"{q}\"^2'\n \n     def doc_wrap(self, doc: dict):\n         if 'top_work' in doc:\n", "issue": "Author dropdown not working as expected\n<!-- What problem are we solving? What does the experience look like today? What are the symptoms? -->\r\nSince the last deployment on July 13, the author dropdown on the edit form behaves differently. \r\n### Evidence / Screenshot (if possible)\r\n<img width=\"1012\" alt=\"Screenshot 2023-07-13 at 08 35 17\" src=\"https://github.com/internetarchive/openlibrary/assets/17739465/389b1544-9d04-4de1-b218-0145867ec284\">\r\n\r\n\r\n### Relevant url?\r\n<!-- `https://openlibrary.org/...` -->\r\n\r\n### Steps to Reproduce\r\n<!-- What steps caused you to find the bug? -->\r\n1. Go to ...add book or edit book form\r\n2. Do ... try to add Plato as an author\r\n\r\n<!-- What actually happened after these steps? What did you expect to happen? -->\r\n* Actual: the most obvious choice is missing (Plato, the philosopher). Instead, there are authors that have plato as part of the spelling of their names or less prolific authors with the last name Plato.\r\n* Expected: The most likely choice, probably determined by spelling and number of works, should appear on the list.\r\n\r\n### Details\r\n\r\n- **Logged in (Y/N)?**\r\n- **Browser type/version?**\r\n- **Operating system?**\r\n- **Environment (prod/dev/local)?** prod\r\n<!-- If not sure, put prod -->\r\n\r\n### Proposal & Constraints\r\n<!-- What is the proposed solution / implementation? Is there a precedent of this approach succeeding elsewhere? -->\r\n\r\n### Related files\r\n<!-- Files related to this issue; this is super useful for new contributors who might want to help! If you're not sure, leave this blank; a maintainer will add them. -->\r\n\r\n### Stakeholders\r\n<!-- @ tag stakeholders of this bug -->\r\n@cdrini \n", "before_files": [{"content": "import itertools\nimport web\nimport json\n\n\nfrom infogami.utils import delegate\nfrom infogami.utils.view import safeint\nfrom openlibrary.core.models import Thing\nfrom openlibrary.plugins.upstream import utils\nfrom openlibrary.plugins.worksearch.search import get_solr\nfrom openlibrary.utils import (\n    find_olid_in_string,\n    olid_to_key,\n)\n\n\ndef to_json(d):\n    web.header('Content-Type', 'application/json')\n    return delegate.RawText(json.dumps(d))\n\n\nclass autocomplete(delegate.page):\n    path = \"/_autocomplete\"\n    fq = ['-type:edition']\n    fl = 'key,type,name,title,score'\n    olid_suffix: str | None = None\n    query = 'title:\"{q}\"^2 OR title:({q}*) OR name:\"{q}\"^2 OR name:({q}*)'\n\n    def db_fetch(self, key: str) -> Thing | None:\n        if thing := web.ctx.site.get(key):\n            return thing.as_fake_solr_record()\n        else:\n            return None\n\n    def doc_wrap(self, doc: dict):\n        \"\"\"Modify the returned solr document in place.\"\"\"\n        if 'name' not in doc:\n            doc['name'] = doc.get('title')\n\n    def GET(self):\n        return self.direct_get()\n\n    def direct_get(self, fq: list[str] | None = None):\n        i = web.input(q=\"\", limit=5)\n        i.limit = safeint(i.limit, 5)\n\n        solr = get_solr()\n\n        # look for ID in query string here\n        q = solr.escape(i.q).strip()\n        embedded_olid = None\n        if self.olid_suffix:\n            embedded_olid = find_olid_in_string(q, self.olid_suffix)\n\n        if embedded_olid:\n            solr_q = f'key:\"{olid_to_key(embedded_olid)}\"'\n        else:\n            solr_q = self.query.format(q=q)\n\n        fq = fq or self.fq\n        params = {\n            'q_op': 'AND',\n            'rows': i.limit,\n            **({'fq': fq} if fq else {}),\n            # limit the fields returned for better performance\n            'fl': self.fl,\n        }\n\n        data = solr.select(solr_q, **params)\n        docs = data['docs']\n\n        if embedded_olid and not docs:\n            # Grumble! Work not in solr yet. Create a dummy.\n            fake_doc = self.db_fetch(olid_to_key(embedded_olid))\n            if fake_doc:\n                docs = [fake_doc]\n\n        for d in docs:\n            self.doc_wrap(d)\n\n        return to_json(docs)\n\n\nclass languages_autocomplete(delegate.page):\n    path = \"/languages/_autocomplete\"\n\n    def GET(self):\n        i = web.input(q=\"\", limit=5)\n        i.limit = safeint(i.limit, 5)\n        return to_json(\n            list(itertools.islice(utils.autocomplete_languages(i.q), i.limit))\n        )\n\n\nclass works_autocomplete(autocomplete):\n    path = \"/works/_autocomplete\"\n    fq = [\n        'type:work',\n        # Exclude orphaned editions from search results\n        'key:*W',\n    ]\n    fl = 'key,title,subtitle,cover_i,first_publish_year,author_name,edition_count'\n    olid_suffix = 'W'\n    query = 'title:\"{q}\"^2 OR title:({q}*)'\n\n    def doc_wrap(self, doc: dict):\n        doc['full_title'] = doc['title']\n        if 'subtitle' in doc:\n            doc['full_title'] += \": \" + doc['subtitle']\n        doc['name'] = doc.get('title')\n\n\nclass authors_autocomplete(autocomplete):\n    path = \"/authors/_autocomplete\"\n    fq = ['type:author']\n    fl = 'key,name,alternate_names,birth_date,death_date,work_count,works,subjects'\n    olid_suffix = 'A'\n    query = 'name:({q}*) OR alternate_names:({q}*)'\n\n    def doc_wrap(self, doc: dict):\n        if 'top_work' in doc:\n            doc['works'] = [doc.pop('top_work')]\n        else:\n            doc['works'] = []\n        doc['subjects'] = doc.pop('top_subjects', [])\n\n\nclass subjects_autocomplete(autocomplete):\n    # can't use /subjects/_autocomplete because the subjects endpoint = /subjects/[^/]+\n    path = \"/subjects_autocomplete\"\n    fq = ['type:subject']\n    fl = 'key,name'\n    query = 'name:({q}*)'\n\n    def GET(self):\n        i = web.input(type=\"\")\n        fq = self.fq\n        if i.type:\n            fq = fq + [f'subject_type:{i.type}']\n\n        return super().direct_get(fq=fq)\n\n\ndef setup():\n    \"\"\"Do required setup.\"\"\"\n    pass\n", "path": "openlibrary/plugins/worksearch/autocomplete.py"}], "after_files": [{"content": "import itertools\nimport web\nimport json\n\n\nfrom infogami.utils import delegate\nfrom infogami.utils.view import safeint\nfrom openlibrary.core.models import Thing\nfrom openlibrary.plugins.upstream import utils\nfrom openlibrary.plugins.worksearch.search import get_solr\nfrom openlibrary.utils import (\n    find_olid_in_string,\n    olid_to_key,\n)\n\n\ndef to_json(d):\n    web.header('Content-Type', 'application/json')\n    return delegate.RawText(json.dumps(d))\n\n\nclass autocomplete(delegate.page):\n    path = \"/_autocomplete\"\n    fq = ['-type:edition']\n    fl = 'key,type,name,title,score'\n    olid_suffix: str | None = None\n    query = 'title:\"{q}\"^2 OR title:({q}*) OR name:\"{q}\"^2 OR name:({q}*)'\n\n    def db_fetch(self, key: str) -> Thing | None:\n        if thing := web.ctx.site.get(key):\n            return thing.as_fake_solr_record()\n        else:\n            return None\n\n    def doc_wrap(self, doc: dict):\n        \"\"\"Modify the returned solr document in place.\"\"\"\n        if 'name' not in doc:\n            doc['name'] = doc.get('title')\n\n    def GET(self):\n        return self.direct_get()\n\n    def direct_get(self, fq: list[str] | None = None):\n        i = web.input(q=\"\", limit=5)\n        i.limit = safeint(i.limit, 5)\n\n        solr = get_solr()\n\n        # look for ID in query string here\n        q = solr.escape(i.q).strip()\n        embedded_olid = None\n        if self.olid_suffix:\n            embedded_olid = find_olid_in_string(q, self.olid_suffix)\n\n        if embedded_olid:\n            solr_q = f'key:\"{olid_to_key(embedded_olid)}\"'\n        else:\n            solr_q = self.query.format(q=q)\n\n        fq = fq or self.fq\n        params = {\n            'q_op': 'AND',\n            'rows': i.limit,\n            **({'fq': fq} if fq else {}),\n            # limit the fields returned for better performance\n            'fl': self.fl,\n        }\n\n        data = solr.select(solr_q, **params)\n        docs = data['docs']\n\n        if embedded_olid and not docs:\n            # Grumble! Work not in solr yet. Create a dummy.\n            fake_doc = self.db_fetch(olid_to_key(embedded_olid))\n            if fake_doc:\n                docs = [fake_doc]\n\n        for d in docs:\n            self.doc_wrap(d)\n\n        return to_json(docs)\n\n\nclass languages_autocomplete(delegate.page):\n    path = \"/languages/_autocomplete\"\n\n    def GET(self):\n        i = web.input(q=\"\", limit=5)\n        i.limit = safeint(i.limit, 5)\n        return to_json(\n            list(itertools.islice(utils.autocomplete_languages(i.q), i.limit))\n        )\n\n\nclass works_autocomplete(autocomplete):\n    path = \"/works/_autocomplete\"\n    fq = [\n        'type:work',\n        # Exclude orphaned editions from search results\n        'key:*W',\n    ]\n    fl = 'key,title,subtitle,cover_i,first_publish_year,author_name,edition_count'\n    olid_suffix = 'W'\n    query = 'title:\"{q}\"^2 OR title:({q}*)'\n\n    def doc_wrap(self, doc: dict):\n        doc['full_title'] = doc['title']\n        if 'subtitle' in doc:\n            doc['full_title'] += \": \" + doc['subtitle']\n        doc['name'] = doc.get('title')\n\n\nclass authors_autocomplete(autocomplete):\n    path = \"/authors/_autocomplete\"\n    fq = ['type:author']\n    fl = 'key,name,alternate_names,birth_date,death_date,work_count,top_work,top_subjects'\n    olid_suffix = 'A'\n    query = 'name:({q}*) OR alternate_names:({q}*) OR name:\"{q}\"^2 OR alternate_names:\"{q}\"^2'\n\n    def doc_wrap(self, doc: dict):\n        if 'top_work' in doc:\n            doc['works'] = [doc.pop('top_work')]\n        else:\n            doc['works'] = []\n        doc['subjects'] = doc.pop('top_subjects', [])\n\n\nclass subjects_autocomplete(autocomplete):\n    # can't use /subjects/_autocomplete because the subjects endpoint = /subjects/[^/]+\n    path = \"/subjects_autocomplete\"\n    fq = ['type:subject']\n    fl = 'key,name'\n    query = 'name:({q}*)'\n\n    def GET(self):\n        i = web.input(type=\"\")\n        fq = self.fq\n        if i.type:\n            fq = fq + [f'subject_type:{i.type}']\n\n        return super().direct_get(fq=fq)\n\n\ndef setup():\n    \"\"\"Do required setup.\"\"\"\n    pass\n", "path": "openlibrary/plugins/worksearch/autocomplete.py"}]}