• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Index.FieldInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



FieldInfo类属于Lucene.Net.Index命名空间,在下文中一共展示了FieldInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetOrdIndexInstance

 protected override MonotonicBlockPackedReader GetOrdIndexInstance(IndexInput data, FieldInfo field,
     NumericEntry entry)
 {
     data.Seek(entry.Offset);
     return new MonotonicBlockPackedReader((IndexInput)data.Clone(), entry.PackedIntsVersion, entry.BlockSize, entry.Count,
         true);
 }
开发者ID:joyanta,项目名称:lucene.net,代码行数:7,代码来源:DiskDocValuesProducer.cs


示例2: NormsWriterPerField

 public NormsWriterPerField(DocInverterPerField docInverterPerField, NormsWriterPerThread perThread, FieldInfo fieldInfo)
 {
     this.perThread = perThread;
     this.fieldInfo = fieldInfo;
     docState = perThread.docState;
     fieldState = docInverterPerField.fieldState;
 }
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:7,代码来源:NormsWriterPerField.cs


示例3: SetField

		internal void  SetField(FieldInfo fieldInfo)
		{
			this.fieldInfo = fieldInfo;
			omitTermFreqAndPositions = fieldInfo.omitTermFreqAndPositions;
			storePayloads = fieldInfo.storePayloads;
			posWriter.SetField(fieldInfo);
		}
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:7,代码来源:FormatPostingsDocsWriter.cs


