@@ -1087,40 +1087,6 @@ def _prepare_work_search_query(
10871087
10881088
10891089# Note: these could share an "implementation" to keep a common interface but it creates a lot more complexity
1090- # Warning: when changing this please also change the async version
1091- @public
1092- def work_search (
1093- query : dict ,
1094- sort : str | None = None ,
1095- page : int = 1 ,
1096- offset : int = 0 ,
1097- limit : int = 100 ,
1098- fields : str = '*' ,
1099- facet : bool = True ,
1100- highlight : bool = False ,
1101- spellcheck_count : int | None = None ,
1102- request_label : SolrRequestLabel = 'UNLABELLED' ,
1103- ) -> dict :
1104- prepared = _prepare_work_search_query (query , page , offset , limit )
1105-
1106- resp = run_solr_query (
1107- WorkSearchScheme (),
1108- prepared .query ,
1109- rows = prepared .limit ,
1110- page = prepared .page ,
1111- sort = sort ,
1112- offset = prepared .offset ,
1113- fields = fields ,
1114- facet = facet ,
1115- highlight = highlight ,
1116- spellcheck_count = spellcheck_count ,
1117- request_label = request_label ,
1118- )
1119-
1120- return _process_solr_search_response (resp , fields )
1121-
1122-
1123- # Warning: when changing this please also change the sync version
11241090@public
11251091async def work_search_async (
11261092 query : dict ,
@@ -1130,6 +1096,7 @@ async def work_search_async(
11301096 limit : int = 100 ,
11311097 fields : str | list [str ] = '*' ,
11321098 facet : bool = True ,
1099+ highlight : bool = False ,
11331100 spellcheck_count : int | None = None ,
11341101 request_label : SolrRequestLabel = 'UNLABELLED' ,
11351102 lang : str | None = None ,
@@ -1145,13 +1112,19 @@ async def work_search_async(
11451112 offset = prepared .offset ,
11461113 fields = fields ,
11471114 facet = facet ,
1115+ highlight = highlight ,
11481116 spellcheck_count = spellcheck_count ,
11491117 request_label = request_label ,
11501118 )
11511119
11521120 return _process_solr_search_response (resp , fields )
11531121
11541122
1123+ work_search = async_bridge .wrap (work_search_async )
1124+ work_search .__name__ = 'work_search'
1125+ public (work_search )
1126+
1127+
11551128def validate_search_json_query (q : str | None ) -> str | None :
11561129 if q and len (q ) < 3 :
11571130 return 'Query too short, must be at least 3 characters'
0 commit comments