@@ -73,6 +73,8 @@ def search( # noqa: D417
7373 chunk_size : int = 1000 ,
7474 all_fields : bool = True ,
7575 fields : list [str ] | None = None ,
76+ _page : int | None = None ,
77+ _sort_fields : str | None = None ,
7678 ** kwargs ,
7779 ) -> list [SummaryDoc ] | list [dict ]:
7880 """Query core data using a variety of search criteria.
@@ -150,6 +152,8 @@ def search( # noqa: D417
150152 all_fields (bool): Whether to return all fields in the document. Defaults to True.
151153 fields (List[str]): List of fields in SummaryDoc to return data for.
152154 Default is material_id if all_fields is False.
155+ _page (int or None) : Page of the results to skip to.
156+ _sort_fields (str or None) : Field to sort on. Including a leading "-" sign will reverse sort order.
153157
154158 Returns:
155159 ([SummaryDoc], [dict]) List of SummaryDoc documents or dictionaries.
@@ -181,6 +185,8 @@ def search( # noqa: D417
181185 "weighted_surface_energy" ,
182186 "weighted_work_function" ,
183187 "shape_factor" ,
188+ "_page" ,
189+ "_sort_fields" ,
184190 ]
185191
186192 min_max_name_dict = {
@@ -284,14 +290,17 @@ def _csrc(x):
284290 )
285291
286292 for param , value in user_settings .items ():
287- if isinstance (value , (int , float )):
288- value = (value , value )
289- query_params .update (
290- {
291- f"{ min_max_name_dict [param ]} _min" : value [0 ],
292- f"{ min_max_name_dict [param ]} _max" : value [1 ],
293- }
294- )
293+ if param .startswith ("_" ):
294+ query_params [param ] = value
295+ else :
296+ if isinstance (value , (int , float )):
297+ value = (value , value )
298+ query_params .update (
299+ {
300+ f"{ min_max_name_dict [param ]} _min" : value [0 ],
301+ f"{ min_max_name_dict [param ]} _max" : value [1 ],
302+ }
303+ )
295304
296305 if material_ids :
297306 if isinstance (material_ids , str ):
0 commit comments