示例4: AddField

 public override void AddField(int docID, IndexableField field, FieldInfo fieldInfo)
 {
     DocValuesType_e? dvType = field.FieldType().DocValueType;
     if (dvType != null)
     {
         fieldInfo.DocValuesType = dvType;
         if (dvType == DocValuesType_e.BINARY)
         {
             AddBinaryField(fieldInfo, docID, field.BinaryValue());
         }
         else if (dvType == DocValuesType_e.SORTED)
         {
             AddSortedField(fieldInfo, docID, field.BinaryValue());
         }
         else if (dvType == DocValuesType_e.SORTED_SET)
         {
             AddSortedSetField(fieldInfo, docID, field.BinaryValue());
         }
         else if (dvType == DocValuesType_e.NUMERIC)
         {
             if (!(field.NumericValue is long?))
             {
                 throw new System.ArgumentException("illegal type " + field.NumericValue.GetType() + ": DocValues types must be Long");
             }
             AddNumericField(fieldInfo, docID, (long)field.NumericValue);
         }
         else
         {
             Debug.Assert(false, "unrecognized DocValues.Type: " + dvType);
         }
     }
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:32,代码来源:DocValuesProcessor.cs


示例5: GetAddressInstance

 protected override MonotonicBlockPackedReader GetAddressInstance(IndexInput data, FieldInfo field,
     BinaryEntry bytes)
 {
     data.Seek(bytes.AddressesOffset);
     return new MonotonicBlockPackedReader((IndexInput)data.Clone(), bytes.PackedIntsVersion, bytes.BlockSize, bytes.Count,
         true);
 }
开发者ID:joyanta,项目名称:lucene.net,代码行数:7,代码来源:DiskDocValuesProducer.cs


示例6: WriteField

		internal void  WriteField(FieldInfo fi, Fieldable field)
		{
			// if the field as an instanceof FieldsReader.FieldForMerge, we're in merge mode
			// and field.binaryValue() already returns the compressed value for a field
			// with isCompressed()==true, so we disable compression in that case
			bool disableCompression = (field is FieldsReader.FieldForMerge);
			fieldsStream.WriteVInt(fi.number);
			byte bits = 0;
			if (field.IsTokenized())
				bits |= FieldsWriter.FIELD_IS_TOKENIZED;
			if (field.IsBinary())
				bits |= FieldsWriter.FIELD_IS_BINARY;
			if (field.IsCompressed())
				bits |= FieldsWriter.FIELD_IS_COMPRESSED;
			
			fieldsStream.WriteByte(bits);
			
			if (field.IsCompressed())
			{
				// compression is enabled for the current field
				byte[] data = null;
				
				if (disableCompression)
				{
					// optimized case for merging, the data
					// is already compressed
					data = field.BinaryValue();
				}
				else
				{
					// check if it is a binary field
					if (field.IsBinary())
					{
						data = Compress(field.BinaryValue());
					}
					else
					{
						data = Compress(System.Text.Encoding.GetEncoding("UTF-8").GetBytes(field.StringValue()));
					}
				}
				int len = data.Length;
				fieldsStream.WriteVInt(len);
				fieldsStream.WriteBytes(data, len);
			}
			else
			{
				// compression is disabled for the current field
				if (field.IsBinary())
				{
					byte[] data = field.BinaryValue();
					int len = data.Length;
					fieldsStream.WriteVInt(len);
					fieldsStream.WriteBytes(data, len);
				}
				else
				{
					fieldsStream.WriteString(field.StringValue());
				}
			}
		}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:60,代码来源:FieldsWriter.cs


示例7: TermVectorsConsumerPerField

        internal bool HasPayloads; // if enabled, and we actually saw any for this field

        public TermVectorsConsumerPerField(TermsHashPerField termsHashPerField, TermVectorsConsumer termsWriter, FieldInfo fieldInfo)
        {
            this.TermsHashPerField = termsHashPerField;
            this.TermsWriter = termsWriter;
            this.FieldInfo = fieldInfo;
            DocState = termsHashPerField.DocState;
            FieldState = termsHashPerField.FieldState;
        }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:10,代码来源:TermVectorsConsumerPerField.cs


示例8: DocInverterPerField

 public DocInverterPerField(DocInverter parent, FieldInfo fieldInfo)
 {
     this.fieldInfo = fieldInfo;
     DocState = parent.DocState;
     FieldState = new FieldInvertState(fieldInfo.Name);
     this.Consumer = parent.Consumer.AddField(this, fieldInfo);
     this.EndConsumer = parent.EndConsumer.AddField(this, fieldInfo);
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:8,代码来源:DocInverterPerField.cs


示例9: DocInverterPerField

 public DocInverterPerField(DocInverterPerThread perThread, FieldInfo fieldInfo)
 {
     this.perThread = perThread;
     this.fieldInfo = fieldInfo;
     docState = perThread.docState;
     fieldState = perThread.fieldState;
     this.consumer = perThread.consumer.addField(this, fieldInfo);
     this.endConsumer = perThread.endConsumer.addField(this, fieldInfo);
 }
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:9,代码来源:DocInverterPerField.cs


示例10: NumericDocValuesWriter

 public NumericDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed, bool trackDocsWithField)
 {
     Pending = new AppendingDeltaPackedLongBuffer(PackedInts.COMPACT);
     DocsWithField = trackDocsWithField ? new FixedBitSet(64) : null;
     BytesUsed = Pending.RamBytesUsed() + DocsWithFieldBytesUsed();
     this.FieldInfo = fieldInfo;
     this.IwBytesUsed = iwBytesUsed;
     iwBytesUsed.AddAndGet(BytesUsed);
 }
开发者ID:joyanta,项目名称:lucene.net,代码行数:9,代码来源:NumericDocValuesWriter.cs


示例11: TermVectorsTermsWriterPerField

 public TermVectorsTermsWriterPerField(TermsHashPerField termsHashPerField, TermVectorsTermsWriterPerThread perThread, FieldInfo fieldInfo)
 {
     this.termsHashPerField = termsHashPerField;
     this.perThread = perThread;
     this.termsWriter = perThread.termsWriter;
     this.fieldInfo = fieldInfo;
     docState = termsHashPerField.docState;
     fieldState = termsHashPerField.fieldState;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:9,代码来源:TermVectorsTermsWriterPerField.cs


示例12: FreqProxTermsWriterPerField

 public FreqProxTermsWriterPerField(TermsHashPerField termsHashPerField, FreqProxTermsWriterPerThread perThread, FieldInfo fieldInfo)
 {
     this.termsHashPerField = termsHashPerField;
     this.perThread = perThread;
     this.fieldInfo = fieldInfo;
     docState = termsHashPerField.docState;
     fieldState = termsHashPerField.fieldState;
     omitTermFreqAndPositions = fieldInfo.omitTermFreqAndPositions;
 }
开发者ID:BackupTheBerlios,项目名称:lyra2-svn,代码行数:9,代码来源:FreqProxTermsWriterPerField.cs


示例13: SortedDocValuesWriter

 public SortedDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed)
 {
     this.FieldInfo = fieldInfo;
     this.IwBytesUsed = iwBytesUsed;
     Hash = new BytesRefHash(new ByteBlockPool(new ByteBlockPool.DirectTrackingAllocator(iwBytesUsed)), BytesRefHash.DEFAULT_CAPACITY, new BytesRefHash.DirectBytesStartArray(BytesRefHash.DEFAULT_CAPACITY, iwBytesUsed));
     Pending = new AppendingDeltaPackedLongBuffer(PackedInts.COMPACT);
     BytesUsed = Pending.RamBytesUsed();
     iwBytesUsed.AddAndGet(BytesUsed);
 }
开发者ID:paulirwin,项目名称:lucene.net,代码行数:9,代码来源:SortedDocValuesWriter.cs


示例14: BinaryDocValuesWriter

 public BinaryDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed)
 {
     this.FieldInfo = fieldInfo;
     this.Bytes = new PagedBytes(BLOCK_BITS);
     this.BytesOut = Bytes.DataOutput;
     this.Lengths = new AppendingDeltaPackedLongBuffer(PackedInts.COMPACT);
     this.IwBytesUsed = iwBytesUsed;
     this.DocsWithField = new FixedBitSet(64);
     this.BytesUsed = DocsWithFieldBytesUsed();
     iwBytesUsed.AddAndGet(BytesUsed);
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:11,代码来源:BinaryDocValuesWriter.cs


示例15: AddField

		public void  AddField(Fieldable field, FieldInfo fieldInfo)
		{
			if (doc == null)
			{
				doc = storedFieldsWriter.GetPerDoc();
				doc.docID = docState.docID;
				localFieldsWriter.SetFieldsStream(doc.fdt);
				System.Diagnostics.Debug.Assert(doc.numStoredFields == 0, "doc.numStoredFields=" + doc.numStoredFields);
				System.Diagnostics.Debug.Assert(0 == doc.fdt.Length());
				System.Diagnostics.Debug.Assert(0 == doc.fdt.GetFilePointer());
			}
			
			localFieldsWriter.WriteField(fieldInfo, field);
			System.Diagnostics.Debug.Assert(docState.TestPoint("StoredFieldsWriterPerThread.processFields.writeField"));
			doc.numStoredFields++;
		}
开发者ID:Rationalle,项目名称:ravendb,代码行数:16,代码来源:StoredFieldsWriterPerThread.cs


示例16: TermsHashPerField

 public TermsHashPerField(DocInverterPerField docInverterPerField, TermsHashPerThread perThread, TermsHashPerThread nextPerThread, FieldInfo fieldInfo)
 {
     this.perThread = perThread;
     intPool = perThread.intPool;
     charPool = perThread.charPool;
     bytePool = perThread.bytePool;
     docState = perThread.docState;
     fieldState = docInverterPerField.fieldState;
     this.consumer = perThread.consumer.addField(this, fieldInfo);
     streamCount = consumer.getStreamCount();
     numPostingInt = 2 * streamCount;
     this.fieldInfo = fieldInfo;
     if (nextPerThread != null)
         nextPerField = (TermsHashPerField)nextPerThread.addField(docInverterPerField, fieldInfo);
     else
         nextPerField = null;
 }
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:17,代码来源:TermsHashPerField.cs


示例17: GetField

        /// <summary>
        /// Creates an IndexableField whose value will be lazy loaded if and 
        /// when it is used. 
        /// <para>
        /// <b>NOTE:</b> This method must be called once for each value of the field 
        /// name specified in sequence that the values exist.  This method may not be 
        /// used to generate multiple, lazy, IndexableField instances refering to 
        /// the same underlying IndexableField instance.
        /// </para>
        /// <para>
        /// The lazy loading of field values from all instances of IndexableField 
        /// objects returned by this method are all backed by a single Document 
        /// per LazyDocument instance.
        /// </para>
        /// </summary>
        public virtual IndexableField GetField(FieldInfo fieldInfo)
        {
            fieldNames.Add(fieldInfo.Name);
            IList<LazyField> values = fields.ContainsKey(fieldInfo.Number) ? fields[fieldInfo.Number] : null;
            if (null == values)
            {
                values = new List<LazyField>();
                fields[fieldInfo.Number] = values;
            }

            LazyField value = new LazyField(this, fieldInfo.Name, fieldInfo.Number);
            values.Add(value);

            lock (this)
            {
                // edge case: if someone asks this LazyDoc for more LazyFields
                // after other LazyFields from the same LazyDoc have been
                // actuallized, we need to force the doc to be re-fetched
                // so the new LazyFields are also populated.
                doc = null;
            }
            return value;
        }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:38,代码来源:LazyDocument.cs


示例18: TermsHashPerField

 public TermsHashPerField(DocInverterPerField docInverterPerField, TermsHash termsHash, TermsHash nextTermsHash, FieldInfo fieldInfo)
 {
     IntPool = termsHash.IntPool;
     BytePool = termsHash.BytePool;
     TermBytePool = termsHash.TermBytePool;
     DocState = termsHash.DocState;
     this.TermsHash = termsHash;
     BytesUsed = termsHash.BytesUsed;
     FieldState = docInverterPerField.FieldState;
     this.Consumer = termsHash.Consumer.AddField(this, fieldInfo);
     PostingsBytesStartArray byteStarts = new PostingsBytesStartArray(this, BytesUsed);
     BytesHash = new BytesRefHash(TermBytePool, HASH_INIT_SIZE, byteStarts);
     StreamCount = Consumer.StreamCount;
     NumPostingInt = 2 * StreamCount;
     this.FieldInfo = fieldInfo;
     if (nextTermsHash != null)
     {
         NextPerField = (TermsHashPerField)nextTermsHash.AddField(docInverterPerField, fieldInfo);
     }
     else
     {
         NextPerField = null;
     }
 }
开发者ID:joyanta,项目名称:lucene.net,代码行数:24,代码来源:TermsHashPerField.cs


示例19: AddField

		public override DocFieldConsumerPerField AddField(FieldInfo fi)
		{
			return new DocInverterPerField(this, fi);
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:4,代码来源:DocInverterPerThread.cs


示例20: AddInternal

		private FieldInfo AddInternal(System.String name, bool isIndexed, bool storeTermVector, bool storePositionWithTermVector, bool storeOffsetWithTermVector, bool omitNorms, bool storePayloads, bool omitTermFreqAndPositions)
		{
			name = StringHelper.Intern(name);
			FieldInfo fi = new FieldInfo(name, isIndexed, byNumber.Count, storeTermVector, storePositionWithTermVector, storeOffsetWithTermVector, omitNorms, storePayloads, omitTermFreqAndPositions);
			byNumber.Add(fi);
			byName[name] = fi;
			return fi;
		}
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:8,代码来源:FieldInfos.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Index.FieldInfos类代码示例发布时间:2022-05-26
下一篇:
C# Index.DocumentsWriter类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap