save_to method

save_to

Saves the in‑memory or regular index to a specified folder on disk without changing its settings.

An index of the current version that the folder contains is replaced by the saved index.

def save_to(self, index_folder):
    ...
Parameter Type Description
index_folder str The path to the index folder to save.
Raises Description
RuntimeError The folder is the folder of this index, or it contains an index that is not replaced: an index of another version or a damaged index.

Example

from groupdocs.search import Index

# Create an in‑memory index
index = Index()

# ... perform indexing operations ...

# Save the index to a folder on disk
index.save_to("./indexes/my_index")

Aliases

These names call save_to too, limited to the overloads listed.

Alias Accepts
save_to_file save_to_file(index_folder)
save_to_string save_to_string(index_folder)

See Also