INNER CODE UNIT · Swift
removeAll
ZachNagengast/similarity-search-kit · Sources/SimilaritySearchKit/Core/Index/SimilarityIndex.swift:310
func removeAll() {
indexItems.removeAll()
}
}
// MARK: - Persistence
@available(macOS 13.0, iOS 16.0, *)
public extension SimilarityIndex {
func saveIndex(toDirectory path: URL? = nil, name: String? = nil) throws -> URL {
let indexName = name ?? self.indexName
let basePath: URL
if let specifiedPath = path {
basePath = specifiedPath
} else {
// Default local path
basePath = try getDefaultStoragePath()