本文整理汇总了C#中Lucene.Net.Index.SegmentReader.HasNorms方法的典型用法代码示例。如果您正苦于以下问题:C# SegmentReader.HasNorms方法的具体用法?C# SegmentReader.HasNorms怎么用?C# SegmentReader.HasNorms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Index.SegmentReader
的用法示例。
在下文中一共展示了SegmentReader.HasNorms方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestFieldNorms
/// <summary> Test field norms.</summary>
private Status.FieldNormStatus TestFieldNorms(IEnumerable<string> fieldNames, SegmentReader reader)
{
var status = new Status.FieldNormStatus();
try
{
// Test Field Norms
if (infoStream != null)
{
infoStream.Write(" test: field norms.........");
}
var b = new byte[reader.MaxDoc];
foreach(string fieldName in fieldNames)
{
if (reader.HasNorms(fieldName))
{
reader.Norms(fieldName, b, 0);
++status.totFields;
}
}
Msg("OK [" + status.totFields + " fields]");
}
catch (System.Exception e)
{
Msg("ERROR [" + System.Convert.ToString(e.Message) + "]");
status.error = e;
if (infoStream != null)
{
infoStream.WriteLine(e.StackTrace);
}
}
return status;
}
示例2: TestFieldNorms
/// <summary> Test field norms.</summary>
private Status.FieldNormStatus TestFieldNorms(System.Collections.Generic.ICollection<string> fieldNames, SegmentReader reader)
{
Status.FieldNormStatus status = new Status.FieldNormStatus();
try
{
// Test Field Norms
if (infoStream != null)
{
infoStream.Write(" test: field norms.........");
}
System.Collections.IEnumerator it = fieldNames.GetEnumerator();
byte[] b = new byte[reader.MaxDoc()];
while (it.MoveNext())
{
System.String fieldName = (System.String) it.Current;
if (reader.HasNorms(fieldName))
{
reader.Norms(fieldName, b, 0);
++status.totFields;
}
}
Msg("OK [" + status.totFields + " fields]");
}
catch (System.Exception e)
{
Msg("ERROR [" + System.Convert.ToString(e.Message) + "]");
status.error = e;
if (infoStream != null)
{
infoStream.WriteLine(e.StackTrace);
}
}
return status;
}