Writes the search index to a file.
func writeIndex(to url: URL) throws
url
The output URL for the search index JSON file.