GetIndexDefinition() public method

public GetIndexDefinition ( string name ) : Raven.Database.Indexing.IndexDefinition
name string
return Raven.Database.Indexing.IndexDefinition
コード例 #1
0
ファイル: IndexStorage.cs プロジェクト: torkelo/ravendb
 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));
     }
 }
コード例 #2
0
ファイル: IndexStorage.cs プロジェクト: Inferis/ravendb
		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)));
		    }
		}
コード例 #3
0
ファイル: IndexStorage.cs プロジェクト: maurodx/ravendb
		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);
			}
		}