http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.TestFramework/Codecs/lucene42/Lucene42DocValuesConsumer.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Codecs/lucene42/Lucene42DocValuesConsumer.cs b/src/Lucene.Net.TestFramework/Codecs/lucene42/Lucene42DocValuesConsumer.cs index 678d381..7441346 100644 --- a/src/Lucene.Net.TestFramework/Codecs/lucene42/Lucene42DocValuesConsumer.cs +++ b/src/Lucene.Net.TestFramework/Codecs/lucene42/Lucene42DocValuesConsumer.cs @@ -30,16 +30,16 @@ namespace Lucene.Net.Codecs.Lucene42 */ using FieldInfo = Lucene.Net.Index.FieldInfo; - using FormatAndBits = Lucene.Net.Util.Packed.PackedInts.FormatAndBits; + using FormatAndBits = Lucene.Net.Util.Packed.PackedInt32s.FormatAndBits; using IndexFileNames = Lucene.Net.Index.IndexFileNames; using IndexOutput = Lucene.Net.Store.IndexOutput; using INPUT_TYPE = Lucene.Net.Util.Fst.FST.INPUT_TYPE; - using IntsRef = Lucene.Net.Util.IntsRef; + using Int32sRef = Lucene.Net.Util.Int32sRef; using IOUtils = Lucene.Net.Util.IOUtils; using MathUtil = Lucene.Net.Util.MathUtil; using MonotonicBlockPackedWriter = Lucene.Net.Util.Packed.MonotonicBlockPackedWriter; - using PackedInts = Lucene.Net.Util.Packed.PackedInts; - using PositiveIntOutputs = Lucene.Net.Util.Fst.PositiveIntOutputs; + using PackedInt32s = Lucene.Net.Util.Packed.PackedInt32s; + using PositiveInt32Outputs = Lucene.Net.Util.Fst.PositiveInt32Outputs; using SegmentWriteState = Lucene.Net.Index.SegmentWriteState; using Util = Lucene.Net.Util.Fst.Util; @@ -142,8 +142,8 @@ namespace Lucene.Net.Codecs.Lucene42 if (uniqueValues != null) { // small number of unique values - int bitsPerValue = PackedInts.BitsRequired(uniqueValues.Count - 1); - FormatAndBits formatAndBits = PackedInts.FastestFormatAndBits(MaxDoc, bitsPerValue, AcceptableOverheadRatio); + int bitsPerValue = PackedInt32s.BitsRequired(uniqueValues.Count - 1); + FormatAndBits formatAndBits = PackedInt32s.FastestFormatAndBits(MaxDoc, bitsPerValue, AcceptableOverheadRatio); if (formatAndBits.BitsPerValue == 8 && minValue >= sbyte.MinValue && maxValue <= sbyte.MaxValue) { Meta.WriteByte((byte)Lucene42DocValuesProducer.UNCOMPRESSED); // uncompressed @@ -164,11 +164,11 @@ namespace Lucene.Net.Codecs.Lucene42 encode[decode[i]] = i; } - Meta.WriteVInt32(PackedInts.VERSION_CURRENT); + Meta.WriteVInt32(PackedInt32s.VERSION_CURRENT); Data.WriteVInt32(formatAndBits.Format.Id); Data.WriteVInt32(formatAndBits.BitsPerValue); - PackedInts.Writer writer = PackedInts.GetWriterNoHeader(Data, formatAndBits.Format, MaxDoc, formatAndBits.BitsPerValue, PackedInts.DEFAULT_BUFFER_SIZE); + PackedInt32s.Writer writer = PackedInt32s.GetWriterNoHeader(Data, formatAndBits.Format, MaxDoc, formatAndBits.BitsPerValue, PackedInt32s.DEFAULT_BUFFER_SIZE); foreach (long? nv in values) { writer.Add(encode[nv == null ? 0 : (long)nv]); @@ -179,7 +179,7 @@ namespace Lucene.Net.Codecs.Lucene42 else if (gcd != 0 && gcd != 1) { Meta.WriteByte((byte)Lucene42DocValuesProducer.GCD_COMPRESSED); - Meta.WriteVInt32(PackedInts.VERSION_CURRENT); + Meta.WriteVInt32(PackedInt32s.VERSION_CURRENT); Data.WriteInt64(minValue); Data.WriteInt64(gcd); Data.WriteVInt32(Lucene42DocValuesProducer.BLOCK_SIZE); @@ -196,7 +196,7 @@ namespace Lucene.Net.Codecs.Lucene42 { Meta.WriteByte((byte)Lucene42DocValuesProducer.DELTA_COMPRESSED); // delta-compressed - Meta.WriteVInt32(PackedInts.VERSION_CURRENT); + Meta.WriteVInt32(PackedInt32s.VERSION_CURRENT); Data.WriteVInt32(Lucene42DocValuesProducer.BLOCK_SIZE); BlockPackedWriter writer = new BlockPackedWriter(Data, Lucene42DocValuesProducer.BLOCK_SIZE); @@ -266,7 +266,7 @@ namespace Lucene.Net.Codecs.Lucene42 // otherwise, we need to record the length fields... if (minLength != maxLength) { - Meta.WriteVInt32(PackedInts.VERSION_CURRENT); + Meta.WriteVInt32(PackedInt32s.VERSION_CURRENT); Meta.WriteVInt32(Lucene42DocValuesProducer.BLOCK_SIZE); MonotonicBlockPackedWriter writer = new MonotonicBlockPackedWriter(Data, Lucene42DocValuesProducer.BLOCK_SIZE); @@ -288,9 +288,9 @@ namespace Lucene.Net.Codecs.Lucene42 Meta.WriteVInt32(field.Number); Meta.WriteByte((byte)Lucene42DocValuesProducer.FST); Meta.WriteInt64(Data.FilePointer); - PositiveIntOutputs outputs = PositiveIntOutputs.Singleton; + PositiveInt32Outputs outputs = PositiveInt32Outputs.Singleton; Builder<long?> builder = new Builder<long?>(INPUT_TYPE.BYTE1, outputs); - IntsRef scratch = new IntsRef(); + Int32sRef scratch = new Int32sRef(); long ord = 0; foreach (BytesRef v in values) {
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.TestFramework/Codecs/ramonly/RAMOnlyPostingsFormat.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Codecs/ramonly/RAMOnlyPostingsFormat.cs b/src/Lucene.Net.TestFramework/Codecs/ramonly/RAMOnlyPostingsFormat.cs index 7cfddf4..2a10d2b 100644 --- a/src/Lucene.Net.TestFramework/Codecs/ramonly/RAMOnlyPostingsFormat.cs +++ b/src/Lucene.Net.TestFramework/Codecs/ramonly/RAMOnlyPostingsFormat.cs @@ -651,7 +651,7 @@ namespace Lucene.Net.Codecs.ramonly // Holds all indexes created, keyed by the ID assigned in fieldsConsumer private readonly IDictionary<int?, RAMPostings> State = new Dictionary<int?, RAMPostings>(); - private readonly AtomicLong NextID = new AtomicLong(); + private readonly AtomicInt64 NextID = new AtomicInt64(); private readonly string RAM_ONLY_NAME = "RAMOnly"; private const int VERSION_START = 0; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.TestFramework/Index/BaseCompressingDocValuesFormatTestCase.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Index/BaseCompressingDocValuesFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseCompressingDocValuesFormatTestCase.cs index e0e7047..cf93d33 100644 --- a/src/Lucene.Net.TestFramework/Index/BaseCompressingDocValuesFormatTestCase.cs +++ b/src/Lucene.Net.TestFramework/Index/BaseCompressingDocValuesFormatTestCase.cs @@ -27,7 +27,7 @@ namespace Lucene.Net.Index using MockAnalyzer = Lucene.Net.Analysis.MockAnalyzer; using NumericDocValuesField = NumericDocValuesField; - using PackedInts = Lucene.Net.Util.Packed.PackedInts; + using PackedInt32s = Lucene.Net.Util.Packed.PackedInt32s; using RAMDirectory = Lucene.Net.Store.RAMDirectory; using TestUtil = Lucene.Net.Util.TestUtil; @@ -114,7 +114,7 @@ namespace Lucene.Net.Index iwriter.ForceMerge(1); long size2 = DirSize(dir); // make sure the new longs costed less than if they had only been packed - Assert.IsTrue(size2 < size1 + (PackedInts.BitsRequired(day) * 50) / 8); + Assert.IsTrue(size2 < size1 + (PackedInt32s.BitsRequired(day) * 50) / 8); } // [Test] // LUCENENET NOTE: For now, we are overriding this test in every subclass to pull it into the right context for the subclass http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs index accdbbe..07a7970 100644 --- a/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs +++ b/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs @@ -38,7 +38,7 @@ namespace Lucene.Net.Index using Directory = Lucene.Net.Store.Directory; using Document = Documents.Document; using Field = Field; - using FloatDocValuesField = FloatDocValuesField; + using SingleDocValuesField = SingleDocValuesField; using IndexSearcher = Lucene.Net.Search.IndexSearcher; using Lucene42DocValuesFormat = Lucene.Net.Codecs.Lucene42.Lucene42DocValuesFormat; using MockAnalyzer = Lucene.Net.Analysis.MockAnalyzer; @@ -128,7 +128,7 @@ namespace Lucene.Net.Index string longTerm = "longtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongterm"; string text = "this is the text to be indexed. " + longTerm; doc.Add(NewTextField("fieldname", text, Field.Store.YES)); - doc.Add(new FloatDocValuesField("dv", 5.7f)); + doc.Add(new SingleDocValuesField("dv", 5.7f)); iwriter.AddDocument(doc); iwriter.Dispose(); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs index d7a414e..30ee047 100644 --- a/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs +++ b/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs @@ -23,10 +23,10 @@ namespace Lucene.Net.Index using DoubleField = DoubleField; using Field = Field; using FieldType = FieldType; - using FloatField = FloatField; + using SingleField = SingleField; using IndexSearcher = Lucene.Net.Search.IndexSearcher; - using IntField = IntField; - using LongField = LongField; + using Int32Field = Int32Field; + using Int64Field = Int64Field; using Lucene46Codec = Lucene.Net.Codecs.Lucene46.Lucene46Codec; using MMapDirectory = Lucene.Net.Store.MMapDirectory; @@ -284,7 +284,7 @@ namespace Lucene.Net.Index { float f = Random().NextFloat(); answer = Convert.ToSingle(f); - nf = new FloatField("nf", f, Field.Store.NO); + nf = new SingleField("nf", f, Field.Store.NO); sf = new StoredField("nf", f); typeAnswer = NumericType.FLOAT; } @@ -304,7 +304,7 @@ namespace Lucene.Net.Index { int i = Random().Next(); answer = Convert.ToInt32(i); - nf = new IntField("nf", i, Field.Store.NO); + nf = new Int32Field("nf", i, Field.Store.NO); sf = new StoredField("nf", i); typeAnswer = NumericType.INT; } @@ -312,7 +312,7 @@ namespace Lucene.Net.Index { long l = Random().NextLong(); answer = Convert.ToInt64(l); - nf = new LongField("nf", l, Field.Store.NO); + nf = new Int64Field("nf", l, Field.Store.NO); sf = new StoredField("nf", l); typeAnswer = NumericType.LONG; } @@ -321,9 +321,9 @@ namespace Lucene.Net.Index doc.Add(sf); answers[id] = answer; typeAnswers[id] = typeAnswer; - FieldType ft = new FieldType(IntField.TYPE_STORED); + FieldType ft = new FieldType(Int32Field.TYPE_STORED); ft.NumericPrecisionStep = int.MaxValue; - doc.Add(new IntField("id", id, ft)); + doc.Add(new Int32Field("id", id, ft)); w.AddDocument(doc); } DirectoryReader r = w.Reader; @@ -334,7 +334,7 @@ namespace Lucene.Net.Index foreach (AtomicReaderContext ctx in r.Leaves) { AtomicReader sub = (AtomicReader)ctx.Reader; - FieldCache.Ints ids = FieldCache.DEFAULT.GetInt32s(sub, "id", false); + FieldCache.Int32s ids = FieldCache.DEFAULT.GetInt32s(sub, "id", false); for (int docID = 0; docID < sub.NumDocs; docID++) { Document doc = sub.Document(docID); @@ -385,7 +385,7 @@ namespace Lucene.Net.Index float f = Random().NextFloat(); double d = Random().NextDouble(); - IList<Field> fields = Arrays.AsList(new Field("bytes", bytes, ft), new Field("string", @string, ft), new LongField("long", l, Field.Store.YES), new IntField("int", i, Field.Store.YES), new FloatField("float", f, Field.Store.YES), new DoubleField("double", d, Field.Store.YES) + IList<Field> fields = Arrays.AsList(new Field("bytes", bytes, ft), new Field("string", @string, ft), new Int64Field("long", l, Field.Store.YES), new Int32Field("int", i, Field.Store.YES), new SingleField("float", f, Field.Store.YES), new DoubleField("double", d, Field.Store.YES) ); for (int k = 0; k < 100; ++k) @@ -600,7 +600,7 @@ namespace Lucene.Net.Index FieldType type = new FieldType(StringField.TYPE_STORED); type.IsIndexed = false; type.Freeze(); - IntField id = new IntField("id", 0, Field.Store.YES); + Int32Field id = new Int32Field("id", 0, Field.Store.YES); for (int i = 0; i < data.Length; ++i) { Document doc = new Document(); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs b/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs index e3ccfb6..f2ee00b 100644 --- a/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs +++ b/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs @@ -64,9 +64,9 @@ namespace Lucene.Net.Index public abstract class ThreadedIndexingAndSearchingTestCase : LuceneTestCase { protected internal readonly AtomicBoolean Failed = new AtomicBoolean(); - protected internal readonly AtomicInteger AddCount = new AtomicInteger(); - protected internal readonly AtomicInteger DelCount = new AtomicInteger(); - protected internal readonly AtomicInteger PackCount = new AtomicInteger(); + protected internal readonly AtomicInt32 AddCount = new AtomicInt32(); + protected internal readonly AtomicInt32 DelCount = new AtomicInt32(); + protected internal readonly AtomicInt32 PackCount = new AtomicInt32(); protected internal Directory Dir; protected internal IndexWriter Writer; @@ -396,10 +396,10 @@ namespace Lucene.Net.Index { int numThreads = TestUtil.NextInt(Random(), 1, 5); ThreadClass[] searchThreads = new ThreadClass[numThreads]; - AtomicInteger totHits = new AtomicInteger(); + AtomicInt32 totHits = new AtomicInt32(); // silly starting guess: - AtomicInteger totTermCount = new AtomicInteger(100); + AtomicInt32 totTermCount = new AtomicInt32(100); // TODO: we should enrich this to do more interesting searches for (int thread = 0; thread < searchThreads.Length; thread++) @@ -425,10 +425,10 @@ namespace Lucene.Net.Index private readonly ThreadedIndexingAndSearchingTestCase OuterInstance; private DateTime StopTime; - private AtomicInteger TotHits; - private AtomicInteger TotTermCount; + private AtomicInt32 TotHits; + private AtomicInt32 TotTermCount; - public ThreadAnonymousInnerClassHelper2(ThreadedIndexingAndSearchingTestCase outerInstance, DateTime stopTime, AtomicInteger totHits, AtomicInteger totTermCount) + public ThreadAnonymousInnerClassHelper2(ThreadedIndexingAndSearchingTestCase outerInstance, DateTime stopTime, AtomicInt32 totHits, AtomicInt32 totTermCount) { this.OuterInstance = outerInstance; this.StopTime = stopTime; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs b/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs index 4064635..a287adc 100644 --- a/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs +++ b/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs @@ -80,7 +80,7 @@ namespace Lucene.Net.Store private Throttling_e throttling = Throttling_e.SOMETIMES; protected internal LockFactory LockFactory_Renamed; - internal readonly AtomicLong InputCloneCount_Renamed = new AtomicLong(); + internal readonly AtomicInt64 InputCloneCount_Renamed = new AtomicInt64(); // use this for tracking files for crash. // additionally: provides debugging information in case you leave one open http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.TestFramework/Util/LineFileDocs.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Util/LineFileDocs.cs b/src/Lucene.Net.TestFramework/Util/LineFileDocs.cs index 34abd32..0b71ef0 100644 --- a/src/Lucene.Net.TestFramework/Util/LineFileDocs.cs +++ b/src/Lucene.Net.TestFramework/Util/LineFileDocs.cs @@ -43,7 +43,7 @@ namespace Lucene.Net.Util { private TextReader Reader; //private static readonly int BUFFER_SIZE = 1 << 16; // 64K // LUCENENET NOTE: Not used because we don't have a BufferedReader in .NET - private readonly AtomicInteger Id = new AtomicInteger(); + private readonly AtomicInt32 Id = new AtomicInt32(); private readonly string Path; private readonly bool UseDocValues; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.TestFramework/Util/TestUtil.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Util/TestUtil.cs b/src/Lucene.Net.TestFramework/Util/TestUtil.cs index dd3285a..7fee1f9 100644 --- a/src/Lucene.Net.TestFramework/Util/TestUtil.cs +++ b/src/Lucene.Net.TestFramework/Util/TestUtil.cs @@ -53,13 +53,13 @@ namespace Lucene.Net.Util using FieldDoc = Lucene.Net.Search.FieldDoc; using FieldType = FieldType; using FilteredQuery = Lucene.Net.Search.FilteredQuery; - using FloatField = FloatField; + using SingleField = SingleField; using IIndexableField = Lucene.Net.Index.IIndexableField; using IndexReader = Lucene.Net.Index.IndexReader; using IndexWriter = Lucene.Net.Index.IndexWriter; - using IntField = IntField; + using Int32Field = Int32Field; using LogMergePolicy = Lucene.Net.Index.LogMergePolicy; - using LongField = LongField; + using Int64Field = Int64Field; using Lucene46Codec = Lucene.Net.Codecs.Lucene46.Lucene46Codec; using MergePolicy = Lucene.Net.Index.MergePolicy; using MergeScheduler = Lucene.Net.Index.MergeScheduler; @@ -1059,15 +1059,15 @@ namespace Lucene.Net.Util switch (numType) { case NumericType.INT: - field2 = new IntField(field1.Name, (int)field1.GetNumericValue(), (FieldType)field1.FieldType); + field2 = new Int32Field(field1.Name, (int)field1.GetNumericValue(), (FieldType)field1.FieldType); break; case NumericType.FLOAT: - field2 = new FloatField(field1.Name, (int)field1.GetNumericValue(), (FieldType)field1.FieldType); + field2 = new SingleField(field1.Name, (int)field1.GetNumericValue(), (FieldType)field1.FieldType); break; case NumericType.LONG: - field2 = new LongField(field1.Name, (int)field1.GetNumericValue(), (FieldType)field1.FieldType); + field2 = new Int64Field(field1.Name, (int)field1.GetNumericValue(), (FieldType)field1.FieldType); break; case NumericType.DOUBLE: http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.TestFramework/Util/fst/FSTTester.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Util/fst/FSTTester.cs b/src/Lucene.Net.TestFramework/Util/fst/FSTTester.cs index 7889b94..46c6f61 100644 --- a/src/Lucene.Net.TestFramework/Util/fst/FSTTester.cs +++ b/src/Lucene.Net.TestFramework/Util/fst/FSTTester.cs @@ -32,7 +32,7 @@ namespace Lucene.Net.Util.Fst using IndexInput = Lucene.Net.Store.IndexInput; using IndexOutput = Lucene.Net.Store.IndexOutput; using IOContext = Lucene.Net.Store.IOContext; - using PackedInts = Lucene.Net.Util.Packed.PackedInts; + using PackedInt32s = Lucene.Net.Util.Packed.PackedInt32s; /// <summary> /// Helper class to test FSTs. </summary> @@ -55,12 +55,12 @@ namespace Lucene.Net.Util.Fst this.DoReverseLookup = doReverseLookup; } - internal static string InputToString(int inputMode, IntsRef term) + internal static string InputToString(int inputMode, Int32sRef term) { return InputToString(inputMode, term, true); } - internal static string InputToString(int inputMode, IntsRef term, bool isValidUnicode) + internal static string InputToString(int inputMode, Int32sRef term, bool isValidUnicode) { if (!isValidUnicode) { @@ -78,7 +78,7 @@ namespace Lucene.Net.Util.Fst } } - private static BytesRef ToBytesRef(IntsRef ir) + private static BytesRef ToBytesRef(Int32sRef ir) { BytesRef br = new BytesRef(ir.Length); for (int i = 0; i < ir.Length; i++) @@ -124,12 +124,12 @@ namespace Lucene.Net.Util.Fst return new string(buffer, 0, end); } - internal static IntsRef ToIntsRef(string s, int inputMode) + internal static Int32sRef ToIntsRef(string s, int inputMode) { - return ToIntsRef(s, inputMode, new IntsRef(10)); + return ToIntsRef(s, inputMode, new Int32sRef(10)); } - internal static IntsRef ToIntsRef(string s, int inputMode, IntsRef ir) + internal static Int32sRef ToIntsRef(string s, int inputMode, Int32sRef ir) { if (inputMode == 0) { @@ -143,7 +143,7 @@ namespace Lucene.Net.Util.Fst } } - internal static IntsRef ToIntsRefUTF32(string s, IntsRef ir) + internal static Int32sRef ToIntsRefUTF32(string s, Int32sRef ir) { int charLength = s.Length; int charIdx = 0; @@ -163,7 +163,7 @@ namespace Lucene.Net.Util.Fst return ir; } - internal static IntsRef ToIntsRef(BytesRef br, IntsRef ir) + internal static Int32sRef ToIntsRef(BytesRef br, Int32sRef ir) { if (br.Length > ir.Int32s.Length) { @@ -181,10 +181,10 @@ namespace Lucene.Net.Util.Fst /// Holds one input/output pair. </summary> public class InputOutput<T1> : IComparable<InputOutput<T1>> { - public readonly IntsRef Input; + public readonly Int32sRef Input; public readonly T1 Output; - public InputOutput(IntsRef input, T1 output) + public InputOutput(Int32sRef input, T1 output) { this.Input = input; this.Output = output; @@ -215,7 +215,7 @@ namespace Lucene.Net.Util.Fst // isn't accepted. if prefixLength is non-null it must be // length 1 int array; prefixLength[0] is set to the length // of the term prefix that matches - private T Run(FST<T> fst, IntsRef term, int[] prefixLength) + private T Run(FST<T> fst, Int32sRef term, int[] prefixLength) { Debug.Assert(prefixLength == null || prefixLength.Length == 1); FST.Arc<T> arc = fst.GetFirstArc(new FST.Arc<T>()); @@ -259,7 +259,7 @@ namespace Lucene.Net.Util.Fst return output; } - private T RandomAcceptedWord(FST<T> fst, IntsRef @in) + private T RandomAcceptedWord(FST<T> fst, Int32sRef @in) { FST.Arc<T> arc = fst.GetFirstArc(new FST.Arc<T>()); @@ -321,7 +321,7 @@ namespace Lucene.Net.Util.Fst Outputs, null, willRewrite, - PackedInts.DEFAULT, + PackedInt32s.DEFAULT, true, 15); if (LuceneTestCase.VERBOSE) @@ -470,10 +470,10 @@ namespace Lucene.Net.Util.Fst Console.WriteLine("TEST: check valid terms/next()"); } { - IntsRefFSTEnum<T> fstEnum = new IntsRefFSTEnum<T>(fst); + Int32sRefFSTEnum<T> fstEnum = new Int32sRefFSTEnum<T>(fst); foreach (InputOutput<T> pair in Pairs) { - IntsRef term = pair.Input; + Int32sRef term = pair.Input; if (LuceneTestCase.VERBOSE) { Console.WriteLine("TEST: check term=" + InputToString(inputMode, term) + " output=" + fst.Outputs.OutputToString(pair.Output)); @@ -483,7 +483,7 @@ namespace Lucene.Net.Util.Fst Assert.IsTrue(OutputsEqual(pair.Output, output)); // verify enum's next - IntsRefFSTEnum.InputOutput<T> t = fstEnum.Next(); + Int32sRefFSTEnum.InputOutput<T> t = fstEnum.Next(); Assert.IsNotNull(t); Assert.AreEqual(term, t.Input, "expected input=" + InputToString(inputMode, term) + " but fstEnum returned " + InputToString(inputMode, t.Input)); Assert.IsTrue(OutputsEqual(pair.Output, t.Output)); @@ -491,7 +491,7 @@ namespace Lucene.Net.Util.Fst Assert.IsNull(fstEnum.Next()); } - IDictionary<IntsRef, T> termsMap = new Dictionary<IntsRef, T>(); + IDictionary<Int32sRef, T> termsMap = new Dictionary<Int32sRef, T>(); foreach (InputOutput<T> pair in Pairs) { termsMap[pair.Input] = pair.Output; @@ -508,7 +508,7 @@ namespace Lucene.Net.Util.Fst for (int iter = 0; iter < num; iter++) { long v = TestUtil.NextLong(Random, minLong, maxLong); - IntsRef input = Util.GetByOutput(fstLong, v); + Int32sRef input = Util.GetByOutput(fstLong, v); Assert.IsTrue(validOutputs.Contains(v) || input == null); } } @@ -518,7 +518,7 @@ namespace Lucene.Net.Util.Fst { Console.WriteLine("TEST: verify random accepted terms"); } - IntsRef scratch = new IntsRef(10); + Int32sRef scratch = new Int32sRef(10); int num_ = LuceneTestCase.AtLeast(Random, 500); for (int iter = 0; iter < num_; iter++) { @@ -529,7 +529,7 @@ namespace Lucene.Net.Util.Fst if (DoReverseLookup) { //System.out.println("lookup output=" + output + " outs=" + fst.Outputs); - IntsRef input = Util.GetByOutput(fstLong, (output as long?).Value); + Int32sRef input = Util.GetByOutput(fstLong, (output as long?).Value); Assert.IsNotNull(input); //System.out.println(" got " + Util.toBytesRef(input, new BytesRef()).utf8ToString()); Assert.AreEqual(scratch, input); @@ -541,7 +541,7 @@ namespace Lucene.Net.Util.Fst { Console.WriteLine("TEST: verify seek"); } - IntsRefFSTEnum<T> fstEnum_ = new IntsRefFSTEnum<T>(fst); + Int32sRefFSTEnum<T> fstEnum_ = new Int32sRefFSTEnum<T>(fst); num_ = LuceneTestCase.AtLeast(Random, 100); for (int iter = 0; iter < num_; iter++) { @@ -554,14 +554,14 @@ namespace Lucene.Net.Util.Fst // seek to term that doesn't exist: while (true) { - IntsRef term = ToIntsRef(GetRandomString(Random), inputMode); + Int32sRef term = ToIntsRef(GetRandomString(Random), inputMode); int pos = Pairs.BinarySearch(new InputOutput<T>(term, default(T))); if (pos < 0) { pos = -(pos + 1); // ok doesn't exist //System.out.println(" seek " + inputToString(inputMode, term)); - IntsRefFSTEnum.InputOutput<T> seekResult; + Int32sRefFSTEnum.InputOutput<T> seekResult; if (Random.Next(3) == 0) { if (LuceneTestCase.VERBOSE) @@ -619,7 +619,7 @@ namespace Lucene.Net.Util.Fst { // seek to term that does exist: InputOutput<T> pair = Pairs[Random.Next(Pairs.Count)]; - IntsRefFSTEnum.InputOutput<T> seekResult; + Int32sRefFSTEnum.InputOutput<T> seekResult; if (Random.Next(3) == 2) { if (LuceneTestCase.VERBOSE) @@ -664,7 +664,7 @@ namespace Lucene.Net.Util.Fst Console.WriteLine("TEST: iter " + iter); } // reset: - fstEnum_ = new IntsRefFSTEnum<T>(fst); + fstEnum_ = new Int32sRefFSTEnum<T>(fst); int upto = -1; while (true) { @@ -684,7 +684,7 @@ namespace Lucene.Net.Util.Fst int attempt = 0; for (; attempt < 10; attempt++) { - IntsRef term = ToIntsRef(GetRandomString(Random), inputMode); + Int32sRef term = ToIntsRef(GetRandomString(Random), inputMode); if (!termsMap.ContainsKey(term) && term.CompareTo(Pairs[upto].Input) > 0) { int pos = Pairs.BinarySearch(new InputOutput<T>(term, default(T))); @@ -820,8 +820,8 @@ namespace Lucene.Net.Util.Fst //System.out.println("TEST: tally prefixes"); // build all prefixes - IDictionary<IntsRef, CountMinOutput<T>> prefixes = new HashMap<IntsRef, CountMinOutput<T>>(); - IntsRef scratch = new IntsRef(10); + IDictionary<Int32sRef, CountMinOutput<T>> prefixes = new HashMap<Int32sRef, CountMinOutput<T>>(); + Int32sRef scratch = new Int32sRef(10); foreach (InputOutput<T> pair in Pairs) { scratch.CopyInt32s(pair.Input); @@ -834,7 +834,7 @@ namespace Lucene.Net.Util.Fst cmo = new CountMinOutput<T>(); cmo.Count = 1; cmo.Output = pair.Output; - prefixes[IntsRef.DeepCopyOf(scratch)] = cmo; + prefixes[Int32sRef.DeepCopyOf(scratch)] = cmo; } else { @@ -870,8 +870,8 @@ namespace Lucene.Net.Util.Fst // in .NET you cannot delete records while enumerating forward through a dictionary. for (int i = prefixes.Count - 1; i >= 0; i--) { - KeyValuePair<IntsRef, CountMinOutput<T>> ent = prefixes.ElementAt(i); - IntsRef prefix = ent.Key; + KeyValuePair<Int32sRef, CountMinOutput<T>> ent = prefixes.ElementAt(i); + Int32sRef prefix = ent.Key; CountMinOutput<T> cmo = ent.Value; if (LuceneTestCase.VERBOSE) { @@ -935,7 +935,7 @@ namespace Lucene.Net.Util.Fst if (LuceneTestCase.VERBOSE) { Console.WriteLine("TEST: after prune"); - foreach (KeyValuePair<IntsRef, CountMinOutput<T>> ent in prefixes) + foreach (KeyValuePair<Int32sRef, CountMinOutput<T>> ent in prefixes) { Console.WriteLine(" " + InputToString(inputMode, ent.Key, false) + ": isLeaf=" + ent.Value.IsLeaf + " isFinal=" + ent.Value.IsFinal); if (ent.Value.IsFinal) @@ -958,8 +958,8 @@ namespace Lucene.Net.Util.Fst { Console.WriteLine("TEST: check pruned enum"); } - IntsRefFSTEnum<T> fstEnum = new IntsRefFSTEnum<T>(fst); - IntsRefFSTEnum.InputOutput<T> current; + Int32sRefFSTEnum<T> fstEnum = new Int32sRefFSTEnum<T>(fst); + Int32sRefFSTEnum.InputOutput<T> current; while ((current = fstEnum.Next()) != null) { if (LuceneTestCase.VERBOSE) @@ -986,7 +986,7 @@ namespace Lucene.Net.Util.Fst Console.WriteLine("TEST: verify all prefixes"); } int[] stopNode = new int[1]; - foreach (KeyValuePair<IntsRef, CountMinOutput<T>> ent in prefixes) + foreach (KeyValuePair<Int32sRef, CountMinOutput<T>> ent in prefixes) { if (ent.Key.Length > 0) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestDictionary.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestDictionary.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestDictionary.cs index ec404cf..44bc82e 100644 --- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestDictionary.cs +++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestDictionary.cs @@ -40,7 +40,7 @@ namespace Lucene.Net.Analysis.Hunspell Dictionary dictionary = new Dictionary(affixStream, dictStream); assertEquals(3, dictionary.LookupSuffix(new char[] { 'e' }, 0, 1).Length); assertEquals(1, dictionary.LookupPrefix(new char[] { 's' }, 0, 1).Length); - IntsRef ordList = dictionary.LookupWord(new char[] { 'o', 'l', 'r' }, 0, 3); + Int32sRef ordList = dictionary.LookupWord(new char[] { 'o', 'l', 'r' }, 0, 3); assertNotNull(ordList); assertEquals(1, ordList.Length); @@ -70,7 +70,7 @@ namespace Lucene.Net.Analysis.Hunspell Dictionary dictionary = new Dictionary(affixStream, dictStream); assertEquals(3, dictionary.LookupSuffix(new char[] { 'e' }, 0, 1).Length); assertEquals(1, dictionary.LookupPrefix(new char[] { 's' }, 0, 1).Length); - IntsRef ordList = dictionary.LookupWord(new char[] { 'o', 'l', 'r' }, 0, 3); + Int32sRef ordList = dictionary.LookupWord(new char[] { 'o', 'l', 'r' }, 0, 3); BytesRef @ref = new BytesRef(); dictionary.flagLookup.Get(ordList.Int32s[0], @ref); char[] flags = Dictionary.DecodeFlags(@ref); @@ -90,7 +90,7 @@ namespace Lucene.Net.Analysis.Hunspell Dictionary dictionary = new Dictionary(affixStream, dictStream); assertEquals(3, dictionary.LookupSuffix(new char[] { 'e' }, 0, 1).Length); assertEquals(1, dictionary.LookupPrefix(new char[] { 's' }, 0, 1).Length); - IntsRef ordList = dictionary.LookupWord(new char[] { 'o', 'l', 'r' }, 0, 3); + Int32sRef ordList = dictionary.LookupWord(new char[] { 'o', 'l', 'r' }, 0, 3); BytesRef @ref = new BytesRef(); dictionary.flagLookup.Get(ordList.Int32s[0], @ref); char[] flags = Dictionary.DecodeFlags(@ref); @@ -109,7 +109,7 @@ namespace Lucene.Net.Analysis.Hunspell Dictionary dictionary = new Dictionary(affixStream, dictStream); assertEquals(3, dictionary.LookupSuffix(new char[] { 'e' }, 0, 1).Length); assertEquals(1, dictionary.LookupPrefix(new char[] { 's' }, 0, 1).Length); - IntsRef ordList = dictionary.LookupWord(new char[] { 'o', 'l', 'r' }, 0, 3); + Int32sRef ordList = dictionary.LookupWord(new char[] { 'o', 'l', 'r' }, 0, 3); BytesRef @ref = new BytesRef(); dictionary.flagLookup.Get(ordList.Int32s[0], @ref); char[] flags = Dictionary.DecodeFlags(@ref); @@ -289,7 +289,7 @@ namespace Lucene.Net.Analysis.Hunspell { Outputs<CharsRef> outputs = CharSequenceOutputs.Singleton; Builder<CharsRef> builder = new Builder<CharsRef>(FST.INPUT_TYPE.BYTE2, outputs); - IntsRef scratchInts = new IntsRef(); + Int32sRef scratchInts = new Int32sRef(); // a -> b Lucene.Net.Util.Fst.Util.ToUTF16("a", scratchInts); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Expressions/TestExpressionSorts.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Expressions/TestExpressionSorts.cs b/src/Lucene.Net.Tests.Expressions/TestExpressionSorts.cs index 054d388..dcf6cd6 100644 --- a/src/Lucene.Net.Tests.Expressions/TestExpressionSorts.cs +++ b/src/Lucene.Net.Tests.Expressions/TestExpressionSorts.cs @@ -45,12 +45,12 @@ namespace Lucene.Net.Tests.Expressions ())), Field.Store.NO), NewStringField("short", string.Empty + ((short) Random().Next()), Field.Store .NO), - new IntField("int", Random().Next(), Field.Store.NO), - new LongField("long", Random().NextLong(), Field.Store.NO), - new FloatField("float", Random().NextFloat(), Field.Store.NO), + new Int32Field("int", Random().Next(), Field.Store.NO), + new Int64Field("long", Random().NextLong(), Field.Store.NO), + new SingleField("float", Random().NextFloat(), Field.Store.NO), new DoubleField("double", Random().NextDouble(), Field.Store.NO), new NumericDocValuesField("intdocvalues", Random().Next()), - new FloatDocValuesField("floatdocvalues", Random().NextFloat()) + new SingleDocValuesField("floatdocvalues", Random().NextFloat()) }; iw.AddDocument(document); } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs b/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs index 14060c2..d128c36 100644 --- a/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs +++ b/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs @@ -32,9 +32,9 @@ namespace Lucene.Net.Facet.Range using DoubleDocValuesField = Lucene.Net.Documents.DoubleDocValuesField; using DoubleField = Lucene.Net.Documents.DoubleField; using Field = Lucene.Net.Documents.Field; - using FloatDocValuesField = Lucene.Net.Documents.FloatDocValuesField; - using FloatField = Lucene.Net.Documents.FloatField; - using LongField = Lucene.Net.Documents.LongField; + using SingleDocValuesField = Lucene.Net.Documents.SingleDocValuesField; + using SingleField = Lucene.Net.Documents.SingleField; + using Int64Field = Lucene.Net.Documents.Int64Field; using NumericDocValuesField = Lucene.Net.Documents.NumericDocValuesField; using DrillSidewaysResult = Lucene.Net.Facet.DrillSideways.DrillSidewaysResult; using TaxonomyReader = Lucene.Net.Facet.Taxonomy.TaxonomyReader; @@ -229,7 +229,7 @@ namespace Lucene.Net.Facet.Range // For computing range facet counts: doc.Add(new NumericDocValuesField("field", l)); // For drill down by numeric range: - doc.Add(new LongField("field", l, Field.Store.NO)); + doc.Add(new Int64Field("field", l, Field.Store.NO)); if ((l & 3) == 0) { @@ -358,7 +358,7 @@ namespace Lucene.Net.Facet.Range Directory d = NewDirectory(); RandomIndexWriter w = new RandomIndexWriter(Random(), d, Similarity, TimeZone); Document doc = new Document(); - FloatDocValuesField field = new FloatDocValuesField("field", 0.0f); + SingleDocValuesField field = new SingleDocValuesField("field", 0.0f); doc.Add(field); for (long l = 0; l < 100; l++) { @@ -400,7 +400,7 @@ namespace Lucene.Net.Facet.Range long v = Random().NextLong(); values[i] = v; doc.Add(new NumericDocValuesField("field", v)); - doc.Add(new LongField("field", v, Field.Store.NO)); + doc.Add(new Int64Field("field", v, Field.Store.NO)); w.AddDocument(doc); minValue = Math.Min(minValue, v); maxValue = Math.Max(maxValue, v); @@ -588,8 +588,8 @@ namespace Lucene.Net.Facet.Range Document doc = new Document(); float v = Random().NextFloat(); values[i] = v; - doc.Add(new FloatDocValuesField("field", v)); - doc.Add(new FloatField("field", v, Field.Store.NO)); + doc.Add(new SingleDocValuesField("field", v)); + doc.Add(new SingleField("field", v, Field.Store.NO)); w.AddDocument(doc); minValue = Math.Min(minValue, v); maxValue = Math.Max(maxValue, v); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestAddTaxonomy.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestAddTaxonomy.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestAddTaxonomy.cs index b896c94..2be7da3 100644 --- a/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestAddTaxonomy.cs +++ b/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestAddTaxonomy.cs @@ -39,7 +39,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory { private void Dotest(int ncats, int range) { - AtomicInteger numCats = new AtomicInteger(ncats); + AtomicInt32 numCats = new AtomicInt32(ncats); Directory[] dirs = new Directory[2]; for (int i = 0; i < dirs.Length; i++) { @@ -78,10 +78,10 @@ namespace Lucene.Net.Facet.Taxonomy.Directory private readonly TestAddTaxonomy outerInstance; private int range; - private AtomicInteger numCats; + private AtomicInt32 numCats; private DirectoryTaxonomyWriter tw; - public ThreadAnonymousInnerClassHelper(TestAddTaxonomy outerInstance, int range, AtomicInteger numCats, DirectoryTaxonomyWriter tw) + public ThreadAnonymousInnerClassHelper(TestAddTaxonomy outerInstance, int range, AtomicInt32 numCats, DirectoryTaxonomyWriter tw) { this.outerInstance = outerInstance; this.range = range; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestConcurrentFacetedIndexing.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestConcurrentFacetedIndexing.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestConcurrentFacetedIndexing.cs index f5971e2..1120661 100644 --- a/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestConcurrentFacetedIndexing.cs +++ b/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestConcurrentFacetedIndexing.cs @@ -106,7 +106,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory [Test] public virtual void TestConcurrency() { - AtomicInteger numDocs = new AtomicInteger(AtLeast(10000)); + AtomicInt32 numDocs = new AtomicInt32(AtLeast(10000)); Directory indexDir = NewDirectory(); Directory taxoDir = NewDirectory(); ConcurrentDictionary<string, string> values = new ConcurrentDictionary<string, string>(); @@ -172,13 +172,13 @@ namespace Lucene.Net.Facet.Taxonomy.Directory { private readonly TestConcurrentFacetedIndexing outerInstance; - private AtomicInteger numDocs; + private AtomicInt32 numDocs; private ConcurrentDictionary<string, string> values; private IndexWriter iw; private Lucene.Net.Facet.Taxonomy.Directory.DirectoryTaxonomyWriter tw; private FacetsConfig config; - public ThreadAnonymousInnerClassHelper(TestConcurrentFacetedIndexing outerInstance, AtomicInteger numDocs, ConcurrentDictionary<string, string> values, IndexWriter iw, Lucene.Net.Facet.Taxonomy.Directory.DirectoryTaxonomyWriter tw, FacetsConfig config) + public ThreadAnonymousInnerClassHelper(TestConcurrentFacetedIndexing outerInstance, AtomicInt32 numDocs, ConcurrentDictionary<string, string> values, IndexWriter iw, Lucene.Net.Facet.Taxonomy.Directory.DirectoryTaxonomyWriter tw, FacetsConfig config) { this.outerInstance = outerInstance; this.numDocs = numDocs; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestDirectoryTaxonomyWriter.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestDirectoryTaxonomyWriter.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestDirectoryTaxonomyWriter.cs index db56de4..cb4e68e 100644 --- a/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestDirectoryTaxonomyWriter.cs +++ b/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestDirectoryTaxonomyWriter.cs @@ -268,7 +268,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory { int ncats = AtLeast(100000); // add many categories int range = ncats * 3; // affects the categories selection - AtomicInteger numCats = new AtomicInteger(ncats); + AtomicInt32 numCats = new AtomicInt32(ncats); Directory dir = NewDirectory(); var values = new ConcurrentDictionary<string, string>(); double d = Random().NextDouble(); @@ -350,11 +350,11 @@ namespace Lucene.Net.Facet.Taxonomy.Directory private readonly TestDirectoryTaxonomyWriter outerInstance; private int range; - private AtomicInteger numCats; + private AtomicInt32 numCats; private ConcurrentDictionary<string, string> values; private Lucene.Net.Facet.Taxonomy.Directory.DirectoryTaxonomyWriter tw; - public ThreadAnonymousInnerClassHelper(TestDirectoryTaxonomyWriter outerInstance, int range, AtomicInteger numCats, ConcurrentDictionary<string, string> values, Lucene.Net.Facet.Taxonomy.Directory.DirectoryTaxonomyWriter tw) + public ThreadAnonymousInnerClassHelper(TestDirectoryTaxonomyWriter outerInstance, int range, AtomicInt32 numCats, ConcurrentDictionary<string, string> values, Lucene.Net.Facet.Taxonomy.Directory.DirectoryTaxonomyWriter tw) { this.outerInstance = outerInstance; this.range = range; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs index 980f818..5f3972b 100644 --- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs +++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs @@ -30,8 +30,8 @@ namespace Lucene.Net.Facet.Taxonomy using MockAnalyzer = Lucene.Net.Analysis.MockAnalyzer; using Document = Lucene.Net.Documents.Document; using Field = Lucene.Net.Documents.Field; - using FloatDocValuesField = Lucene.Net.Documents.FloatDocValuesField; - using IntField = Lucene.Net.Documents.IntField; + using SingleDocValuesField = Lucene.Net.Documents.SingleDocValuesField; + using Int32Field = Lucene.Net.Documents.Int32Field; using NumericDocValuesField = Lucene.Net.Documents.NumericDocValuesField; using StringField = Lucene.Net.Documents.StringField; using DirectoryTaxonomyReader = Lucene.Net.Facet.Taxonomy.Directory.DirectoryTaxonomyReader; @@ -82,27 +82,27 @@ namespace Lucene.Net.Facet.Taxonomy // Reused across documents, to add the necessary facet // fields: Document doc = new Document(); - doc.Add(new IntField("num", 10, Field.Store.NO)); + doc.Add(new Int32Field("num", 10, Field.Store.NO)); doc.Add(new FacetField("Author", "Bob")); writer.AddDocument(config.Build(taxoWriter, doc)); doc = new Document(); - doc.Add(new IntField("num", 20, Field.Store.NO)); + doc.Add(new Int32Field("num", 20, Field.Store.NO)); doc.Add(new FacetField("Author", "Lisa")); writer.AddDocument(config.Build(taxoWriter, doc)); doc = new Document(); - doc.Add(new IntField("num", 30, Field.Store.NO)); + doc.Add(new Int32Field("num", 30, Field.Store.NO)); doc.Add(new FacetField("Author", "Lisa")); writer.AddDocument(config.Build(taxoWriter, doc)); doc = new Document(); - doc.Add(new IntField("num", 40, Field.Store.NO)); + doc.Add(new Int32Field("num", 40, Field.Store.NO)); doc.Add(new FacetField("Author", "Susan")); writer.AddDocument(config.Build(taxoWriter, doc)); doc = new Document(); - doc.Add(new IntField("num", 45, Field.Store.NO)); + doc.Add(new Int32Field("num", 45, Field.Store.NO)); doc.Add(new FacetField("Author", "Frank")); writer.AddDocument(config.Build(taxoWriter, doc)); @@ -149,7 +149,7 @@ namespace Lucene.Net.Facet.Taxonomy FacetsConfig config = new FacetsConfig(); Document doc = new Document(); - doc.Add(new IntField("num", 10, Field.Store.NO)); + doc.Add(new Int32Field("num", 10, Field.Store.NO)); doc.Add(new FacetField("a", "foo1")); writer.AddDocument(config.Build(taxoWriter, doc)); @@ -159,7 +159,7 @@ namespace Lucene.Net.Facet.Taxonomy } doc = new Document(); - doc.Add(new IntField("num", 20, Field.Store.NO)); + doc.Add(new Int32Field("num", 20, Field.Store.NO)); doc.Add(new FacetField("a", "foo2")); doc.Add(new FacetField("b", "bar1")); writer.AddDocument(config.Build(taxoWriter, doc)); @@ -170,7 +170,7 @@ namespace Lucene.Net.Facet.Taxonomy } doc = new Document(); - doc.Add(new IntField("num", 30, Field.Store.NO)); + doc.Add(new Int32Field("num", 30, Field.Store.NO)); doc.Add(new FacetField("a", "foo3")); doc.Add(new FacetField("b", "bar2")); doc.Add(new FacetField("c", "baz1")); @@ -217,7 +217,7 @@ namespace Lucene.Net.Facet.Taxonomy RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone); Document doc = new Document(); - doc.Add(new IntField("num", 10, Field.Store.NO)); + doc.Add(new Int32Field("num", 10, Field.Store.NO)); doc.Add(new FacetField("a", "foo1")); writer.AddDocument(config.Build(taxoWriter, doc)); @@ -506,7 +506,7 @@ namespace Lucene.Net.Facet.Taxonomy Document doc = new Document(); doc.Add(NewStringField("content", testDoc.content, Field.Store.NO)); testDoc.value = Random().NextFloat(); - doc.Add(new FloatDocValuesField("value", testDoc.value)); + doc.Add(new SingleDocValuesField("value", testDoc.value)); for (int j = 0; j < numDims; j++) { if (testDoc.dims[j] != null) http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Grouping/AllGroupHeadsCollectorTest.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Grouping/AllGroupHeadsCollectorTest.cs b/src/Lucene.Net.Tests.Grouping/AllGroupHeadsCollectorTest.cs index 1835309..4008b34 100644 --- a/src/Lucene.Net.Tests.Grouping/AllGroupHeadsCollectorTest.cs +++ b/src/Lucene.Net.Tests.Grouping/AllGroupHeadsCollectorTest.cs @@ -252,7 +252,7 @@ namespace Lucene.Net.Search.Grouping Field content = NewTextField("content", "", Field.Store.NO); doc.Add(content); docNoGroup.Add(content); - IntField id = new IntField("id", 0, Field.Store.NO); + Int32Field id = new Int32Field("id", 0, Field.Store.NO); doc.Add(id); docNoGroup.Add(id); GroupDoc[] groupDocs = new GroupDoc[numDocs]; @@ -312,7 +312,7 @@ namespace Lucene.Net.Search.Grouping w.Dispose(); // NOTE: intentional but temporary field cache insanity! - FieldCache.Ints docIdToFieldId = FieldCache.DEFAULT.GetInt32s(SlowCompositeReaderWrapper.Wrap(r), "id", false); + FieldCache.Int32s docIdToFieldId = FieldCache.DEFAULT.GetInt32s(SlowCompositeReaderWrapper.Wrap(r), "id", false); int[] fieldIdToDocID = new int[numDocs]; for (int i = 0; i < numDocs; i++) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Grouping/TestGrouping.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Grouping/TestGrouping.cs b/src/Lucene.Net.Tests.Grouping/TestGrouping.cs index b22e46d..6345b13 100644 --- a/src/Lucene.Net.Tests.Grouping/TestGrouping.cs +++ b/src/Lucene.Net.Tests.Grouping/TestGrouping.cs @@ -697,7 +697,7 @@ namespace Lucene.Net.Search.Grouping } doc.Add(NewStringField("sort1", groupValue.sort1.Utf8ToString(), Field.Store.NO)); doc.Add(NewStringField("sort2", groupValue.sort2.Utf8ToString(), Field.Store.NO)); - doc.Add(new IntField("id", groupValue.id, Field.Store.NO)); + doc.Add(new Int32Field("id", groupValue.id, Field.Store.NO)); doc.Add(NewTextField("content", groupValue.content, Field.Store.NO)); //Console.WriteLine("TEST: doc content=" + groupValue.content + " group=" + (groupValue.group == null ? "null" : groupValue.group.utf8ToString()) + " sort1=" + groupValue.sort1.utf8ToString() + " id=" + groupValue.id); } @@ -836,7 +836,7 @@ namespace Lucene.Net.Search.Grouping Field content = NewTextField("content", "", Field.Store.NO); doc.Add(content); docNoGroup.Add(content); - IntField id = new IntField("id", 0, Field.Store.NO); + Int32Field id = new Int32Field("id", 0, Field.Store.NO); doc.Add(id); docNoGroup.Add(id); GroupDoc[] groupDocs = new GroupDoc[numDocs]; @@ -900,7 +900,7 @@ namespace Lucene.Net.Search.Grouping w.Dispose(); // NOTE: intentional but temporary field cache insanity! - FieldCache.Ints docIDToID = FieldCache.DEFAULT.GetInt32s(SlowCompositeReaderWrapper.Wrap(r), "id", false); + FieldCache.Int32s docIDToID = FieldCache.DEFAULT.GetInt32s(SlowCompositeReaderWrapper.Wrap(r), "id", false); DirectoryReader rBlocks = null; Directory dirBlocks = null; @@ -944,7 +944,7 @@ namespace Lucene.Net.Search.Grouping dirBlocks = NewDirectory(); rBlocks = GetDocBlockReader(dirBlocks, groupDocs); Filter lastDocInBlock = new CachingWrapperFilter(new QueryWrapperFilter(new TermQuery(new Term("groupend", "x")))); - FieldCache.Ints docIDToIDBlocks = FieldCache.DEFAULT.GetInt32s(SlowCompositeReaderWrapper.Wrap(rBlocks), "id", false); + FieldCache.Int32s docIDToIDBlocks = FieldCache.DEFAULT.GetInt32s(SlowCompositeReaderWrapper.Wrap(rBlocks), "id", false); IndexSearcher sBlocks = NewSearcher(rBlocks); ShardState shardsBlocks = new ShardState(sBlocks); @@ -1557,7 +1557,7 @@ namespace Lucene.Net.Search.Grouping } } - private void AssertEquals(FieldCache.Ints docIDtoID, ITopGroups<BytesRef> expected, ITopGroups<BytesRef> actual, bool verifyGroupValues, bool verifyTotalGroupCount, bool verifySortValues, bool testScores, bool idvBasedImplsUsed) + private void AssertEquals(FieldCache.Int32s docIDtoID, ITopGroups<BytesRef> expected, ITopGroups<BytesRef> actual, bool verifyGroupValues, bool verifyTotalGroupCount, bool verifySortValues, bool testScores, bool idvBasedImplsUsed) { if (expected == null) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Highlighter/Highlight/HighlighterTest.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Highlighter/Highlight/HighlighterTest.cs b/src/Lucene.Net.Tests.Highlighter/Highlight/HighlighterTest.cs index 33fe884..2cc4b14 100644 --- a/src/Lucene.Net.Tests.Highlighter/Highlight/HighlighterTest.cs +++ b/src/Lucene.Net.Tests.Highlighter/Highlight/HighlighterTest.cs @@ -1971,22 +1971,22 @@ namespace Lucene.Net.Search.Highlight addDoc(writer, text); } Document doc = new Document(); - doc.Add(new IntField(NUMERIC_FIELD_NAME, 1, Field.Store.NO)); + doc.Add(new Int32Field(NUMERIC_FIELD_NAME, 1, Field.Store.NO)); doc.Add(new StoredField(NUMERIC_FIELD_NAME, 1)); writer.AddDocument(doc, analyzer); doc = new Document(); - doc.Add(new IntField(NUMERIC_FIELD_NAME, 3, Field.Store.NO)); + doc.Add(new Int32Field(NUMERIC_FIELD_NAME, 3, Field.Store.NO)); doc.Add(new StoredField(NUMERIC_FIELD_NAME, 3)); writer.AddDocument(doc, analyzer); doc = new Document(); - doc.Add(new IntField(NUMERIC_FIELD_NAME, 5, Field.Store.NO)); + doc.Add(new Int32Field(NUMERIC_FIELD_NAME, 5, Field.Store.NO)); doc.Add(new StoredField(NUMERIC_FIELD_NAME, 5)); writer.AddDocument(doc, analyzer); doc = new Document(); - doc.Add(new IntField(NUMERIC_FIELD_NAME, 7, Field.Store.NO)); + doc.Add(new Int32Field(NUMERIC_FIELD_NAME, 7, Field.Store.NO)); doc.Add(new StoredField(NUMERIC_FIELD_NAME, 7)); writer.AddDocument(doc, analyzer); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Join/TestBlockJoin.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Join/TestBlockJoin.cs b/src/Lucene.Net.Tests.Join/TestBlockJoin.cs index a5f3ce2..24c00b9 100644 --- a/src/Lucene.Net.Tests.Join/TestBlockJoin.cs +++ b/src/Lucene.Net.Tests.Join/TestBlockJoin.cs @@ -51,7 +51,7 @@ namespace Lucene.Net.Tests.Join { Document job = new Document(); job.Add(NewStringField("skill", skill, Field.Store.YES)); - job.Add(new IntField("year", year, Field.Store.NO)); + job.Add(new Int32Field("year", year, Field.Store.NO)); job.Add(new StoredField("year", year)); return job; } @@ -61,7 +61,7 @@ namespace Lucene.Net.Tests.Join { Document job = new Document(); job.Add(NewStringField("qualification", qualification, Field.Store.YES)); - job.Add(new IntField("year", year, Field.Store.NO)); + job.Add(new Int32Field("year", year, Field.Store.NO)); return job; } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Misc/Util/Fst/TestFSTsMisc.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Misc/Util/Fst/TestFSTsMisc.cs b/src/Lucene.Net.Tests.Misc/Util/Fst/TestFSTsMisc.cs index 228b91f..7ad22ef 100644 --- a/src/Lucene.Net.Tests.Misc/Util/Fst/TestFSTsMisc.cs +++ b/src/Lucene.Net.Tests.Misc/Util/Fst/TestFSTsMisc.cs @@ -43,8 +43,8 @@ namespace Lucene.Net.Util.Fst for (int inputMode = 0; inputMode < 2; inputMode++) { int numWords = random.nextInt(maxNumWords + 1); - ISet<IntsRef> termsSet = new HashSet<IntsRef>(); - IntsRef[] terms = new IntsRef[numWords]; + ISet<Int32sRef> termsSet = new HashSet<Int32sRef>(); + Int32sRef[] terms = new Int32sRef[numWords]; while (termsSet.size() < numWords) { string term = FSTTester<object>.GetRandomString(random); @@ -56,7 +56,7 @@ namespace Lucene.Net.Util.Fst } - private void DoTest(int inputMode, IntsRef[] terms) + private void DoTest(int inputMode, Int32sRef[] terms) { Array.Sort(terms); @@ -106,7 +106,7 @@ namespace Lucene.Net.Util.Fst { Console.WriteLine("TEST: now test OneOrMoreOutputs"); } - PositiveIntOutputs _outputs = PositiveIntOutputs.Singleton; // LUCENENET TODO: This should probably not be a nullable type + PositiveInt32Outputs _outputs = PositiveInt32Outputs.Singleton; // LUCENENET TODO: This should probably not be a nullable type ListOfOutputs<long?> outputs2 = new ListOfOutputs<long?>(_outputs); List<FSTTester<object>.InputOutput<object>> pairs2 = new List<FSTTester<object>.InputOutput<object>>(terms.Length); long lastOutput2 = 0; @@ -174,11 +174,11 @@ namespace Lucene.Net.Util.Fst [Test] public void TestListOfOutputs() { - PositiveIntOutputs _outputs = PositiveIntOutputs.Singleton; + PositiveInt32Outputs _outputs = PositiveInt32Outputs.Singleton; ListOfOutputs<long?> outputs = new ListOfOutputs<long?>(_outputs); Builder<object> builder = new Builder<object>(Lucene.Net.Util.Fst.FST.INPUT_TYPE.BYTE1, outputs); - IntsRef scratch = new IntsRef(); + Int32sRef scratch = new Int32sRef(); // Add the same input more than once and the outputs // are merged: builder.Add(Util.ToInt32sRef(new BytesRef("a"), scratch), 1L); @@ -205,11 +205,11 @@ namespace Lucene.Net.Util.Fst [Test] public void TestListOfOutputsEmptyString() { - PositiveIntOutputs _outputs = PositiveIntOutputs.Singleton; + PositiveInt32Outputs _outputs = PositiveInt32Outputs.Singleton; ListOfOutputs<long?> outputs = new ListOfOutputs<long?>(_outputs); Builder<object> builder = new Builder<object>(FST.INPUT_TYPE.BYTE1, outputs); - IntsRef scratch = new IntsRef(); + Int32sRef scratch = new Int32sRef(); builder.Add(scratch, 0L); builder.Add(scratch, 1L); builder.Add(scratch, 17L); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs b/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs index 1692996..835b170 100644 --- a/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs +++ b/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs @@ -60,7 +60,7 @@ namespace Lucene.Net.Tests.Queries.Function break; case DocValuesType.NUMERIC: int bitsPerValue = Random().NextIntBetween(1, 31); // keep it an int - vals[i] = (long)Random().Next((int)PackedInts.MaxValue(bitsPerValue)); + vals[i] = (long)Random().Next((int)PackedInt32s.MaxValue(bitsPerValue)); f.SetInt64Value((long) vals[i]); break; } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs b/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs index b188246..527b4df 100644 --- a/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs +++ b/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs @@ -184,7 +184,7 @@ namespace Lucene.Net.Tests.Queries protected override CustomScoreProvider GetCustomScoreProvider(AtomicReaderContext context) { - FieldCache.Ints values = FieldCache.DEFAULT.GetInt32s(context.AtomicReader, INT_FIELD, false); + FieldCache.Int32s values = FieldCache.DEFAULT.GetInt32s(context.AtomicReader, INT_FIELD, false); return new CustomScoreProviderAnonymousInnerClassHelper(this, context, values); } @@ -192,9 +192,9 @@ namespace Lucene.Net.Tests.Queries { private readonly CustomExternalQuery outerInstance; - private FieldCache.Ints values; + private FieldCache.Int32s values; - public CustomScoreProviderAnonymousInnerClassHelper(CustomExternalQuery outerInstance, AtomicReaderContext context, FieldCache.Ints values) : base(context) + public CustomScoreProviderAnonymousInnerClassHelper(CustomExternalQuery outerInstance, AtomicReaderContext context, FieldCache.Int32s values) : base(context) { this.outerInstance = outerInstance; this.values = values; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestNumericQueryParser.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestNumericQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestNumericQueryParser.cs index ecad5e3..779e943 100644 --- a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestNumericQueryParser.cs +++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestNumericQueryParser.cs @@ -190,7 +190,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard numericConfigMap.Put(type.ToString(), new NumericConfig(PRECISION_STEP, NUMBER_FORMAT, type)); - FieldType ft2 = new FieldType(IntField.TYPE_NOT_STORED); + FieldType ft2 = new FieldType(Int32Field.TYPE_NOT_STORED); ft2.NumericType = (type); ft2.IsStored = (true); ft2.NumericPrecisionStep = (PRECISION_STEP); @@ -200,13 +200,13 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard switch (type) { case NumericType.INT: - field = new IntField(type.ToString(), 0, ft2); + field = new Int32Field(type.ToString(), 0, ft2); break; case NumericType.FLOAT: - field = new FloatField(type.ToString(), 0.0f, ft2); + field = new SingleField(type.ToString(), 0.0f, ft2); break; case NumericType.LONG: - field = new LongField(type.ToString(), 0L, ft2); + field = new Int64Field(type.ToString(), 0L, ft2); break; case NumericType.DOUBLE: field = new DoubleField(type.ToString(), 0.0, ft2); @@ -222,10 +222,10 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard numericConfigMap.Put(DATE_FIELD_NAME, new NumericConfig(PRECISION_STEP, DATE_FORMAT, NumericType.LONG)); - FieldType ft = new FieldType(LongField.TYPE_NOT_STORED); + FieldType ft = new FieldType(Int64Field.TYPE_NOT_STORED); ft.IsStored = (true); ft.NumericPrecisionStep = (PRECISION_STEP); - LongField dateField = new LongField(DATE_FIELD_NAME, 0L, ft); + Int64Field dateField = new Int64Field(DATE_FIELD_NAME, 0L, ft); numericFieldMap.Put(DATE_FIELD_NAME, dateField); doc.Add(dateField); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.QueryParser/Xml/TestParser.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.QueryParser/Xml/TestParser.cs b/src/Lucene.Net.Tests.QueryParser/Xml/TestParser.cs index 6aa300b..7f8290a 100644 --- a/src/Lucene.Net.Tests.QueryParser/Xml/TestParser.cs +++ b/src/Lucene.Net.Tests.QueryParser/Xml/TestParser.cs @@ -60,7 +60,7 @@ namespace Lucene.Net.QueryParsers.Xml Document doc = new Document(); doc.Add(NewTextField("date", date, Field.Store.YES)); doc.Add(NewTextField("contents", content, Field.Store.YES)); - doc.Add(new IntField("date2", Convert.ToInt32(date), Field.Store.NO)); + doc.Add(new Int32Field("date2", Convert.ToInt32(date), Field.Store.NO)); writer.AddDocument(doc); line = d.ReadLine(); } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Spatial/SpatialExample.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Spatial/SpatialExample.cs b/src/Lucene.Net.Tests.Spatial/SpatialExample.cs index 4a03d78..bc1fa67 100644 --- a/src/Lucene.Net.Tests.Spatial/SpatialExample.cs +++ b/src/Lucene.Net.Tests.Spatial/SpatialExample.cs @@ -111,7 +111,7 @@ namespace Lucene.Net.Spatial private Document NewSampleDocument(int id, params IShape[] shapes) { Document doc = new Document(); - doc.Add(new IntField("id", id, Field.Store.YES)); + doc.Add(new Int32Field("id", id, Field.Store.YES)); //Potentially more than one shape in this field is supported by some // strategies; see the javadocs of the SpatialStrategy impl to see. foreach (IShape shape in shapes) http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs index d0796d8..991233f 100644 --- a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs +++ b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs @@ -911,8 +911,8 @@ namespace Lucene.Net.Search.Suggest.Analyzing foreach (TermFreqPayload2 e in slowCompletor) { spare.CopyChars(e.analyzedForm); - ISet<IntsRef> finiteStrings = suggester.ToFiniteStrings(spare, tokenStreamToAutomaton); - foreach (IntsRef intsRef in finiteStrings) + ISet<Int32sRef> finiteStrings = suggester.ToFiniteStrings(spare, tokenStreamToAutomaton); + foreach (Int32sRef intsRef in finiteStrings) { State p = automaton.GetInitialState(); BytesRef @ref = Lucene.Net.Util.Fst.Util.ToBytesRef(intsRef, spare); @@ -1323,8 +1323,8 @@ namespace Lucene.Net.Search.Suggest.Analyzing * between two strings, including transpositions. */ public int GetDistance(string target, string other, bool allowTransposition) { - IntsRef targetPoints; - IntsRef otherPoints; + Int32sRef targetPoints; + Int32sRef otherPoints; int n; int[][] d; // cost array @@ -1413,9 +1413,9 @@ namespace Lucene.Net.Search.Suggest.Analyzing return array; } - private static IntsRef ToIntsRef(string s) + private static Int32sRef ToIntsRef(string s) { - IntsRef @ref = new IntsRef(s.Length); // worst case + Int32sRef @ref = new Int32sRef(s.Length); // worst case int utf16Len = s.Length; for (int i = 0, cp = 0; i < utf16Len; i += Character.CharCount(cp)) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests/core/Codecs/Compressing/TestCompressingStoredFieldsFormat.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests/core/Codecs/Compressing/TestCompressingStoredFieldsFormat.cs b/src/Lucene.Net.Tests/core/Codecs/Compressing/TestCompressingStoredFieldsFormat.cs index 4c4494c..ef5ac7e 100644 --- a/src/Lucene.Net.Tests/core/Codecs/Compressing/TestCompressingStoredFieldsFormat.cs +++ b/src/Lucene.Net.Tests/core/Codecs/Compressing/TestCompressingStoredFieldsFormat.cs @@ -12,7 +12,7 @@ namespace Lucene.Net.Codecs.Compressing using Field = Field; using FieldType = FieldType; using IndexWriterConfig = Lucene.Net.Index.IndexWriterConfig; - using IntField = IntField; + using Int32Field = Int32Field; /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -59,7 +59,7 @@ namespace Lucene.Net.Codecs.Compressing RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, iwConf); Document validDoc = new Document(); - validDoc.Add(new IntField("id", 0, Field.Store.YES)); + validDoc.Add(new Int32Field("id", 0, Field.Store.YES)); iw.AddDocument(validDoc); iw.Commit(); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests/core/Codecs/Lucene41/TestForUtil.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests/core/Codecs/Lucene41/TestForUtil.cs b/src/Lucene.Net.Tests/core/Codecs/Lucene41/TestForUtil.cs index 02ee82e..2f6a7bc 100644 --- a/src/Lucene.Net.Tests/core/Codecs/Lucene41/TestForUtil.cs +++ b/src/Lucene.Net.Tests/core/Codecs/Lucene41/TestForUtil.cs @@ -26,7 +26,7 @@ namespace Lucene.Net.Codecs.Lucene41 using IndexOutput = Lucene.Net.Store.IndexOutput; using IOContext = Lucene.Net.Store.IOContext; using LuceneTestCase = Lucene.Net.Util.LuceneTestCase; - using PackedInts = Lucene.Net.Util.Packed.PackedInts; + using PackedInt32s = Lucene.Net.Util.Packed.PackedInt32s; using RAMDirectory = Lucene.Net.Store.RAMDirectory; [TestFixture] @@ -53,7 +53,7 @@ namespace Lucene.Net.Codecs.Lucene41 { for (int j = 0; j < Lucene41PostingsFormat.BLOCK_SIZE; ++j) { - values[i * Lucene41PostingsFormat.BLOCK_SIZE + j] = RandomInts.NextIntBetween(Random(), 0, (int)PackedInts.MaxValue(bpv)); + values[i * Lucene41PostingsFormat.BLOCK_SIZE + j] = RandomInts.NextIntBetween(Random(), 0, (int)PackedInt32s.MaxValue(bpv)); } } } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests/core/Document/TestDocument.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests/core/Document/TestDocument.cs b/src/Lucene.Net.Tests/core/Document/TestDocument.cs index 3e51b12..11b108b 100644 --- a/src/Lucene.Net.Tests/core/Document/TestDocument.cs +++ b/src/Lucene.Net.Tests/core/Document/TestDocument.cs @@ -432,10 +432,10 @@ namespace Lucene.Net.Documents public virtual void TestNumericFieldAsString() { Documents.Document doc = new Documents.Document(); - doc.Add(new IntField("int", 5, Field.Store.YES)); + doc.Add(new Int32Field("int", 5, Field.Store.YES)); Assert.AreEqual("5", doc.Get("int")); Assert.IsNull(doc.Get("somethingElse")); - doc.Add(new IntField("int", 4, Field.Store.YES)); + doc.Add(new Int32Field("int", 4, Field.Store.YES)); Assert.AreEqual(new string[] { "5", "4" }, doc.GetValues("int")); Directory dir = NewDirectory(); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests/core/Document/TestField.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests/core/Document/TestField.cs b/src/Lucene.Net.Tests/core/Document/TestField.cs index c278fbf..f436364 100644 --- a/src/Lucene.Net.Tests/core/Document/TestField.cs +++ b/src/Lucene.Net.Tests/core/Document/TestField.cs @@ -80,7 +80,7 @@ namespace Lucene.Net.Documents [Test] public virtual void TestFloatDocValuesField() { - FloatDocValuesField field = new FloatDocValuesField("foo", 5f); + SingleDocValuesField field = new SingleDocValuesField("foo", 5f); TrySetBoost(field); TrySetByteValue(field); @@ -101,7 +101,7 @@ namespace Lucene.Net.Documents [Test] public virtual void TestFloatField() { - Field[] fields = new Field[] { new FloatField("foo", 5f, Field.Store.NO), new FloatField("foo", 5f, Field.Store.YES) }; + Field[] fields = new Field[] { new SingleField("foo", 5f, Field.Store.NO), new SingleField("foo", 5f, Field.Store.YES) }; foreach (Field field in fields) { @@ -125,7 +125,7 @@ namespace Lucene.Net.Documents [Test] public virtual void TestIntField() { - Field[] fields = new Field[] { new IntField("foo", 5, Field.Store.NO), new IntField("foo", 5, Field.Store.YES) }; + Field[] fields = new Field[] { new Int32Field("foo", 5, Field.Store.NO), new Int32Field("foo", 5, Field.Store.YES) }; foreach (Field field in fields) { @@ -170,7 +170,7 @@ namespace Lucene.Net.Documents [Test] public virtual void TestLongField() { - Field[] fields = new Field[] { new LongField("foo", 5L, Field.Store.NO), new LongField("foo", 5L, Field.Store.YES) }; + Field[] fields = new Field[] { new Int64Field("foo", 5L, Field.Store.NO), new Int64Field("foo", 5L, Field.Store.YES) }; foreach (Field field in fields) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests/core/Index/TestBackwardsCompatibility.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests/core/Index/TestBackwardsCompatibility.cs b/src/Lucene.Net.Tests/core/Index/TestBackwardsCompatibility.cs index 5183860..96c40ab 100644 --- a/src/Lucene.Net.Tests/core/Index/TestBackwardsCompatibility.cs +++ b/src/Lucene.Net.Tests/core/Index/TestBackwardsCompatibility.cs @@ -34,9 +34,9 @@ namespace Lucene.Net.Index using DoubleDocValuesField = Lucene.Net.Documents.DoubleDocValuesField; using Field = Lucene.Net.Documents.Field; using FieldType = Lucene.Net.Documents.FieldType; - using FloatDocValuesField = Lucene.Net.Documents.FloatDocValuesField; - using IntField = Lucene.Net.Documents.IntField; - using LongField = Lucene.Net.Documents.LongField; + using SingleDocValuesField = Lucene.Net.Documents.SingleDocValuesField; + using Int32Field = Lucene.Net.Documents.Int32Field; + using Int64Field = Lucene.Net.Documents.Int64Field; using NumericDocValuesField = Lucene.Net.Documents.NumericDocValuesField; using SortedDocValuesField = Lucene.Net.Documents.SortedDocValuesField; using SortedSetDocValuesField = Lucene.Net.Documents.SortedSetDocValuesField; @@ -715,8 +715,8 @@ namespace Lucene.Net.Index doc.Add(new Field("content2", "here is more content with aaa aaa aaa", customType2)); doc.Add(new Field("fie\u2C77ld", "field with non-ascii name", customType2)); // add numeric fields, to test if flex preserves encoding - doc.Add(new IntField("trieInt", id, Field.Store.NO)); - doc.Add(new LongField("trieLong", (long)id, Field.Store.NO)); + doc.Add(new Int32Field("trieInt", id, Field.Store.NO)); + doc.Add(new Int64Field("trieLong", (long)id, Field.Store.NO)); // add docvalues fields doc.Add(new NumericDocValuesField("dvByte", (sbyte)id)); sbyte[] bytes = new sbyte[] { (sbyte)((int)((uint)id >> 24)), (sbyte)((int)((uint)id >> 16)), (sbyte)((int)((uint)id >> 8)), (sbyte)id }; @@ -728,7 +728,7 @@ namespace Lucene.Net.Index doc.Add(new BinaryDocValuesField("dvBytesStraightFixed", @ref)); doc.Add(new BinaryDocValuesField("dvBytesStraightVar", @ref)); doc.Add(new DoubleDocValuesField("dvDouble", (double)id)); - doc.Add(new FloatDocValuesField("dvFloat", (float)id)); + doc.Add(new SingleDocValuesField("dvFloat", (float)id)); doc.Add(new NumericDocValuesField("dvInt", id)); doc.Add(new NumericDocValuesField("dvLong", id)); doc.Add(new NumericDocValuesField("dvPacked", id)); @@ -888,7 +888,7 @@ namespace Lucene.Net.Index Assert.AreEqual(34, hits_.Length, "wrong number of hits"); // check decoding into field cache - FieldCache.Ints fci = FieldCache.DEFAULT.GetInt32s(SlowCompositeReaderWrapper.Wrap(searcher.IndexReader), "trieInt", false); + FieldCache.Int32s fci = FieldCache.DEFAULT.GetInt32s(SlowCompositeReaderWrapper.Wrap(searcher.IndexReader), "trieInt", false); int maxDoc = searcher.IndexReader.MaxDoc; for (int doc = 0; doc < maxDoc; doc++) { @@ -896,7 +896,7 @@ namespace Lucene.Net.Index Assert.IsTrue(val >= 0 && val < 35, "value in id bounds"); } - FieldCache.Longs fcl = FieldCache.DEFAULT.GetInt64s(SlowCompositeReaderWrapper.Wrap(searcher.IndexReader), "trieLong", false); + FieldCache.Int64s fcl = FieldCache.DEFAULT.GetInt64s(SlowCompositeReaderWrapper.Wrap(searcher.IndexReader), "trieLong", false); for (int doc = 0; doc < maxDoc; doc++) { long val = fcl.Get(doc); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8b7f4185/src/Lucene.Net.Tests/core/Index/TestBackwardsCompatibility3x.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests/core/Index/TestBackwardsCompatibility3x.cs b/src/Lucene.Net.Tests/core/Index/TestBackwardsCompatibility3x.cs index ba5cd08..eeadaa4 100644 --- a/src/Lucene.Net.Tests/core/Index/TestBackwardsCompatibility3x.cs +++ b/src/Lucene.Net.Tests/core/Index/TestBackwardsCompatibility3x.cs @@ -34,9 +34,9 @@ namespace Lucene.Net.Index using DoubleDocValuesField = Lucene.Net.Documents.DoubleDocValuesField; using Field = Lucene.Net.Documents.Field; using FieldType = Lucene.Net.Documents.FieldType; - using FloatDocValuesField = Lucene.Net.Documents.FloatDocValuesField; - using IntField = Lucene.Net.Documents.IntField; - using LongField = Lucene.Net.Documents.LongField; + using SingleDocValuesField = Lucene.Net.Documents.SingleDocValuesField; + using Int32Field = Lucene.Net.Documents.Int32Field; + using Int64Field = Lucene.Net.Documents.Int64Field; using NumericDocValuesField = Lucene.Net.Documents.NumericDocValuesField; using SortedDocValuesField = Lucene.Net.Documents.SortedDocValuesField; using StringField = Lucene.Net.Documents.StringField; @@ -673,8 +673,8 @@ namespace Lucene.Net.Index doc.Add(new Field("content2", "here is more content with aaa aaa aaa", customType2)); doc.Add(new Field("fie\u2C77ld", "field with non-ascii name", customType2)); // add numeric fields, to test if flex preserves encoding - doc.Add(new IntField("trieInt", id, Field.Store.NO)); - doc.Add(new LongField("trieLong", (long)id, Field.Store.NO)); + doc.Add(new Int32Field("trieInt", id, Field.Store.NO)); + doc.Add(new Int64Field("trieLong", (long)id, Field.Store.NO)); // add docvalues fields doc.Add(new NumericDocValuesField("dvByte", (sbyte)id)); sbyte[] bytes = new sbyte[] { (sbyte)((int)((uint)id >> 24)), (sbyte)((int)((uint)id >> 16)), (sbyte)((int)((uint)id >> 8)), (sbyte)id }; @@ -686,7 +686,7 @@ namespace Lucene.Net.Index doc.Add(new BinaryDocValuesField("dvBytesStraightFixed", @ref)); doc.Add(new BinaryDocValuesField("dvBytesStraightVar", @ref)); doc.Add(new DoubleDocValuesField("dvDouble", (double)id)); - doc.Add(new FloatDocValuesField("dvFloat", (float)id)); + doc.Add(new SingleDocValuesField("dvFloat", (float)id)); doc.Add(new NumericDocValuesField("dvInt", id)); doc.Add(new NumericDocValuesField("dvLong", id)); doc.Add(new NumericDocValuesField("dvPacked", id)); @@ -846,7 +846,7 @@ namespace Lucene.Net.Index Assert.AreEqual(34, hits_.Length, "wrong number of hits"); // check decoding into field cache - FieldCache.Ints fci = FieldCache.DEFAULT.GetInt32s(SlowCompositeReaderWrapper.Wrap(searcher.IndexReader), "trieInt", false); + FieldCache.Int32s fci = FieldCache.DEFAULT.GetInt32s(SlowCompositeReaderWrapper.Wrap(searcher.IndexReader), "trieInt", false); int maxDoc = searcher.IndexReader.MaxDoc; for (int doc = 0; doc < maxDoc; doc++) { @@ -854,7 +854,7 @@ namespace Lucene.Net.Index Assert.IsTrue(val >= 0 && val < 35, "value in id bounds"); } - FieldCache.Longs fcl = FieldCache.DEFAULT.GetInt64s(SlowCompositeReaderWrapper.Wrap(searcher.IndexReader), "trieLong", false); + FieldCache.Int64s fcl = FieldCache.DEFAULT.GetInt64s(SlowCompositeReaderWrapper.Wrap(searcher.IndexReader), "trieLong", false); for (int doc = 0; doc < maxDoc; doc++) { long val = fcl.Get(doc);
