Loads the documents from the directory. If a file is a directory and
recursive is true, it recursively loads documents from the
subdirectory. If a file is a file, it checks if there is a
corresponding loader function for the file extension in the loaders
mapping. If there is, it loads the documents. If there is no
corresponding loader function and unknown is set to Warn, it logs a
warning message. If unknown is set to Error, it throws an error.