本文整理汇总了C#中Lucene.Net.Documents.Field.SetOmitTermFreqAndPositions方法的典型用法代码示例。如果您正苦于以下问题:C# Field.SetOmitTermFreqAndPositions方法的具体用法?C# Field.SetOmitTermFreqAndPositions怎么用?C# Field.SetOmitTermFreqAndPositions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Documents.Field
的用法示例。
在下文中一共展示了Field.SetOmitTermFreqAndPositions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddField
private void AddField(Document doc, FieldInfo fi, bool binary, bool compressed, bool tokenize)
{
//we have a binary stored field, and it may be compressed
if (binary)
{
int toRead = fieldsStream.ReadVInt();
byte[] b = new byte[toRead];
fieldsStream.ReadBytes(b, 0, b.Length);
if (compressed)
doc.Add(new Field(fi.name, Uncompress(b), Field.Store.COMPRESS));
else
doc.Add(new Field(fi.name, b, Field.Store.YES));
}
else
{
Field.Store store = Field.Store.YES;
Field.Index index = GetIndexType(fi, tokenize);
Field.TermVector termVector = GetTermVectorType(fi);
AbstractField f;
if (compressed)
{
store = Field.Store.COMPRESS;
int toRead = fieldsStream.ReadVInt();
byte[] b = new byte[toRead];
fieldsStream.ReadBytes(b, 0, b.Length);
f = new Field(fi.name, false, System.Text.Encoding.GetEncoding("UTF-8").GetString(Uncompress(b)), store, index, termVector);
f.SetOmitTermFreqAndPositions(fi.omitTermFreqAndPositions);
f.SetOmitNorms(fi.omitNorms);
}
else
{
f = new Field(fi.name, false, fieldsStream.ReadString(), store, index, termVector);
f.SetOmitTermFreqAndPositions(fi.omitTermFreqAndPositions);
f.SetOmitNorms(fi.omitNorms);
}
doc.Add(f);
}
}