File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ async def fulltext_search_suggestion_partial(
9494 The data parameter is the raw search query string.
9595 """
9696 partial = FullTextSuggestionsPartial (query = data )
97- result = partial .generate ()
97+ result = await partial .generate_async ()
9898
9999 if not partial .has_error :
100100 response .headers ["Cache-Control" ] = "public, max-age=300"
Original file line number Diff line number Diff line change 77
88from infogami .utils .view import render_template
99from openlibrary .accounts import get_current_user
10- from openlibrary .core .fulltext import fulltext_search
10+ from openlibrary .core .fulltext import fulltext_search_async
1111from openlibrary .core .lending import compose_ia_url , get_available
1212from openlibrary .i18n import gettext as _
1313from openlibrary .plugins .openlibrary .lists import get_lists , get_user_lists
@@ -268,8 +268,11 @@ def __init__(self, query: str):
268268 self .has_error : bool = False
269269
270270 def generate (self ) -> dict :
271+ raise NotImplementedError ("Use generate_async instead" )
272+
273+ async def generate_async (self ) -> dict :
271274 query = self .query
272- data = fulltext_search (query )
275+ data = await fulltext_search_async (query )
273276 # Add caching headers only if there were no errors in the search results
274277 self .has_error = "error" in data
275278 hits = data .get ('hits' , [])
You can’t perform that action at this time.
0 commit comments