@@ -855,7 +855,9 @@ async def create_item(
855855 item (Item): The item to be created.
856856 base_url (str, optional): The base URL for the item. Defaults to an empty string.
857857 exist_ok (bool, optional): Whether to allow the item to exist already. Defaults to False.
858- refresh (bool, optional): Refresh the index after performing the operation. Defaults to False.
858+ **kwargs: Additional keyword arguments.
859+ - refresh (str): Whether to refresh the index after the operation. Can be "true", "false", or "wait_for".
860+ - refresh (bool): Whether to refresh the index after the operation. Defaults to the value in `self.async_settings.database_refresh`.
859861
860862 Raises:
861863 ConflictError: If the item already exists in the database.
@@ -898,10 +900,15 @@ async def delete_item(self, item_id: str, collection_id: str, **kwargs: Any):
898900 Args:
899901 item_id (str): The id of the Item to be deleted.
900902 collection_id (str): The id of the Collection that the Item belongs to.
901- refresh (bool, optional): Whether to refresh the index after the deletion. Default is False.
903+ **kwargs: Additional keyword arguments.
904+ - refresh (str): Whether to refresh the index after the operation. Can be "true", "false", or "wait_for".
905+ - refresh (bool): Whether to refresh the index after the operation. Defaults to the value in `self.async_settings.database_refresh`.
902906
903907 Raises:
904908 NotFoundError: If the Item does not exist in the database.
909+
910+ Returns:
911+ None
905912 """
906913 # Ensure kwargs is a dictionary
907914 kwargs = kwargs or {}
@@ -951,11 +958,16 @@ async def create_collection(self, collection: Collection, **kwargs: Any):
951958
952959 Args:
953960 collection (Collection): The Collection object to be created.
954- refresh (str, optional): Whether to refresh the index after the creation. Can be "true", "false", or "wait_for".
961+ **kwargs: Additional keyword arguments.
962+ - refresh (str): Whether to refresh the index after the operation. Can be "true", "false", or "wait_for".
963+ - refresh (bool): Whether to refresh the index after the operation. Defaults to the value in `self.async_settings.database_refresh`.
955964
956965 Raises:
957966 ConflictError: If a Collection with the same id already exists in the database.
958967
968+ Returns:
969+ None
970+
959971 Notes:
960972 A new index is created for the items in the Collection using the `create_item_index` function.
961973 """
@@ -1020,7 +1032,11 @@ async def update_collection(
10201032 Args:
10211033 collection_id (str): The ID of the collection to be updated.
10221034 collection (Collection): The Collection object to be used for the update.
1023- kwargs (Any, optional): Additional keyword arguments, including `refresh`.
1035+ **kwargs: Additional keyword arguments.
1036+ - refresh (str): Whether to refresh the index after the operation. Can be "true", "false", or "wait_for".
1037+ - refresh (bool): Whether to refresh the index after the operation. Defaults to the value in `self.async_settings.database_refresh`.
1038+ Returns:
1039+ None
10241040
10251041 Raises:
10261042 NotFoundError: If the collection with the given `collection_id` is not found in the database.
@@ -1086,10 +1102,15 @@ async def delete_collection(self, collection_id: str, **kwargs: Any):
10861102 Parameters:
10871103 collection_id (str): The ID of the collection to be deleted.
10881104 kwargs (Any, optional): Additional keyword arguments, including `refresh`.
1105+ - refresh (str): Whether to refresh the index after the operation. Can be "true", "false", or "wait_for".
1106+ - refresh (bool): Whether to refresh the index after the operation. Defaults to the value in `self.async_settings.database_refresh`.
10891107
10901108 Raises:
10911109 NotFoundError: If the collection with the given `collection_id` is not found in the database.
10921110
1111+ Returns:
1112+ None
1113+
10931114 Notes:
10941115 This function first verifies that the collection with the specified `collection_id` exists in the database, and then
10951116 deletes the collection. If `refresh` is set to "true", "false", or "wait_for", the index is refreshed accordingly after
@@ -1133,7 +1154,12 @@ async def bulk_async(
11331154 Args:
11341155 collection_id (str): The ID of the collection to which the items belong.
11351156 processed_items (List[Item]): A list of `Item` objects to be inserted into the database.
1136- refresh (bool): Whether to refresh the index after the bulk insert (default: False).
1157+ **kwargs (Any): Additional keyword arguments, including:
1158+ - refresh (str, optional): Whether to refresh the index after the bulk insert.
1159+ Can be "true", "false", or "wait_for". Defaults to the value of `self.sync_settings.database_refresh`.
1160+ - refresh (bool, optional): Whether to refresh the index after the bulk insert.
1161+ - raise_on_error (bool, optional): Whether to raise an error if any of the bulk operations fail.
1162+ Defaults to the value of `self.async_settings.raise_on_bulk_error`.
11371163
11381164 Returns:
11391165 Tuple[int, List[Dict[str, Any]]]: A tuple containing:
@@ -1142,9 +1168,12 @@ async def bulk_async(
11421168
11431169 Notes:
11441170 This function performs a bulk insert of `processed_items` into the database using the specified `collection_id`.
1145- The insert is performed asynchronously, and the event loop is used to run the operation in a separate executor.
1146- The `mk_actions` function is called to generate a list of actions for the bulk insert. If `refresh` is set to True,
1147- the index is refreshed after the bulk insert.
1171+ The insert is performed synchronously and blocking, meaning that the function does not return until the insert has
1172+ completed. The `mk_actions` function is called to generate a list of actions for the bulk insert. The `refresh`
1173+ parameter determines whether the index is refreshed after the bulk insert:
1174+ - "true": Forces an immediate refresh of the index.
1175+ - "false": Does not refresh the index immediately (default behavior).
1176+ - "wait_for": Waits for the next refresh cycle to make the changes visible.
11481177 """
11491178 # Ensure kwargs is a dictionary
11501179 kwargs = kwargs or {}
@@ -1194,6 +1223,9 @@ def bulk_sync(
11941223 **kwargs (Any): Additional keyword arguments, including:
11951224 - refresh (str, optional): Whether to refresh the index after the bulk insert.
11961225 Can be "true", "false", or "wait_for". Defaults to the value of `self.sync_settings.database_refresh`.
1226+ - refresh (bool, optional): Whether to refresh the index after the bulk insert.
1227+ - raise_on_error (bool, optional): Whether to raise an error if any of the bulk operations fail.
1228+ Defaults to the value of `self.async_settings.raise_on_bulk_error`.
11971229
11981230 Returns:
11991231 Tuple[int, List[Dict[str, Any]]]: A tuple containing:
0 commit comments