public GetIndexDefinition ( string name ) : Raven.Database.Indexing.IndexDefinition | ||
name | string | |
Результат | Raven.Database.Indexing.IndexDefinition |
public IndexStorage(string path, IndexDefinitionStorage indexDefinitionStorage) { this.path = Path.Combine(path, "Index"); if (Directory.Exists(this.path) == false) Directory.CreateDirectory(this.path); log.DebugFormat("Initializing index storage at {0}", this.path); foreach (var indexDirectory in Directory.GetDirectories(this.path)) { log.DebugFormat("Loading saved index {0}", indexDirectory); var name = Path.GetFileName(indexDirectory); name = HttpUtility.UrlDecode(name); var indexDefinition = indexDefinitionStorage.GetIndexDefinition(name); if(indexDefinition == null) continue; var fsDirectory = FSDirectory.GetDirectory(indexDirectory, false); indexes.TryAdd(name, CreateIndexImplementation(name, indexDefinition, fsDirectory)); } }
public IndexStorage(IndexDefinitionStorage indexDefinitionStorage, RavenConfiguration configuration) { this.configuration = configuration; path = Path.Combine(configuration.DataDirectory, "Indexes"); if (Directory.Exists(path) == false) Directory.CreateDirectory(path); foreach (var indexDirectory in indexDefinitionStorage.IndexNames) { log.DebugFormat("Loading saved index {0}", indexDirectory); var indexDefinition = indexDefinitionStorage.GetIndexDefinition(indexDirectory); if (indexDefinition == null) continue; indexes.TryAdd(indexDirectory, CreateIndexImplementation(indexDirectory, indexDefinition, OpenOrCreateLuceneDirectory(indexDirectory))); } }
public IndexStorage(IndexDefinitionStorage indexDefinitionStorage, InMemoryRavenConfiguration configuration) { this.indexDefinitionStorage = indexDefinitionStorage; this.configuration = configuration; path = configuration.IndexStoragePath; if (Directory.Exists(path) == false && configuration.RunInMemory == false) Directory.CreateDirectory(path); foreach (var indexDirectory in indexDefinitionStorage.IndexNames) { log.Debug("Loading saved index {0}", indexDirectory); var indexDefinition = indexDefinitionStorage.GetIndexDefinition(indexDirectory); if (indexDefinition == null) continue; var luceneDirectory = OpenOrCreateLuceneDirectory(indexDefinition); var indexImplementation = CreateIndexImplementation(indexDirectory, indexDefinition, luceneDirectory); indexes.TryAdd(indexDirectory, indexImplementation); } }