本文整理汇总了C#中Lucene.Net.Index.FieldInfo类的典型用法代码示例。如果您正苦于以下问题:C# FieldInfo类的具体用法?C# FieldInfo怎么用?C# FieldInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FieldInfo类属于Lucene.Net.Index命名空间,在下文中一共展示了FieldInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: NormsWriterPerField
public NormsWriterPerField(DocInverterPerField docInverterPerField, NormsWriterPerThread perThread, FieldInfo fieldInfo)
{
this.perThread = perThread;
this.fieldInfo = fieldInfo;
docState = perThread.docState;
fieldState = docInverterPerField.fieldState;
}
示例3: SetField
internal void SetField(FieldInfo fieldInfo)
{
this.fieldInfo = fieldInfo;
omitTermFreqAndPositions = fieldInfo.omitTermFreqAndPositions;
storePayloads = fieldInfo.storePayloads;
posWriter.SetField(fieldInfo);
}
示例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);
}
}
}
示例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);
}
示例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());
}
}
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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++;
}