You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2017/04/04 17:19:35 UTC
[29/62] [abbrv] [partial] lucenenet git commit: Renamed
Lucene.Net.Core folder Lucene.Net because the dotnet.exe pack command doesn't
allow creating a NuGet package with a different name than its folder. Working
around it with the script was much more co
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/PerField/PerFieldDocValuesFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/PerField/PerFieldDocValuesFormat.cs b/src/Lucene.Net.Core/Codecs/PerField/PerFieldDocValuesFormat.cs
deleted file mode 100644
index daf7f84..0000000
--- a/src/Lucene.Net.Core/Codecs/PerField/PerFieldDocValuesFormat.cs
+++ /dev/null
@@ -1,405 +0,0 @@
-using Lucene.Net.Support;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Globalization;
-
-namespace Lucene.Net.Codecs.PerField
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- using BinaryDocValues = Lucene.Net.Index.BinaryDocValues;
- using IBits = Lucene.Net.Util.IBits;
- using BytesRef = Lucene.Net.Util.BytesRef;
- using FieldInfo = Lucene.Net.Index.FieldInfo;
- using IOUtils = Lucene.Net.Util.IOUtils;
- using NumericDocValues = Lucene.Net.Index.NumericDocValues;
- using RamUsageEstimator = Lucene.Net.Util.RamUsageEstimator;
- using SegmentReadState = Lucene.Net.Index.SegmentReadState;
- using SegmentWriteState = Lucene.Net.Index.SegmentWriteState;
- using SortedDocValues = Lucene.Net.Index.SortedDocValues;
- using SortedSetDocValues = Lucene.Net.Index.SortedSetDocValues;
-
- /// <summary>
- /// Enables per field docvalues support.
- /// <p>
- /// Note, when extending this class, the name (<seealso cref="#getName"/>) is
- /// written into the index. In order for the field to be read, the
- /// name must resolve to your implementation via <seealso cref="#forName(String)"/>.
- /// this method uses Java's
- /// <seealso cref="ServiceLoader Service Provider Interface"/> to resolve format names.
- /// <p>
- /// Files written by each docvalues format have an additional suffix containing the
- /// format name. For example, in a per-field configuration instead of <tt>_1.dat</tt>
- /// filenames would look like <tt>_1_Lucene40_0.dat</tt>. </summary>
- /// <seealso cref= ServiceLoader
- /// @lucene.experimental </seealso>
- [DocValuesFormatName("PerFieldDV40")]
- public abstract class PerFieldDocValuesFormat : DocValuesFormat
- {
- // LUCENENET specific: Removing this static variable, since name is now determined by the DocValuesFormatNameAttribute.
- ///// <summary>
- ///// Name of this <seealso cref="PostingsFormat"/>. </summary>
- //public static readonly string PER_FIELD_NAME = "PerFieldDV40";
-
- /// <summary>
- /// <seealso cref="FieldInfo"/> attribute name used to store the
- /// format name for each field.
- /// </summary>
- public static readonly string PER_FIELD_FORMAT_KEY = typeof(PerFieldDocValuesFormat).Name + ".format";
-
- /// <summary>
- /// <seealso cref="FieldInfo"/> attribute name used to store the
- /// segment suffix name for each field.
- /// </summary>
- public static readonly string PER_FIELD_SUFFIX_KEY = typeof(PerFieldDocValuesFormat).Name + ".suffix";
-
- /// <summary>
- /// Sole constructor. </summary>
- public PerFieldDocValuesFormat()
- : base()
- {
- }
-
- public override sealed DocValuesConsumer FieldsConsumer(SegmentWriteState state)
- {
- return new FieldsWriter(this, state);
- }
-
- internal class ConsumerAndSuffix : IDisposable
- {
- internal DocValuesConsumer Consumer { get; set; }
- internal int Suffix { get; set; }
-
- public void Dispose()
- {
- Consumer.Dispose();
- }
- }
-
- private class FieldsWriter : DocValuesConsumer
- {
- private readonly PerFieldDocValuesFormat outerInstance;
-
- internal readonly IDictionary<DocValuesFormat, ConsumerAndSuffix> formats = new Dictionary<DocValuesFormat, ConsumerAndSuffix>();
- internal readonly IDictionary<string, int?> suffixes = new Dictionary<string, int?>();
-
- internal readonly SegmentWriteState segmentWriteState;
-
- public FieldsWriter(PerFieldDocValuesFormat outerInstance, SegmentWriteState state)
- {
- this.outerInstance = outerInstance;
- segmentWriteState = state;
- }
-
- public override void AddNumericField(FieldInfo field, IEnumerable<long?> values)
- {
- GetInstance(field).AddNumericField(field, values);
- }
-
- public override void AddBinaryField(FieldInfo field, IEnumerable<BytesRef> values)
- {
- GetInstance(field).AddBinaryField(field, values);
- }
-
- public override void AddSortedField(FieldInfo field, IEnumerable<BytesRef> values, IEnumerable<long?> docToOrd)
- {
- GetInstance(field).AddSortedField(field, values, docToOrd);
- }
-
- public override void AddSortedSetField(FieldInfo field, IEnumerable<BytesRef> values, IEnumerable<long?> docToOrdCount, IEnumerable<long?> ords)
- {
- GetInstance(field).AddSortedSetField(field, values, docToOrdCount, ords);
- }
-
- internal virtual DocValuesConsumer GetInstance(FieldInfo field)
- {
- DocValuesFormat format = null;
- if (field.DocValuesGen != -1)
- {
- string formatName = field.GetAttribute(PER_FIELD_FORMAT_KEY);
- // this means the field never existed in that segment, yet is applied updates
- if (formatName != null)
- {
- format = DocValuesFormat.ForName(formatName);
- }
- }
- if (format == null)
- {
- format = outerInstance.GetDocValuesFormatForField(field.Name);
- }
- if (format == null)
- {
- throw new InvalidOperationException("invalid null DocValuesFormat for field=\"" + field.Name + "\"");
- }
- string formatName_ = format.Name;
-
- string previousValue = field.PutAttribute(PER_FIELD_FORMAT_KEY, formatName_);
- Debug.Assert(field.DocValuesGen != -1 || previousValue == null, "formatName=" + formatName_ + " prevValue=" + previousValue);
-
- int? suffix = null;
-
- ConsumerAndSuffix consumer;
- if (!formats.TryGetValue(format, out consumer) || consumer == null)
- {
- // First time we are seeing this format; create a new instance
-
- if (field.DocValuesGen != -1)
- {
- string suffixAtt = field.GetAttribute(PER_FIELD_SUFFIX_KEY);
- // even when dvGen is != -1, it can still be a new field, that never
- // existed in the segment, and therefore doesn't have the recorded
- // attributes yet.
- if (suffixAtt != null)
- {
- suffix = Convert.ToInt32(suffixAtt, CultureInfo.InvariantCulture);
- }
- }
-
- if (suffix == null)
- {
- // bump the suffix
- if (!suffixes.TryGetValue(formatName_, out suffix) || suffix == null)
- {
- suffix = 0;
- }
- else
- {
- suffix = suffix + 1;
- }
- }
- suffixes[formatName_] = suffix;
-
- string segmentSuffix = GetFullSegmentSuffix(segmentWriteState.SegmentSuffix, GetSuffix(formatName_, Convert.ToString(suffix, CultureInfo.InvariantCulture)));
- consumer = new ConsumerAndSuffix();
- consumer.Consumer = format.FieldsConsumer(new SegmentWriteState(segmentWriteState, segmentSuffix));
- consumer.Suffix = suffix.Value; // LUCENENET NOTE: At this point suffix cannot be null
- formats[format] = consumer;
- }
- else
- {
- // we've already seen this format, so just grab its suffix
- Debug.Assert(suffixes.ContainsKey(formatName_));
- suffix = consumer.Suffix;
- }
-
- previousValue = field.PutAttribute(PER_FIELD_SUFFIX_KEY, Convert.ToString(suffix, CultureInfo.InvariantCulture));
- Debug.Assert(field.DocValuesGen != -1 || previousValue == null, "suffix=" + Convert.ToString(suffix, CultureInfo.InvariantCulture) + " prevValue=" + previousValue);
-
- // TODO: we should only provide the "slice" of FIS
- // that this DVF actually sees ...
- return consumer.Consumer;
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- // Close all subs
- IOUtils.Close(formats.Values);
- }
- }
- }
-
- internal static string GetSuffix(string formatName, string suffix)
- {
- return formatName + "_" + suffix;
- }
-
- internal static string GetFullSegmentSuffix(string outerSegmentSuffix, string segmentSuffix)
- {
- if (outerSegmentSuffix.Length == 0)
- {
- return segmentSuffix;
- }
- else
- {
- return outerSegmentSuffix + "_" + segmentSuffix;
- }
- }
-
- private class FieldsReader : DocValuesProducer
- {
- private readonly PerFieldDocValuesFormat outerInstance;
-
- // LUCENENET specific: Use StringComparer.Ordinal to get the same ordering as Java
- internal readonly IDictionary<string, DocValuesProducer> fields = new SortedDictionary<string, DocValuesProducer>(StringComparer.Ordinal);
- internal readonly IDictionary<string, DocValuesProducer> formats = new Dictionary<string, DocValuesProducer>();
-
- public FieldsReader(PerFieldDocValuesFormat outerInstance, SegmentReadState readState)
- {
- this.outerInstance = outerInstance;
-
- // Read _X.per and init each format:
- bool success = false;
- try
- {
- // Read field name -> format name
- foreach (FieldInfo fi in readState.FieldInfos)
- {
- if (fi.HasDocValues)
- {
- string fieldName = fi.Name;
- string formatName = fi.GetAttribute(PER_FIELD_FORMAT_KEY);
- if (formatName != null)
- {
- // null formatName means the field is in fieldInfos, but has no docvalues!
- string suffix = fi.GetAttribute(PER_FIELD_SUFFIX_KEY);
- Debug.Assert(suffix != null);
- DocValuesFormat format = DocValuesFormat.ForName(formatName);
- string segmentSuffix = GetFullSegmentSuffix(readState.SegmentSuffix, GetSuffix(formatName, suffix));
- if (!formats.ContainsKey(segmentSuffix))
- {
- formats[segmentSuffix] = format.FieldsProducer(new SegmentReadState(readState, segmentSuffix));
- }
- fields[fieldName] = formats[segmentSuffix];
- }
- }
- }
- success = true;
- }
- finally
- {
- if (!success)
- {
- IOUtils.CloseWhileHandlingException(formats.Values);
- }
- }
- }
-
- internal FieldsReader(PerFieldDocValuesFormat outerInstance, FieldsReader other)
- {
- this.outerInstance = outerInstance;
-
- IDictionary<DocValuesProducer, DocValuesProducer> oldToNew = new IdentityHashMap<DocValuesProducer, DocValuesProducer>();
- // First clone all formats
- foreach (KeyValuePair<string, DocValuesProducer> ent in other.formats)
- {
- DocValuesProducer values = ent.Value;
- formats[ent.Key] = values;
- oldToNew[ent.Value] = values;
- }
-
- // Then rebuild fields:
- foreach (KeyValuePair<string, DocValuesProducer> ent in other.fields)
- {
- DocValuesProducer producer;
- oldToNew.TryGetValue(ent.Value, out producer);
- Debug.Assert(producer != null);
- fields[ent.Key] = producer;
- }
- }
-
- public override NumericDocValues GetNumeric(FieldInfo field)
- {
- DocValuesProducer producer;
- if (fields.TryGetValue(field.Name, out producer) && producer != null)
- {
- return producer.GetNumeric(field);
- }
- return null;
- }
-
- public override BinaryDocValues GetBinary(FieldInfo field)
- {
- DocValuesProducer producer;
- if (fields.TryGetValue(field.Name, out producer) && producer != null)
- {
- return producer.GetBinary(field);
- }
- return null;
- }
-
- public override SortedDocValues GetSorted(FieldInfo field)
- {
- DocValuesProducer producer;
- if (fields.TryGetValue(field.Name, out producer) && producer != null)
- {
- return producer.GetSorted(field);
- }
- return null;
- }
-
- public override SortedSetDocValues GetSortedSet(FieldInfo field)
- {
- DocValuesProducer producer;
- if (fields.TryGetValue(field.Name, out producer) && producer != null)
- {
- return producer.GetSortedSet(field);
- }
- return null;
- }
-
- public override IBits GetDocsWithField(FieldInfo field)
- {
- DocValuesProducer producer;
- if (fields.TryGetValue(field.Name, out producer) && producer != null)
- {
- return producer.GetDocsWithField(field);
- }
- return null;
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- IOUtils.Close(formats.Values);
- }
- }
-
- public object Clone()
- {
- return new FieldsReader(outerInstance, this);
- }
-
- public override long RamBytesUsed()
- {
- long size = 0;
- foreach (KeyValuePair<string, DocValuesProducer> entry in formats)
- {
- size += (entry.Key.Length * RamUsageEstimator.NUM_BYTES_CHAR)
- + entry.Value.RamBytesUsed();
- }
- return size;
- }
-
- public override void CheckIntegrity()
- {
- foreach (DocValuesProducer format in formats.Values)
- {
- format.CheckIntegrity();
- }
- }
- }
-
- public override sealed DocValuesProducer FieldsProducer(SegmentReadState state)
- {
- return new FieldsReader(this, state);
- }
-
- /// <summary>
- /// Returns the doc values format that should be used for writing
- /// new segments of <code>field</code>.
- /// <p>
- /// The field to format mapping is written to the index, so
- /// this method is only invoked when writing, not when reading.
- /// </summary>
- public abstract DocValuesFormat GetDocValuesFormatForField(string field);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/PerField/PerFieldPostingsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/PerField/PerFieldPostingsFormat.cs b/src/Lucene.Net.Core/Codecs/PerField/PerFieldPostingsFormat.cs
deleted file mode 100644
index c214df8..0000000
--- a/src/Lucene.Net.Core/Codecs/PerField/PerFieldPostingsFormat.cs
+++ /dev/null
@@ -1,302 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Globalization;
-
-namespace Lucene.Net.Codecs.PerField
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- using FieldInfo = Lucene.Net.Index.FieldInfo;
- using IOUtils = Lucene.Net.Util.IOUtils;
- using RamUsageEstimator = Lucene.Net.Util.RamUsageEstimator;
- using SegmentReadState = Lucene.Net.Index.SegmentReadState;
- using SegmentWriteState = Lucene.Net.Index.SegmentWriteState;
- using Terms = Lucene.Net.Index.Terms;
-
- /// <summary>
- /// Enables per field postings support.
- /// <p>
- /// Note, when extending this class, the name (<seealso cref="#getName"/>) is
- /// written into the index. In order for the field to be read, the
- /// name must resolve to your implementation via <seealso cref="#forName(String)"/>.
- /// this method uses Java's
- /// <seealso cref="ServiceLoader Service Provider Interface"/> to resolve format names.
- /// <p>
- /// Files written by each posting format have an additional suffix containing the
- /// format name. For example, in a per-field configuration instead of <tt>_1.prx</tt>
- /// filenames would look like <tt>_1_Lucene40_0.prx</tt>. </summary>
- /// <seealso cref= ServiceLoader
- /// @lucene.experimental </seealso>
- [PostingsFormatName("PerField40")] // LUCENENET specific - using PostingsFormatName attribute to ensure the default name passed from subclasses is the same as this class name
- public abstract class PerFieldPostingsFormat : PostingsFormat
- {
- // LUCENENET specific - removed this static variable because our name is determined by the PostingsFormatNameAttribute
- ///// <summary>
- ///// Name of this <seealso cref="PostingsFormat"/>. </summary>
- //public static readonly string PER_FIELD_NAME = "PerField40";
-
- /// <summary>
- /// <seealso cref="FieldInfo"/> attribute name used to store the
- /// format name for each field.
- /// </summary>
- public static readonly string PER_FIELD_FORMAT_KEY = typeof(PerFieldPostingsFormat).Name + ".format";
-
- /// <summary>
- /// <seealso cref="FieldInfo"/> attribute name used to store the
- /// segment suffix name for each field.
- /// </summary>
- public static readonly string PER_FIELD_SUFFIX_KEY = typeof(PerFieldPostingsFormat).Name + ".suffix";
-
- /// <summary>
- /// Sole constructor. </summary>
- public PerFieldPostingsFormat()
- : base()
- {
- }
-
- public override sealed FieldsConsumer FieldsConsumer(SegmentWriteState state)
- {
- return new FieldsWriter(this, state);
- }
-
- internal class FieldsConsumerAndSuffix : IDisposable
- {
- internal FieldsConsumer Consumer { get; set; }
- internal int Suffix { get; set; }
-
- public void Dispose()
- {
- Consumer.Dispose();
- }
- }
-
- private class FieldsWriter : FieldsConsumer
- {
- private readonly PerFieldPostingsFormat outerInstance;
-
- internal readonly IDictionary<PostingsFormat, FieldsConsumerAndSuffix> formats = new Dictionary<PostingsFormat, FieldsConsumerAndSuffix>();
- internal readonly IDictionary<string, int?> suffixes = new Dictionary<string, int?>();
-
- internal readonly SegmentWriteState segmentWriteState;
-
- public FieldsWriter(PerFieldPostingsFormat outerInstance, SegmentWriteState state)
- {
- this.outerInstance = outerInstance;
- segmentWriteState = state;
- }
-
- public override TermsConsumer AddField(FieldInfo field)
- {
- PostingsFormat format = outerInstance.GetPostingsFormatForField(field.Name);
- if (format == null)
- {
- throw new InvalidOperationException("invalid null PostingsFormat for field=\"" + field.Name + "\"");
- }
- string formatName = format.Name;
-
- string previousValue = field.PutAttribute(PER_FIELD_FORMAT_KEY, formatName);
- Debug.Assert(previousValue == null);
-
- int? suffix;
-
- FieldsConsumerAndSuffix consumer;
- if (!formats.TryGetValue(format, out consumer) || consumer == null)
- {
- // First time we are seeing this format; create a new instance
-
- // bump the suffix
- if (!suffixes.TryGetValue(formatName, out suffix) || suffix == null)
- {
- suffix = 0;
- }
- else
- {
- suffix = suffix + 1;
- }
- suffixes[formatName] = suffix;
-
- string segmentSuffix = GetFullSegmentSuffix(field.Name,
- segmentWriteState.SegmentSuffix,
- GetSuffix(formatName, Convert.ToString(suffix, CultureInfo.InvariantCulture)));
- consumer = new FieldsConsumerAndSuffix();
- consumer.Consumer = format.FieldsConsumer(new SegmentWriteState(segmentWriteState, segmentSuffix));
- consumer.Suffix = suffix.Value; // LUCENENET NOTE: At this point suffix cannot be null
- formats[format] = consumer;
- }
- else
- {
- // we've already seen this format, so just grab its suffix
- Debug.Assert(suffixes.ContainsKey(formatName));
- suffix = consumer.Suffix;
- }
-
- previousValue = field.PutAttribute(PER_FIELD_SUFFIX_KEY, Convert.ToString(suffix, CultureInfo.InvariantCulture));
- Debug.Assert(previousValue == null);
-
- // TODO: we should only provide the "slice" of FIS
- // that this PF actually sees ... then stuff like
- // .hasProx could work correctly?
- // NOTE: .hasProx is already broken in the same way for the non-perfield case,
- // if there is a fieldinfo with prox that has no postings, you get a 0 byte file.
- return consumer.Consumer.AddField(field);
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- // Close all subs
- IOUtils.Close(formats.Values);
- }
- }
- }
-
- internal static string GetSuffix(string formatName, string suffix)
- {
- return formatName + "_" + suffix;
- }
-
- internal static string GetFullSegmentSuffix(string fieldName, string outerSegmentSuffix, string segmentSuffix)
- {
- if (outerSegmentSuffix.Length == 0)
- {
- return segmentSuffix;
- }
- else
- {
- // TODO: support embedding; I think it should work but
- // we need a test confirm to confirm
- // return outerSegmentSuffix + "_" + segmentSuffix;
- throw new InvalidOperationException("cannot embed PerFieldPostingsFormat inside itself (field \"" + fieldName + "\" returned PerFieldPostingsFormat)");
- }
- }
-
- private class FieldsReader : FieldsProducer
- {
- private readonly PerFieldPostingsFormat outerInstance;
-
- // LUCENENET specific: Use StringComparer.Ordinal to get the same ordering as Java
- internal readonly IDictionary<string, FieldsProducer> fields = new SortedDictionary<string, FieldsProducer>(StringComparer.Ordinal);
- internal readonly IDictionary<string, FieldsProducer> formats = new Dictionary<string, FieldsProducer>();
-
- public FieldsReader(PerFieldPostingsFormat outerInstance, SegmentReadState readState)
- {
- this.outerInstance = outerInstance;
-
- // Read _X.per and init each format:
- bool success = false;
- try
- {
- // Read field name -> format name
- foreach (FieldInfo fi in readState.FieldInfos)
- {
- if (fi.IsIndexed)
- {
- string fieldName = fi.Name;
- string formatName = fi.GetAttribute(PER_FIELD_FORMAT_KEY);
- if (formatName != null)
- {
- // null formatName means the field is in fieldInfos, but has no postings!
- string suffix = fi.GetAttribute(PER_FIELD_SUFFIX_KEY);
- Debug.Assert(suffix != null);
- PostingsFormat format = PostingsFormat.ForName(formatName);
- string segmentSuffix = GetSuffix(formatName, suffix);
- if (!formats.ContainsKey(segmentSuffix))
- {
- formats[segmentSuffix] = format.FieldsProducer(new SegmentReadState(readState, segmentSuffix));
- }
- fields[fieldName] = formats[segmentSuffix];
- }
- }
- }
- success = true;
- }
- finally
- {
- if (!success)
- {
- IOUtils.CloseWhileHandlingException(formats.Values);
- }
- }
- }
-
- public override IEnumerator<string> GetEnumerator()
- {
- return fields.Keys.GetEnumerator(); // LUCENENET NOTE: enumerators are not writable in .NET
- }
-
- public override Terms GetTerms(string field)
- {
- FieldsProducer fieldsProducer;
- if (fields.TryGetValue(field, out fieldsProducer) && fieldsProducer != null)
- {
- return fieldsProducer.GetTerms(field);
- }
-
- return null;
- }
-
- public override int Count
- {
- get { return fields.Count; }
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- IOUtils.Close(formats.Values);
- }
- }
-
- public override long RamBytesUsed()
- {
- long sizeInBytes = 0;
- foreach (KeyValuePair<string, FieldsProducer> entry in formats)
- {
- sizeInBytes += entry.Key.Length * RamUsageEstimator.NUM_BYTES_CHAR;
- sizeInBytes += entry.Value.RamBytesUsed();
- }
- return sizeInBytes;
- }
-
- public override void CheckIntegrity()
- {
- foreach (FieldsProducer producer in formats.Values)
- {
- producer.CheckIntegrity();
- }
- }
- }
-
- public override sealed FieldsProducer FieldsProducer(SegmentReadState state)
- {
- return new FieldsReader(this, state);
- }
-
- /// <summary>
- /// Returns the postings format that should be used for writing
- /// new segments of <code>field</code>.
- /// <p>
- /// The field to format mapping is written to the index, so
- /// this method is only invoked when writing, not when reading.
- /// </summary>
- public abstract PostingsFormat GetPostingsFormatForField(string field);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/PostingsBaseFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/PostingsBaseFormat.cs b/src/Lucene.Net.Core/Codecs/PostingsBaseFormat.cs
deleted file mode 100644
index f9b4876..0000000
--- a/src/Lucene.Net.Core/Codecs/PostingsBaseFormat.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-namespace Lucene.Net.Codecs
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- using SegmentReadState = Lucene.Net.Index.SegmentReadState;
- using SegmentWriteState = Lucene.Net.Index.SegmentWriteState;
-
- /// <summary>
- /// Provides a <seealso cref="PostingsReaderBase"/> and {@link
- /// PostingsWriterBase}.
- ///
- /// @lucene.experimental
- /// </summary>
-
- // TODO: find a better name; this defines the API that the
- // terms dict impls use to talk to a postings impl.
- // TermsDict + PostingsReader/WriterBase == PostingsConsumer/Producer
-
- // can we clean this up and do this some other way?
- // refactor some of these classes and use covariant return?
- public abstract class PostingsBaseFormat
- {
- /// <summary>
- /// Unique name that's used to retrieve this codec when
- /// reading the index
- /// </summary>
- public string Name { get; private set; }
-
- /// <summary>
- /// Sole constructor. </summary>
- protected internal PostingsBaseFormat(string name)
- {
- this.Name = name;
- }
-
- /// <summary>
- /// Creates the <seealso cref="PostingsReaderBase"/> for this
- /// format.
- /// </summary>
- public abstract PostingsReaderBase PostingsReaderBase(SegmentReadState state);
-
- /// <summary>
- /// Creates the <seealso cref="PostingsWriterBase"/> for this
- /// format.
- /// </summary>
- public abstract PostingsWriterBase PostingsWriterBase(SegmentWriteState state);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/PostingsConsumer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/PostingsConsumer.cs b/src/Lucene.Net.Core/Codecs/PostingsConsumer.cs
deleted file mode 100644
index b8615a7..0000000
--- a/src/Lucene.Net.Core/Codecs/PostingsConsumer.cs
+++ /dev/null
@@ -1,177 +0,0 @@
-using Lucene.Net.Index;
-using System.Diagnostics;
-
-namespace Lucene.Net.Codecs
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- using BytesRef = Lucene.Net.Util.BytesRef;
- using DocIdSetIterator = Lucene.Net.Search.DocIdSetIterator;
- using DocsAndPositionsEnum = Lucene.Net.Index.DocsAndPositionsEnum;
- using DocsEnum = Lucene.Net.Index.DocsEnum;
- using FixedBitSet = Lucene.Net.Util.FixedBitSet;
- using MergeState = Lucene.Net.Index.MergeState;
-
- /// <summary>
- /// Abstract API that consumes postings for an individual term.
- /// <p>
- /// The lifecycle is:
- /// <ol>
- /// <li>PostingsConsumer is returned for each term by
- /// <seealso cref="TermsConsumer#startTerm(BytesRef)"/>.
- /// <li><seealso cref="#startDoc(int, int)"/> is called for each
- /// document where the term occurs, specifying id
- /// and term frequency for that document.
- /// <li>If positions are enabled for the field, then
- /// <seealso cref="#addPosition(int, BytesRef, int, int)"/>
- /// will be called for each occurrence in the
- /// document.
- /// <li><seealso cref="#finishDoc()"/> is called when the producer
- /// is done adding positions to the document.
- /// </ol>
- ///
- /// @lucene.experimental
- /// </summary>
- public abstract class PostingsConsumer
- {
- /// <summary>
- /// Sole constructor. (For invocation by subclass
- /// constructors, typically implicit.)
- /// </summary>
- protected internal PostingsConsumer()
- {
- }
-
- /// <summary>
- /// Adds a new doc in this term.
- /// <code>freq</code> will be -1 when term frequencies are omitted
- /// for the field.
- /// </summary>
- public abstract void StartDoc(int docId, int freq);
-
- /// <summary>
- /// Add a new position & payload, and start/end offset. A
- /// null payload means no payload; a non-null payload with
- /// zero length also means no payload. Caller may reuse
- /// the <seealso cref="BytesRef"/> for the payload between calls
- /// (method must fully consume the payload). <code>startOffset</code>
- /// and <code>endOffset</code> will be -1 when offsets are not indexed.
- /// </summary>
- public abstract void AddPosition(int position, BytesRef payload, int startOffset, int endOffset);
-
- /// <summary>
- /// Called when we are done adding positions & payloads
- /// for each doc.
- /// </summary>
- public abstract void FinishDoc();
-
- /// <summary>
- /// Default merge impl: append documents, mapping around
- /// deletes
- /// </summary>
- public virtual TermStats Merge(MergeState mergeState, IndexOptions indexOptions, DocsEnum postings, FixedBitSet visitedDocs)
- {
- int df = 0;
- long totTF = 0;
-
- if (indexOptions == IndexOptions.DOCS_ONLY)
- {
- while (true)
- {
- int doc = postings.NextDoc();
- if (doc == DocIdSetIterator.NO_MORE_DOCS)
- {
- break;
- }
- visitedDocs.Set(doc);
- this.StartDoc(doc, -1);
- this.FinishDoc();
- df++;
- }
- totTF = -1;
- }
- else if (indexOptions == IndexOptions.DOCS_AND_FREQS)
- {
- while (true)
- {
- int doc = postings.NextDoc();
- if (doc == DocIdSetIterator.NO_MORE_DOCS)
- {
- break;
- }
- visitedDocs.Set(doc);
- int freq = postings.Freq;
- this.StartDoc(doc, freq);
- this.FinishDoc();
- df++;
- totTF += freq;
- }
- }
- else if (indexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS)
- {
- var postingsEnum = (DocsAndPositionsEnum)postings;
- while (true)
- {
- int doc = postingsEnum.NextDoc();
- if (doc == DocIdSetIterator.NO_MORE_DOCS)
- {
- break;
- }
- visitedDocs.Set(doc);
- int freq = postingsEnum.Freq;
- this.StartDoc(doc, freq);
- totTF += freq;
- for (int i = 0; i < freq; i++)
- {
- int position = postingsEnum.NextPosition();
- BytesRef payload = postingsEnum.GetPayload();
- this.AddPosition(position, payload, -1, -1);
- }
- this.FinishDoc();
- df++;
- }
- }
- else
- {
- Debug.Assert(indexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS);
- var postingsEnum = (DocsAndPositionsEnum)postings;
- while (true)
- {
- int doc = postingsEnum.NextDoc();
- if (doc == DocIdSetIterator.NO_MORE_DOCS)
- {
- break;
- }
- visitedDocs.Set(doc);
- int freq = postingsEnum.Freq;
- this.StartDoc(doc, freq);
- totTF += freq;
- for (int i = 0; i < freq; i++)
- {
- int position = postingsEnum.NextPosition();
- BytesRef payload = postingsEnum.GetPayload();
- this.AddPosition(position, payload, postingsEnum.StartOffset, postingsEnum.EndOffset);
- }
- this.FinishDoc();
- df++;
- }
- }
- return new TermStats(df, indexOptions == IndexOptions.DOCS_ONLY ? -1 : totTF);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/PostingsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/PostingsFormat.cs b/src/Lucene.Net.Core/Codecs/PostingsFormat.cs
deleted file mode 100644
index c4bdd88..0000000
--- a/src/Lucene.Net.Core/Codecs/PostingsFormat.cs
+++ /dev/null
@@ -1,169 +0,0 @@
-using Lucene.Net.Index;
-using Lucene.Net.Util;
-using System;
-using System.Collections.Generic;
-
-namespace Lucene.Net.Codecs
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- /// <summary>
- /// Encodes/decodes terms, postings, and proximity data.
- /// <para/>
- /// Note, when extending this class, the name (<see cref="Name"/>) may
- /// written into the index in certain configurations. In order for the segment
- /// to be read, the name must resolve to your implementation via <see cref="ForName(string)"/>.
- /// this method uses <see cref="IPostingsFormatFactory.GetPostingsFormat(string)"/> to resolve format names.
- /// <para/>
- /// If you implement your own format:
- /// <list type="number">
- /// <item>Subclass this class.</item>
- /// <item>Subclass <see cref="DefaultPostingsFormatFactory"/> and add the line
- /// <c>base.ScanForPostingsFormats(typeof(YourPostingsFormat).GetTypeInfo().Assembly)</c>
- /// to the constructor. If you have any format classes in your assembly
- /// that are not meant for reading, you can add the <see cref="ExcludePostingsFormatFromScanAttribute"/>
- /// to them so they are ignored by the scan.</item>
- /// <item>Set the new <see cref="IPostingsFormatFactory"/> by calling <see cref="SetPostingsFormatFactory(IPostingsFormatFactory)"/>
- /// at application startup.</item>
- /// </list>
- /// If your format has dependencies, you may also override <see cref="DefaultPostingsFormatFactory.GetPostingsFormat(Type)"/> to inject
- /// them via pure DI or a DI container. See <a href="http://blog.ploeh.dk/2014/05/19/di-friendly-framework/">DI-Friendly Framework</a>
- /// to understand the approach used.
- /// <para/>
- /// <b>PostingsFormat Names</b>
- /// <para/>
- /// Unlike the Java version, format names are by default convention-based on the class name.
- /// If you name your custom format class "MyCustomPostingsFormat", the codec name will the same name
- /// without the "PostingsFormat" suffix: "MyCustom".
- /// <para/>
- /// You can override this default behavior by using the <see cref="PostingsFormatNameAttribute"/> to
- /// name the format differently than this convention. Format names must be all ASCII alphanumeric,
- /// and less than 128 characters in length.
- /// <para/>
- /// @lucene.experimental
- /// </summary>
- /// <seealso cref="DefaultPostingsFormatFactory"/>
- /// <seealso cref="IPostingsFormatFactory"/>
- /// <seealso cref="PostingsFormatNameAttribute"/>
- // LUCENENET specific - refactored this class so it depends on IPostingsFormatFactory rather than
- // the Java-centric NamedSPILoader
- public abstract class PostingsFormat //: NamedSPILoader.INamedSPI
- {
- private static IPostingsFormatFactory postingsFormatFactory = new DefaultPostingsFormatFactory();
-
- /// <summary>
- /// Zero-length <see cref="PostingsFormat"/> array. </summary>
- public static readonly PostingsFormat[] EMPTY = new PostingsFormat[0];
-
- /// <summary>
- /// Unique name that's used to retrieve this format when
- /// reading the index.
- /// </summary>
- private readonly string name;
-
- /// <summary>
- /// Sets the <see cref="IPostingsFormatFactory"/> instance used to instantiate
- /// <see cref="PostingsFormat"/> subclasses.
- /// </summary>
- /// <param name="postingsFormatFactory">The new <see cref="IPostingsFormatFactory"/>.</param>
- /// <exception cref="ArgumentNullException">The <paramref name="postingsFormatFactory"/> parameter is <c>null</c>.</exception>
- public static void SetPostingsFormatFactory(IPostingsFormatFactory postingsFormatFactory)
- {
- if (postingsFormatFactory == null)
- throw new ArgumentNullException("postingsFormatFactory");
- PostingsFormat.postingsFormatFactory = postingsFormatFactory;
- }
-
- /// <summary>
- /// Gets the associated <see cref="PostingsFormat"/> factory.
- /// </summary>
- /// <returns>The <see cref="PostingsFormat"/> factory.</returns>
- public static IPostingsFormatFactory GetPostingsFormatFactory()
- {
- return postingsFormatFactory;
- }
-
- /// <summary>
- /// Creates a new postings format.
- /// <para/>
- /// The provided name will be written into the index segment in some configurations
- /// (such as when using <see cref="PerField.PerFieldPostingsFormat"/>): in such configurations,
- /// for the segment to be read this class should be registered by subclassing <see cref="DefaultPostingsFormatFactory"/> and
- /// calling <see cref="DefaultPostingsFormatFactory.ScanForPostingsFormats(System.Reflection.Assembly)"/> in the class constructor.
- /// The new <see cref="IPostingsFormatFactory"/> can be registered by calling <see cref="SetPostingsFormatFactory"/> at application startup.</summary>
- protected PostingsFormat()
- {
- this.name = NamedServiceFactory<PostingsFormat>.GetServiceName(this.GetType());
- }
-
- /// <summary>
- /// Returns this posting format's name </summary>
- public string Name
- {
- get
- {
- return name;
- }
- }
-
- /// <summary>
- /// Writes a new segment </summary>
- public abstract FieldsConsumer FieldsConsumer(SegmentWriteState state);
-
- /// <summary>
- /// Reads a segment. NOTE: by the time this call
- /// returns, it must hold open any files it will need to
- /// use; else, those files may be deleted.
- /// Additionally, required files may be deleted during the execution of
- /// this call before there is a chance to open them. Under these
- /// circumstances an IOException should be thrown by the implementation.
- /// IOExceptions are expected and will automatically cause a retry of the
- /// segment opening logic with the newly revised segments.
- /// </summary>
- public abstract FieldsProducer FieldsProducer(SegmentReadState state);
-
- public override string ToString()
- {
- return "PostingsFormat(name=" + name + ")";
- }
-
- /// <summary>
- /// looks up a format by name </summary>
- public static PostingsFormat ForName(string name)
- {
- return postingsFormatFactory.GetPostingsFormat(name);
- }
-
- /// <summary>
- /// returns a list of all available format names </summary>
- public static ICollection<string> AvailablePostingsFormats()
- {
- if (postingsFormatFactory is IServiceListable)
- {
- return ((IServiceListable)postingsFormatFactory).AvailableServices();
- }
- else
- {
- throw new NotSupportedException("The current PostingsFormat factory class does not implement IServiceListable.");
- }
- }
-
- // LUCENENET specific: Removed the ReloadPostingsFormats() method because
- // this goes against the grain of standard DI practices.
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/PostingsReaderBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/PostingsReaderBase.cs b/src/Lucene.Net.Core/Codecs/PostingsReaderBase.cs
deleted file mode 100644
index 8a5688b..0000000
--- a/src/Lucene.Net.Core/Codecs/PostingsReaderBase.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-using Lucene.Net.Index;
-using System;
-
-namespace Lucene.Net.Codecs
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- using IBits = Lucene.Net.Util.IBits;
- using DataInput = Lucene.Net.Store.DataInput;
- using DocsAndPositionsEnum = Lucene.Net.Index.DocsAndPositionsEnum;
- using DocsEnum = Lucene.Net.Index.DocsEnum;
- using FieldInfo = Lucene.Net.Index.FieldInfo;
- using IndexInput = Lucene.Net.Store.IndexInput;
-
- /// <summary>
- /// The core terms dictionaries (BlockTermsReader,
- /// BlockTreeTermsReader) interact with a single instance
- /// of this class to manage creation of <seealso cref="DocsEnum"/> and
- /// <seealso cref="DocsAndPositionsEnum"/> instances. It provides an
- /// IndexInput (termsIn) where this class may read any
- /// previously stored data that it had written in its
- /// corresponding <seealso cref="PostingsWriterBase"/> at indexing
- /// time.
- /// @lucene.experimental
- /// </summary>
-
- // TODO: find a better name; this defines the API that the
- // terms dict impls use to talk to a postings impl.
- // TermsDict + PostingsReader/WriterBase == PostingsConsumer/Producer
- public abstract class PostingsReaderBase : IDisposable
- {
- /// <summary>
- /// Sole constructor. (For invocation by subclass
- /// constructors, typically implicit.)
- /// </summary>
- protected internal PostingsReaderBase()
- {
- }
-
- /// <summary>
- /// Performs any initialization, such as reading and
- /// verifying the header from the provided terms
- /// dictionary <seealso cref="IndexInput"/>.
- /// </summary>
- public abstract void Init(IndexInput termsIn);
-
- /// <summary>
- /// Return a newly created empty TermState </summary>
- public abstract BlockTermState NewTermState();
-
- /// <summary>
- /// Actually decode metadata for next term </summary>
- /// <seealso cref= PostingsWriterBase#encodeTerm </seealso>
- public abstract void DecodeTerm(long[] longs, DataInput @in, FieldInfo fieldInfo, BlockTermState state, bool absolute);
-
- /// <summary>
- /// Must fully consume state, since after this call that
- /// TermState may be reused.
- /// </summary>
- public abstract DocsEnum Docs(FieldInfo fieldInfo, BlockTermState state, IBits skipDocs, DocsEnum reuse, DocsFlags flags);
-
- /// <summary>
- /// Must fully consume state, since after this call that
- /// TermState may be reused.
- /// </summary>
- public abstract DocsAndPositionsEnum DocsAndPositions(FieldInfo fieldInfo, BlockTermState state, IBits skipDocs, DocsAndPositionsEnum reuse, DocsAndPositionsFlags flags);
-
- /// <summary>
- /// Returns approximate RAM bytes used </summary>
- public abstract long RamBytesUsed();
-
- /// <summary>
- /// Checks consistency of this reader.
- /// <p>
- /// Note that this may be costly in terms of I/O, e.g.
- /// may involve computing a checksum value against large data files.
- /// @lucene.internal
- /// </summary>
- public abstract void CheckIntegrity();
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- protected abstract void Dispose(bool disposing);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/PostingsWriterBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/PostingsWriterBase.cs b/src/Lucene.Net.Core/Codecs/PostingsWriterBase.cs
deleted file mode 100644
index dfedbda..0000000
--- a/src/Lucene.Net.Core/Codecs/PostingsWriterBase.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-using System;
-
-namespace Lucene.Net.Codecs
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- using DataOutput = Lucene.Net.Store.DataOutput;
- using FieldInfo = Lucene.Net.Index.FieldInfo;
- using IndexOutput = Lucene.Net.Store.IndexOutput;
-
- /// <summary>
- /// Extension of <seealso cref="PostingsConsumer"/> to support pluggable term dictionaries.
- /// <p>
- /// this class contains additional hooks to interact with the provided
- /// term dictionaries such as <seealso cref="BlockTreeTermsWriter"/>. If you want
- /// to re-use an existing implementation and are only interested in
- /// customizing the format of the postings list, extend this class
- /// instead.
- /// </summary>
- /// <seealso cref= PostingsReaderBase
- /// @lucene.experimental </seealso>
- // TODO: find a better name; this defines the API that the
- // terms dict impls use to talk to a postings impl.
- // TermsDict + PostingsReader/WriterBase == PostingsConsumer/Producer
- public abstract class PostingsWriterBase : PostingsConsumer, IDisposable
- {
- /// <summary>
- /// Sole constructor. (For invocation by subclass
- /// constructors, typically implicit.)
- /// </summary>
- protected internal PostingsWriterBase()
- {
- }
-
- /// <summary>
- /// Called once after startup, before any terms have been
- /// added. Implementations typically write a header to
- /// the provided {@code termsOut}.
- /// </summary>
- public abstract void Init(IndexOutput termsOut);
-
- /// <summary>
- /// Return a newly created empty TermState </summary>
- public abstract BlockTermState NewTermState();
-
- /// <summary>
- /// Start a new term. Note that a matching call to {@link
- /// #finishTerm(BlockTermState)} is done, only if the term has at least one
- /// document.
- /// </summary>
- public abstract void StartTerm();
-
- /// <summary>
- /// Finishes the current term. The provided {@link
- /// BlockTermState} contains the term's summary statistics,
- /// and will holds metadata from PBF when returned
- /// </summary>
- public abstract void FinishTerm(BlockTermState state);
-
- /// <summary>
- /// Encode metadata as long[] and byte[]. {@code absolute} controls whether
- /// current term is delta encoded according to latest term.
- /// Usually elements in {@code longs} are file pointers, so each one always
- /// increases when a new term is consumed. {@code out} is used to write generic
- /// bytes, which are not monotonic.
- ///
- /// NOTE: sometimes long[] might contain "don't care" values that are unused, e.g.
- /// the pointer to postings list may not be defined for some terms but is defined
- /// for others, if it is designed to inline some postings data in term dictionary.
- /// In this case, the postings writer should always use the last value, so that each
- /// element in metadata long[] remains monotonic.
- /// </summary>
- public abstract void EncodeTerm(long[] longs, DataOutput @out, FieldInfo fieldInfo, BlockTermState state, bool absolute);
-
- /// <summary>
- /// Sets the current field for writing, and returns the
- /// fixed length of long[] metadata (which is fixed per
- /// field), called when the writing switches to another field.
- /// </summary>
- // TODO: better name?
- public abstract int SetField(FieldInfo fieldInfo);
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- protected abstract void Dispose(bool disposing);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/SegmentInfoFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/SegmentInfoFormat.cs b/src/Lucene.Net.Core/Codecs/SegmentInfoFormat.cs
deleted file mode 100644
index 54f20a6..0000000
--- a/src/Lucene.Net.Core/Codecs/SegmentInfoFormat.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-namespace Lucene.Net.Codecs
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- using SegmentInfo = Lucene.Net.Index.SegmentInfo;
-
- /// <summary>
- /// Expert: Controls the format of the
- /// <seealso cref="SegmentInfo"/> (segment metadata file).
- /// <p>
- /// </summary>
- /// <seealso cref= SegmentInfo
- /// @lucene.experimental </seealso>
- public abstract class SegmentInfoFormat
- {
- /// <summary>
- /// Sole constructor. (For invocation by subclass
- /// constructors, typically implicit.)
- /// </summary>
- protected internal SegmentInfoFormat()
- {
- }
-
- /// <summary>
- /// Returns the <seealso cref="SegmentInfoReader"/> for reading
- /// <seealso cref="SegmentInfo"/> instances.
- /// </summary>
- public abstract SegmentInfoReader SegmentInfoReader { get; }
-
- /// <summary>
- /// Returns the <seealso cref="SegmentInfoWriter"/> for writing
- /// <seealso cref="SegmentInfo"/> instances.
- /// </summary>
- public abstract SegmentInfoWriter SegmentInfoWriter { get; }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/SegmentInfoReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/SegmentInfoReader.cs b/src/Lucene.Net.Core/Codecs/SegmentInfoReader.cs
deleted file mode 100644
index afa8e4e..0000000
--- a/src/Lucene.Net.Core/Codecs/SegmentInfoReader.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-namespace Lucene.Net.Codecs
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- using Directory = Lucene.Net.Store.Directory;
- using IOContext = Lucene.Net.Store.IOContext;
- using SegmentInfo = Lucene.Net.Index.SegmentInfo;
-
- /// <summary>
- /// Specifies an API for classes that can read <seealso cref="SegmentInfo"/> information.
- /// @lucene.experimental
- /// </summary>
-
- public abstract class SegmentInfoReader
- {
- /// <summary>
- /// Sole constructor. (For invocation by subclass
- /// constructors, typically implicit.)
- /// </summary>
- protected internal SegmentInfoReader()
- {
- }
-
- /// <summary>
- /// Read <seealso cref="SegmentInfo"/> data from a directory. </summary>
- /// <param name="directory"> directory to read from </param>
- /// <param name="segmentName"> name of the segment to read </param>
- /// <returns> infos instance to be populated with data </returns>
- /// <exception cref="IOException"> If an I/O error occurs </exception>
- public abstract SegmentInfo Read(Directory directory, string segmentName, IOContext context);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/SegmentInfoWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/SegmentInfoWriter.cs b/src/Lucene.Net.Core/Codecs/SegmentInfoWriter.cs
deleted file mode 100644
index 2ba610a..0000000
--- a/src/Lucene.Net.Core/Codecs/SegmentInfoWriter.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-namespace Lucene.Net.Codecs
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- using Directory = Lucene.Net.Store.Directory;
- using FieldInfos = Lucene.Net.Index.FieldInfos;
- using IOContext = Lucene.Net.Store.IOContext;
- using SegmentInfo = Lucene.Net.Index.SegmentInfo;
-
- /// <summary>
- /// Specifies an API for classes that can write out <seealso cref="SegmentInfo"/> data.
- /// @lucene.experimental
- /// </summary>
-
- public abstract class SegmentInfoWriter
- {
- /// <summary>
- /// Sole constructor. (For invocation by subclass
- /// constructors, typically implicit.)
- /// </summary>
- protected internal SegmentInfoWriter()
- {
- }
-
- /// <summary>
- /// Write <seealso cref="SegmentInfo"/> data. </summary>
- /// <exception cref="IOException"> If an I/O error occurs </exception>
- public abstract void Write(Directory dir, SegmentInfo info, FieldInfos fis, IOContext ioContext);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/StoredFieldsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/StoredFieldsFormat.cs b/src/Lucene.Net.Core/Codecs/StoredFieldsFormat.cs
deleted file mode 100644
index 8db0844..0000000
--- a/src/Lucene.Net.Core/Codecs/StoredFieldsFormat.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-namespace Lucene.Net.Codecs
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- using Directory = Lucene.Net.Store.Directory;
- using FieldInfos = Lucene.Net.Index.FieldInfos;
- using IOContext = Lucene.Net.Store.IOContext;
- using SegmentInfo = Lucene.Net.Index.SegmentInfo;
-
- /// <summary>
- /// Controls the format of stored fields
- /// </summary>
- public abstract class StoredFieldsFormat
- {
- /// <summary>
- /// Sole constructor. (For invocation by subclass
- /// constructors, typically implicit.)
- /// </summary>
- protected internal StoredFieldsFormat()
- {
- }
-
- /// <summary>
- /// Returns a <seealso cref="StoredFieldsReader"/> to load stored
- /// fields.
- /// </summary>
- public abstract StoredFieldsReader FieldsReader(Directory directory, SegmentInfo si, FieldInfos fn, IOContext context);
-
- /// <summary>
- /// Returns a <seealso cref="StoredFieldsWriter"/> to write stored
- /// fields.
- /// </summary>
- public abstract StoredFieldsWriter FieldsWriter(Directory directory, SegmentInfo si, IOContext context);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/StoredFieldsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/StoredFieldsReader.cs b/src/Lucene.Net.Core/Codecs/StoredFieldsReader.cs
deleted file mode 100644
index 5a093b2..0000000
--- a/src/Lucene.Net.Core/Codecs/StoredFieldsReader.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-using System;
-
-namespace Lucene.Net.Codecs
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- using StoredFieldVisitor = Index.StoredFieldVisitor;
-
- /// <summary>
- /// Codec API for reading stored fields.
- ///
- /// You need to implement visitDocument(int, StoredFieldVisitor) to
- /// read the stored fields for a document, implement clone( (creating
- /// clones of any IndexInputs used, etc), and close()
- ///
- /// @lucene.experimental
- /// </summary>
- public abstract class StoredFieldsReader : IDisposable
- {
- /// <summary>
- /// Sole constructor. (For invocation by subclass
- /// constructors, typically implicit.)
- /// </summary>
- protected internal StoredFieldsReader()
- {
- }
-
- /// <summary>
- /// Visit the stored fields for document <code>n</code> </summary>
- public abstract void VisitDocument(int n, StoredFieldVisitor visitor);
-
- public abstract object Clone();
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- protected abstract void Dispose(bool disposing);
-
- /// <summary>
- /// Returns approximate RAM bytes used </summary>
- public abstract long RamBytesUsed();
-
- /// <summary>
- /// Checks consistency of this reader.
- ///
- /// Note that this may be costly in terms of I/O, e.g.
- /// may involve computing a checksum value against large data files.
- /// @lucene.internal
- /// </summary>
- public abstract void CheckIntegrity();
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs b/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs
deleted file mode 100644
index 29ac364..0000000
--- a/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs
+++ /dev/null
@@ -1,164 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Lucene.Net.Codecs
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- using AtomicReader = Lucene.Net.Index.AtomicReader;
- using IBits = Lucene.Net.Util.IBits;
- using Document = Documents.Document;
- using FieldInfo = Lucene.Net.Index.FieldInfo;
- using FieldInfos = Lucene.Net.Index.FieldInfos;
- using IIndexableField = Lucene.Net.Index.IIndexableField;
- using MergeState = Lucene.Net.Index.MergeState;
-
- /// <summary>
- /// Codec API for writing stored fields:
- /// <p>
- /// <ol>
- /// <li>For every document, <seealso cref="#startDocument(int)"/> is called,
- /// informing the Codec how many fields will be written.
- /// <li><seealso cref="#writeField(FieldInfo, IndexableField)"/> is called for
- /// each field in the document.
- /// <li>After all documents have been written, <seealso cref="#finish(FieldInfos, int)"/>
- /// is called for verification/sanity-checks.
- /// <li>Finally the writer is closed (<seealso cref="#close()"/>)
- /// </ol>
- ///
- /// @lucene.experimental
- /// </summary>
- public abstract class StoredFieldsWriter : IDisposable
- {
- /// <summary>
- /// Sole constructor. (For invocation by subclass
- /// constructors, typically implicit.)
- /// </summary>
- protected internal StoredFieldsWriter()
- {
- }
-
- /// <summary>
- /// Called before writing the stored fields of the document.
- /// <seealso cref="#writeField(FieldInfo, IndexableField)"/> will be called
- /// <code>numStoredFields</code> times. Note that this is
- /// called even if the document has no stored fields, in
- /// this case <code>numStoredFields</code> will be zero.
- /// </summary>
- public abstract void StartDocument(int numStoredFields);
-
- /// <summary>
- /// Called when a document and all its fields have been added. </summary>
- public virtual void FinishDocument()
- {
- }
-
- /// <summary>
- /// Writes a single stored field. </summary>
- public abstract void WriteField(FieldInfo info, IIndexableField field);
-
- /// <summary>
- /// Aborts writing entirely, implementation should remove
- /// any partially-written files, etc.
- /// </summary>
- public abstract void Abort();
-
- /// <summary>
- /// Called before <seealso cref="#close()"/>, passing in the number
- /// of documents that were written. Note that this is
- /// intentionally redundant (equivalent to the number of
- /// calls to <seealso cref="#startDocument(int)"/>, but a Codec should
- /// check that this is the case to detect the JRE bug described
- /// in LUCENE-1282.
- /// </summary>
- public abstract void Finish(FieldInfos fis, int numDocs);
-
- /// <summary>
- /// Merges in the stored fields from the readers in
- /// <code>mergeState</code>. The default implementation skips
- /// over deleted documents, and uses <seealso cref="#startDocument(int)"/>,
- /// <seealso cref="#writeField(FieldInfo, IndexableField)"/>, and <seealso cref="#finish(FieldInfos, int)"/>,
- /// returning the number of documents that were written.
- /// Implementations can override this method for more sophisticated
- /// merging (bulk-byte copying, etc).
- /// </summary>
- public virtual int Merge(MergeState mergeState)
- {
- int docCount = 0;
- foreach (AtomicReader reader in mergeState.Readers)
- {
- int maxDoc = reader.MaxDoc;
- IBits liveDocs = reader.LiveDocs;
- for (int i = 0; i < maxDoc; i++)
- {
- if (liveDocs != null && !liveDocs.Get(i))
- {
- // skip deleted docs
- continue;
- }
- // TODO: this could be more efficient using
- // FieldVisitor instead of loading/writing entire
- // doc; ie we just have to renumber the field number
- // on the fly?
- // NOTE: it's very important to first assign to doc then pass it to
- // fieldsWriter.addDocument; see LUCENE-1282
- Document doc = reader.Document(i);
- AddDocument(doc, mergeState.FieldInfos);
- docCount++;
- mergeState.CheckAbort.Work(300);
- }
- }
- Finish(mergeState.FieldInfos, docCount);
- return docCount;
- }
-
- /// <summary>
- /// sugar method for startDocument() + writeField() for every stored field in the document </summary>
- protected void AddDocument<T1>(IEnumerable<T1> doc, FieldInfos fieldInfos) where T1 : Lucene.Net.Index.IIndexableField
- {
- int storedCount = 0;
- foreach (IIndexableField field in doc)
- {
- if (field.FieldType.IsStored)
- {
- storedCount++;
- }
- }
-
- StartDocument(storedCount);
-
- foreach (IIndexableField field in doc)
- {
- if (field.FieldType.IsStored)
- {
- WriteField(fieldInfos.FieldInfo(field.Name), field);
- }
- }
-
- FinishDocument();
- }
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- protected abstract void Dispose(bool disposing);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/TermStats.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/TermStats.cs b/src/Lucene.Net.Core/Codecs/TermStats.cs
deleted file mode 100644
index 9481a6c..0000000
--- a/src/Lucene.Net.Core/Codecs/TermStats.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-namespace Lucene.Net.Codecs
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- // javadocs
-
- /// <summary>
- /// Holder for per-term statistics.
- /// </summary>
- /// <seealso cref= TermsEnum#docFreq </seealso>
- /// <seealso cref= TermsEnum#totalTermFreq </seealso>
- public class TermStats
- {
- /// <summary>
- /// How many documents have at least one occurrence of
- /// this term.
- /// </summary>
- public int DocFreq { get; private set; }
-
- /// <summary>
- /// Total number of times this term occurs across all
- /// documents in the field.
- /// </summary>
- public long TotalTermFreq { get; private set; }
-
- /// <summary>
- /// Sole constructor. </summary>
- public TermStats(int docFreq, long totalTermFreq)
- {
- this.DocFreq = docFreq;
- this.TotalTermFreq = totalTermFreq;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/TermVectorsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/TermVectorsFormat.cs b/src/Lucene.Net.Core/Codecs/TermVectorsFormat.cs
deleted file mode 100644
index 84cef97..0000000
--- a/src/Lucene.Net.Core/Codecs/TermVectorsFormat.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-namespace Lucene.Net.Codecs
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- using Directory = Lucene.Net.Store.Directory;
- using FieldInfos = Lucene.Net.Index.FieldInfos;
- using IOContext = Lucene.Net.Store.IOContext;
- using SegmentInfo = Lucene.Net.Index.SegmentInfo;
-
- /// <summary>
- /// Controls the format of term vectors
- /// </summary>
- public abstract class TermVectorsFormat
- {
- /// <summary>
- /// Sole constructor. (For invocation by subclass
- /// constructors, typically implicit.)
- /// </summary>
- protected internal TermVectorsFormat()
- {
- }
-
- /// <summary>
- /// Returns a <seealso cref="TermVectorsReader"/> to read term
- /// vectors.
- /// </summary>
- public abstract TermVectorsReader VectorsReader(Directory directory, SegmentInfo segmentInfo, FieldInfos fieldInfos, IOContext context);
-
- /// <summary>
- /// Returns a <seealso cref="TermVectorsWriter"/> to write term
- /// vectors.
- /// </summary>
- public abstract TermVectorsWriter VectorsWriter(Directory directory, SegmentInfo segmentInfo, IOContext context);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a5dc68d0/src/Lucene.Net.Core/Codecs/TermVectorsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/TermVectorsReader.cs b/src/Lucene.Net.Core/Codecs/TermVectorsReader.cs
deleted file mode 100644
index c106b7b..0000000
--- a/src/Lucene.Net.Core/Codecs/TermVectorsReader.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-using System;
-
-namespace Lucene.Net.Codecs
-{
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- using DocsAndPositionsEnum = Lucene.Net.Index.DocsAndPositionsEnum; // javadocs
- using Fields = Lucene.Net.Index.Fields;
- using OffsetAttribute = Lucene.Net.Analysis.TokenAttributes.OffsetAttribute; // javadocs
-
- /// <summary>
- /// Codec API for reading term vectors:
- ///
- /// @lucene.experimental
- /// </summary>
- public abstract class TermVectorsReader : IDisposable
- {
- /// <summary>
- /// Sole constructor. (For invocation by subclass
- /// constructors, typically implicit.)
- /// </summary>
- protected internal TermVectorsReader()
- {
- }
-
- /// <summary>
- /// Returns term vectors for this document, or null if
- /// term vectors were not indexed. If offsets are
- /// available they are in an <seealso cref="OffsetAttribute"/>
- /// available from the <seealso cref="DocsAndPositionsEnum"/>.
- /// </summary>
- public abstract Fields Get(int doc);
-
- /// <summary>
- /// Returns approximate RAM bytes used </summary>
- public abstract long RamBytesUsed();
-
- /// <summary>
- /// Checks consistency of this reader.
- /// <p>
- /// Note that this may be costly in terms of I/O, e.g.
- /// may involve computing a checksum value against large data files.
- /// @lucene.internal
- /// </summary>
- public abstract void CheckIntegrity();
-
- /// <summary>
- /// Create a clone that one caller at a time may use to
- /// read term vectors.
- /// </summary>
- public abstract object Clone();
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- protected abstract void Dispose(bool disposing);
- }
-}
\ No newline at end of file