当前位置: 首页>>代码示例>>C#>>正文


C# Lucene.OpenInput方法代码示例

本文整理汇总了C#中Lucene.OpenInput方法的典型用法代码示例。如果您正苦于以下问题:C# Lucene.OpenInput方法的具体用法?C# Lucene.OpenInput怎么用?C# Lucene.OpenInput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lucene的用法示例。


在下文中一共展示了Lucene.OpenInput方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EnsureIndexVersionMatches

		private static void EnsureIndexVersionMatches(Lucene.Net.Store.Directory directory, IndexDefinition indexDefinition)
		{
			var versionToCheck = IndexVersion;
			if (indexDefinition.IsMapReduce)
			{
				versionToCheck = MapReduceIndexVersion;
			}
			var indexVersion = IndexVersionFileName(indexDefinition);
			if (directory.FileExists(indexVersion) == false)
			{
				throw new InvalidOperationException("Could not find " + indexVersion + " " + indexDefinition.IndexId + ", resetting index");
			}
			using (var indexInput = directory.OpenInput(indexVersion))
			{
				var versionFromDisk = indexInput.ReadString();
				if (versionFromDisk != versionToCheck)
					throw new InvalidOperationException("Index " + indexDefinition.IndexId + " is of version " + versionFromDisk +
														" which is not compatible with " + versionToCheck + ", resetting index");
			}
		}
开发者ID:felipeleusin,项目名称:ravendb,代码行数:20,代码来源:IndexStorage.cs

示例2: EnsureIndexVersionMatches

		private static void EnsureIndexVersionMatches(string indexName, Lucene.Net.Store.Directory directory)
		{
			if (directory.FileExists("index.version") == false)
			{
				throw new InvalidOperationException("Could not find index.version " + indexName + ", resetting index");
			}
			using(var indexInput = directory.OpenInput("index.version"))
			{
				var versionFromDisk = indexInput.ReadString();
				if (versionFromDisk != IndexVersion)
					throw new InvalidOperationException("Index " + indexName + " is of version " + versionFromDisk +
														" which is not compatible with " + IndexVersion + ", resetting index");
			}
		}
开发者ID:synhershko,项目名称:ravendb,代码行数:14,代码来源:IndexStorage.cs


注:本文中的Lucene.OpenInput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。