lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [1/3] Sorting the mess with FieldCache and FieldCache_Fields
Date Fri, 19 Sep 2014 15:05:39 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 433a340a4 -> a85388772


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Core/Search/FieldComparator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/FieldComparator.cs b/src/Lucene.Net.Core/Search/FieldComparator.cs
index 3ebadff..4f6a760 100644
--- a/src/Lucene.Net.Core/Search/FieldComparator.cs
+++ b/src/Lucene.Net.Core/Search/FieldComparator.cs
@@ -82,7 +82,7 @@ namespace Lucene.Net.Search
     ///       when the search is switching to the next segment.
     ///       You may need to update internal state of the
     ///       comparator, for example retrieving new values from
-    ///       the <seealso cref="FieldCache"/>.
+    ///       the <seealso cref="IFieldCache"/>.
     ///
     ///  <li> <seealso cref="#value"/> Return the sort value stored in
     ///       the specified slot.  this is only called at the end
@@ -338,7 +338,7 @@ namespace Lucene.Net.Search
             {
                 if (MissingValue != null)
                 {
-                    DocsWithField = FieldCache_Fields.DEFAULT.GetDocsWithField((context.AtomicReader), Field);
+                    DocsWithField = FieldCache.DEFAULT.GetDocsWithField((context.AtomicReader), Field);
                     // optimization to remove unneeded checks on the bit interface:
                     if (DocsWithField is Lucene.Net.Util.Bits_MatchAllBits)
                     {
@@ -361,16 +361,16 @@ namespace Lucene.Net.Search
         public sealed class ByteComparator : NumericComparator<sbyte>
         {
             internal readonly sbyte[] Values;
-            internal readonly FieldCache_Fields.IByteParser Parser;
-            internal FieldCache_Fields.Bytes CurrentReaderValues;
+            internal readonly FieldCache.IByteParser Parser;
+            internal FieldCache.Bytes CurrentReaderValues;
             internal sbyte bottom;
             internal sbyte topValue;
 
-            internal ByteComparator(int numHits, string field, FieldCache_Fields.IParser parser, sbyte? missingValue)
+            internal ByteComparator(int numHits, string field, FieldCache.IParser parser, sbyte? missingValue)
                 : base(field, missingValue)
             {
                 Values = new sbyte[numHits];
-                this.Parser = (FieldCache_Fields.IByteParser)parser;
+                this.Parser = (FieldCache.IByteParser)parser;
             }
 
             public override int Compare(int slot1, int slot2)
@@ -408,7 +408,7 @@ namespace Lucene.Net.Search
             {
                 // NOTE: must do this before calling super otherwise
                 // we compute the docsWithField Bits twice!
-                CurrentReaderValues = FieldCache_Fields.DEFAULT.GetBytes((context.AtomicReader), Field, Parser, MissingValue != null);
+                CurrentReaderValues = FieldCache.DEFAULT.GetBytes((context.AtomicReader), Field, Parser, MissingValue != null);
                 return base.SetNextReader(context);
             }
 
@@ -454,16 +454,16 @@ namespace Lucene.Net.Search
         public sealed class DoubleComparator : NumericComparator<double>
         {
             internal readonly double[] Values;
-            internal readonly FieldCache_Fields.IDoubleParser Parser;
-            internal FieldCache_Fields.Doubles CurrentReaderValues;
+            internal readonly FieldCache.IDoubleParser Parser;
+            internal FieldCache.Doubles CurrentReaderValues;
             internal double Bottom_Renamed;
             internal double TopValue_Renamed;
 
-            internal DoubleComparator(int numHits, string field, FieldCache_Fields.IParser parser, double? missingValue)
+            internal DoubleComparator(int numHits, string field, FieldCache.IParser parser, double? missingValue)
                 : base(field, missingValue)
             {
                 Values = new double[numHits];
-                this.Parser = (FieldCache_Fields.IDoubleParser)parser;
+                this.Parser = (FieldCache.IDoubleParser)parser;
             }
 
             public override int Compare(int slot1, int slot2)
@@ -501,7 +501,7 @@ namespace Lucene.Net.Search
             {
                 // NOTE: must do this before calling super otherwise
                 // we compute the docsWithField Bits twice!
-                CurrentReaderValues = FieldCache_Fields.DEFAULT.GetDoubles((context.AtomicReader), Field, Parser, MissingValue != null);
+                CurrentReaderValues = FieldCache.DEFAULT.GetDoubles((context.AtomicReader), Field, Parser, MissingValue != null);
                 return base.SetNextReader(context);
             }
 
@@ -546,16 +546,16 @@ namespace Lucene.Net.Search
         public sealed class FloatComparator : NumericComparator<float>
         {
             internal readonly float[] Values;
-            internal readonly FieldCache_Fields.IFloatParser Parser;
-            internal FieldCache_Fields.Floats CurrentReaderValues;
+            internal readonly FieldCache.IFloatParser Parser;
+            internal FieldCache.Floats CurrentReaderValues;
             internal float Bottom_Renamed;
             internal float TopValue_Renamed;
 
-            internal FloatComparator(int numHits, string field, FieldCache_Fields.IParser parser, float? missingValue)
+            internal FloatComparator(int numHits, string field, FieldCache.IParser parser, float? missingValue)
                 : base(field, missingValue)
             {
                 Values = new float[numHits];
-                this.Parser = (FieldCache_Fields.IFloatParser)parser;
+                this.Parser = (FieldCache.IFloatParser)parser;
             }
 
             public override int Compare(int slot1, int slot2)
@@ -594,7 +594,7 @@ namespace Lucene.Net.Search
             {
                 // NOTE: must do this before calling super otherwise
                 // we compute the docsWithField Bits twice!
-                CurrentReaderValues = FieldCache_Fields.DEFAULT.GetFloats((context.AtomicReader), Field, Parser, MissingValue != null);
+                CurrentReaderValues = FieldCache.DEFAULT.GetFloats((context.AtomicReader), Field, Parser, MissingValue != null);
                 return base.SetNextReader(context);
             }
 
@@ -640,16 +640,16 @@ namespace Lucene.Net.Search
         public sealed class ShortComparator : NumericComparator<short>
         {
             internal readonly short[] Values;
-            internal readonly FieldCache_Fields.IShortParser Parser;
-            internal FieldCache_Fields.Shorts CurrentReaderValues;
+            internal readonly FieldCache.IShortParser Parser;
+            internal FieldCache.Shorts CurrentReaderValues;
             internal short Bottom_Renamed;
             internal short TopValue_Renamed;
 
-            internal ShortComparator(int numHits, string field, FieldCache_Fields.IParser parser, short? missingValue)
+            internal ShortComparator(int numHits, string field, FieldCache.IParser parser, short? missingValue)
                 : base(field, missingValue)
             {
                 Values = new short[numHits];
-                this.Parser = (FieldCache_Fields.IShortParser)parser;
+                this.Parser = (FieldCache.IShortParser)parser;
             }
 
             public override int Compare(int slot1, int slot2)
@@ -689,7 +689,7 @@ namespace Lucene.Net.Search
             {
                 // NOTE: must do this before calling super otherwise
                 // we compute the docsWithField Bits twice!
-                CurrentReaderValues = FieldCache_Fields.DEFAULT.GetShorts((context.AtomicReader), Field, Parser, MissingValue != null);
+                CurrentReaderValues = FieldCache.DEFAULT.GetShorts((context.AtomicReader), Field, Parser, MissingValue != null);
                 return base.SetNextReader(context);
             }
 
@@ -734,16 +734,16 @@ namespace Lucene.Net.Search
         public sealed class IntComparator : NumericComparator<int>
         {
             internal readonly int[] Values;
-            internal readonly FieldCache_Fields.IIntParser Parser;
-            internal FieldCache_Fields.Ints CurrentReaderValues;
+            internal readonly FieldCache.IIntParser Parser;
+            internal FieldCache.Ints CurrentReaderValues;
             internal int Bottom_Renamed; // Value of bottom of queue
             internal int TopValue_Renamed;
 
-            internal IntComparator(int numHits, string field, FieldCache_Fields.IParser parser, int? missingValue)
+            internal IntComparator(int numHits, string field, FieldCache.IParser parser, int? missingValue)
                 : base(field, missingValue)
             {
                 Values = new int[numHits];
-                this.Parser = (FieldCache_Fields.IIntParser)parser;
+                this.Parser = (FieldCache.IIntParser)parser;
             }
 
             public override int Compare(int slot1, int slot2)
@@ -780,7 +780,7 @@ namespace Lucene.Net.Search
             {
                 // NOTE: must do this before calling super otherwise
                 // we compute the docsWithField Bits twice!
-                CurrentReaderValues = FieldCache_Fields.DEFAULT.GetInts((context.AtomicReader), Field, Parser, MissingValue != null);
+                CurrentReaderValues = FieldCache.DEFAULT.GetInts((context.AtomicReader), Field, Parser, MissingValue != null);
                 return base.SetNextReader(context);
             }
 
@@ -825,16 +825,16 @@ namespace Lucene.Net.Search
         public sealed class LongComparator : NumericComparator<long>
         {
             internal readonly long[] Values;
-            internal readonly FieldCache_Fields.ILongParser Parser;
-            internal FieldCache_Fields.Longs CurrentReaderValues;
+            internal readonly FieldCache.ILongParser Parser;
+            internal FieldCache.Longs CurrentReaderValues;
             internal long Bottom_Renamed;
             internal long TopValue_Renamed;
 
-            internal LongComparator(int numHits, string field, FieldCache_Fields.IParser parser, long? missingValue)
+            internal LongComparator(int numHits, string field, FieldCache.IParser parser, long? missingValue)
                 : base(field, missingValue)
             {
                 Values = new long[numHits];
-                this.Parser = (FieldCache_Fields.ILongParser)parser;
+                this.Parser = (FieldCache.ILongParser)parser;
             }
 
             public override int Compare(int slot1, int slot2)
@@ -874,7 +874,7 @@ namespace Lucene.Net.Search
             {
                 // NOTE: must do this before calling super otherwise
                 // we compute the docsWithField Bits twice!
-                CurrentReaderValues = FieldCache_Fields.DEFAULT.GetLongs((context.AtomicReader), Field, Parser, MissingValue != null);
+                CurrentReaderValues = FieldCache.DEFAULT.GetLongs((context.AtomicReader), Field, Parser, MissingValue != null);
                 return base.SetNextReader(context);
             }
 
@@ -1083,7 +1083,7 @@ namespace Lucene.Net.Search
         ///  ordinals.  this is functionally equivalent to {@link
         ///  Lucene.Net.Search.FieldComparator.TermValComparator}, but it first resolves the string
         ///  to their relative ordinal positions (using the index
-        ///  returned by <seealso cref="FieldCache#getTermsIndex"/>), and
+        ///  returned by <seealso cref="IFieldCache#getTermsIndex"/>), and
         ///  does most comparisons using the ordinals.  For medium
         ///  to large results, this comparator will be much faster
         ///  than <seealso cref="Lucene.Net.Search.FieldComparator.TermValComparator"/>.  For very small
@@ -1259,7 +1259,7 @@ namespace Lucene.Net.Search
             /// Retrieves the SortedDocValues for the field in this segment </summary>
             protected internal virtual SortedDocValues GetSortedDocValues(AtomicReaderContext context, string field)
             {
-                return FieldCache_Fields.DEFAULT.GetTermsIndex((context.AtomicReader), field);
+                return FieldCache.DEFAULT.GetTermsIndex((context.AtomicReader), field);
             }
 
             public override FieldComparator SetNextReader(AtomicReaderContext context)
@@ -1473,8 +1473,8 @@ namespace Lucene.Net.Search
 
             public override FieldComparator SetNextReader(AtomicReaderContext context)
             {
-                DocTerms = FieldCache_Fields.DEFAULT.GetTerms((context.AtomicReader), Field, true);
-                DocsWithField = FieldCache_Fields.DEFAULT.GetDocsWithField((context.AtomicReader), Field);
+                DocTerms = FieldCache.DEFAULT.GetTerms((context.AtomicReader), Field, true);
+                DocsWithField = FieldCache.DEFAULT.GetDocsWithField((context.AtomicReader), Field);
                 return this;
             }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Core/Search/FieldValueFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/FieldValueFilter.cs b/src/Lucene.Net.Core/Search/FieldValueFilter.cs
index 9b78022..925d169 100644
--- a/src/Lucene.Net.Core/Search/FieldValueFilter.cs
+++ b/src/Lucene.Net.Core/Search/FieldValueFilter.cs
@@ -27,7 +27,7 @@ namespace Lucene.Net.Search
     /// <summary>
     /// A <seealso cref="Filter"/> that accepts all documents that have one or more values in a
     /// given field. this <seealso cref="Filter"/> request <seealso cref="Bits"/> from the
-    /// <seealso cref="FieldCache"/> and build the bits if not present.
+    /// <seealso cref="IFieldCache"/> and build the bits if not present.
     /// </summary>
     public class FieldValueFilter : Filter
     {
@@ -77,7 +77,7 @@ namespace Lucene.Net.Search
 
         public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs)
         {
-            Bits docsWithField = FieldCache_Fields.DEFAULT.GetDocsWithField(((AtomicReader)context.Reader), Field_Renamed);
+            Bits docsWithField = FieldCache.DEFAULT.GetDocsWithField(((AtomicReader)context.Reader), Field_Renamed);
             if (Negate_Renamed)
             {
                 if (docsWithField is Bits_MatchAllBits)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Core/Search/SortField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/SortField.cs b/src/Lucene.Net.Core/Search/SortField.cs
index b74b9c4..84a5935 100644
--- a/src/Lucene.Net.Core/Search/SortField.cs
+++ b/src/Lucene.Net.Core/Search/SortField.cs
@@ -132,7 +132,7 @@ namespace Lucene.Net.Search
         private string field;
         private Type_e type; // defaults to determining type dynamically
         internal bool reverse = false; // defaults to natural order
-        private FieldCache_Fields.IParser parser;
+        private FieldCache.IParser parser;
 
         // Used for CUSTOM sort
         private FieldComparatorSource comparatorSource;
@@ -166,53 +166,53 @@ namespace Lucene.Net.Search
 
         /// <summary>
         /// Creates a sort by terms in the given field, parsed
-        /// to numeric values using a custom <seealso cref="FieldCache.Parser"/>. </summary>
+        /// to numeric values using a custom <seealso cref="IFieldCache.Parser"/>. </summary>
         /// <param name="field">  Name of field to sort by.  Must not be null. </param>
-        /// <param name="parser"> Instance of a <seealso cref="FieldCache.Parser"/>,
+        /// <param name="parser"> Instance of a <seealso cref="IFieldCache.Parser"/>,
         ///  which must subclass one of the existing numeric
-        ///  parsers from <seealso cref="FieldCache"/>. Sort type is inferred
+        ///  parsers from <seealso cref="IFieldCache"/>. Sort type is inferred
         ///  by testing which numeric parser the parser subclasses. </param>
         /// <exception cref="IllegalArgumentException"> if the parser fails to
         ///  subclass an existing numeric parser, or field is null </exception>
-        public SortField(string field, FieldCache_Fields.IParser parser)
+        public SortField(string field, FieldCache.IParser parser)
             : this(field, parser, false)
         {
         }
 
         /// <summary>
         /// Creates a sort, possibly in reverse, by terms in the given field, parsed
-        /// to numeric values using a custom <seealso cref="FieldCache.Parser"/>. </summary>
+        /// to numeric values using a custom <seealso cref="IFieldCache.Parser"/>. </summary>
         /// <param name="field">  Name of field to sort by.  Must not be null. </param>
-        /// <param name="parser"> Instance of a <seealso cref="FieldCache.Parser"/>,
+        /// <param name="parser"> Instance of a <seealso cref="IFieldCache.Parser"/>,
         ///  which must subclass one of the existing numeric
-        ///  parsers from <seealso cref="FieldCache"/>. Sort type is inferred
+        ///  parsers from <seealso cref="IFieldCache"/>. Sort type is inferred
         ///  by testing which numeric parser the parser subclasses. </param>
         /// <param name="reverse"> True if natural order should be reversed. </param>
         /// <exception cref="IllegalArgumentException"> if the parser fails to
         ///  subclass an existing numeric parser, or field is null </exception>
-        public SortField(string field, FieldCache_Fields.IParser parser, bool reverse)
+        public SortField(string field, FieldCache.IParser parser, bool reverse)
         {
-            if (parser is FieldCache_Fields.IIntParser)
+            if (parser is FieldCache.IIntParser)
             {
                 InitFieldType(field, Type_e.INT);
             }
-            else if (parser is FieldCache_Fields.IFloatParser)
+            else if (parser is FieldCache.IFloatParser)
             {
                 InitFieldType(field, Type_e.FLOAT);
             }
-            else if (parser is FieldCache_Fields.IShortParser)
+            else if (parser is FieldCache.IShortParser)
             {
                 InitFieldType(field, Type_e.SHORT);
             }
-            else if (parser is FieldCache_Fields.IByteParser)
+            else if (parser is FieldCache.IByteParser)
             {
                 InitFieldType(field, Type_e.BYTE);
             }
-            else if (parser is FieldCache_Fields.ILongParser)
+            else if (parser is FieldCache.ILongParser)
             {
                 InitFieldType(field, Type_e.LONG);
             }
-            else if (parser is FieldCache_Fields.IDoubleParser)
+            else if (parser is FieldCache.IDoubleParser)
             {
                 InitFieldType(field, Type_e.DOUBLE);
             }
@@ -344,10 +344,10 @@ namespace Lucene.Net.Search
         }
 
         /// <summary>
-        /// Returns the instance of a <seealso cref="FieldCache"/> parser that fits to the given sort type.
+        /// Returns the instance of a <seealso cref="IFieldCache"/> parser that fits to the given sort type.
         /// May return <code>null</code> if no parser was specified. Sorting is using the default parser then. </summary>
-        /// <returns> An instance of a <seealso cref="FieldCache"/> parser, or <code>null</code>. </returns>
-        public virtual FieldCache_Fields.IParser Parser
+        /// <returns> An instance of a <seealso cref="IFieldCache"/> parser, or <code>null</code>. </returns>
+        public virtual FieldCache.IParser Parser
         {
             get
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs b/src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs
index 81b746a..d6064f0 100644
--- a/src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs
+++ b/src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs
@@ -6,8 +6,6 @@ namespace Lucene.Net.Util
 {
     using Lucene.Net.Search;
     using AlreadyClosedException = Lucene.Net.Store.AlreadyClosedException;
-    using FieldCache = Lucene.Net.Search.FieldCache;
-
     /// <summary>
     /// Copyright 2009 The Apache Software Foundation
     ///
@@ -71,7 +69,7 @@ namespace Lucene.Net.Util
         /// <summary>
         /// Quick and dirty convenience method </summary>
         /// <seealso cref= #check </seealso>
-        public static Insanity[] CheckSanity(FieldCache cache)
+        public static Insanity[] CheckSanity(IFieldCache cache)
         {
             return CheckSanity(cache.CacheEntries);
         }
@@ -80,7 +78,7 @@ namespace Lucene.Net.Util
         /// Quick and dirty convenience method that instantiates an instance with
         /// "good defaults" and uses it to test the CacheEntrys </summary>
         /// <seealso cref= #check </seealso>
-        public static Insanity[] CheckSanity(params FieldCache_Fields.CacheEntry[] cacheEntries)
+        public static Insanity[] CheckSanity(params FieldCache.CacheEntry[] cacheEntries)
         {
             FieldCacheSanityChecker sanityChecker = new FieldCacheSanityChecker();
             sanityChecker.RamUsageEstimator = true;
@@ -94,7 +92,7 @@ namespace Lucene.Net.Util
         /// (:TODO: is this a bad idea? are we masking a real problem?)
         /// </p>
         /// </summary>
-        public Insanity[] Check(params FieldCache_Fields.CacheEntry[] cacheEntries)
+        public Insanity[] Check(params FieldCache.CacheEntry[] cacheEntries)
         {
             if (null == cacheEntries || 0 == cacheEntries.Length)
             {
@@ -112,7 +110,7 @@ namespace Lucene.Net.Util
             // the indirect mapping lets MapOfSet dedup identical valIds for us
             // maps the (valId) identityhashCode of cache values to
             // sets of CacheEntry instances
-            MapOfSets<int, FieldCache_Fields.CacheEntry> valIdToItems = new MapOfSets<int, FieldCache_Fields.CacheEntry>(new Dictionary<int, HashSet<FieldCache_Fields.CacheEntry>>(17));
+            MapOfSets<int, FieldCache.CacheEntry> valIdToItems = new MapOfSets<int, FieldCache.CacheEntry>(new Dictionary<int, HashSet<FieldCache.CacheEntry>>(17));
             // maps ReaderField keys to Sets of ValueIds
             MapOfSets<ReaderField, int> readerFieldToValIds = new MapOfSets<ReaderField, int>(new Dictionary<ReaderField, HashSet<int>>(17));
 
@@ -122,7 +120,7 @@ namespace Lucene.Net.Util
             // iterate over all the cacheEntries to get the mappings we'll need
             for (int i = 0; i < cacheEntries.Length; i++)
             {
-                FieldCache_Fields.CacheEntry item = cacheEntries[i];
+                FieldCache.CacheEntry item = cacheEntries[i];
                 object val = item.Value;
 
                 // It's OK to have dup entries, where one is eg
@@ -133,7 +131,7 @@ namespace Lucene.Net.Util
                     continue;
                 }
 
-                if (val is Lucene.Net.Search.FieldCache_Fields.CreationPlaceholder)
+                if (val is Lucene.Net.Search.FieldCache.CreationPlaceholder)
                 {
                     continue;
                 }
@@ -164,7 +162,7 @@ namespace Lucene.Net.Util
         /// instances accordingly.  The MapOfSets are used to populate
         /// the Insanity objects. </summary>
         /// <seealso cref= InsanityType#VALUEMISMATCH </seealso>
-        private ICollection<Insanity> CheckValueMismatch(MapOfSets<int, FieldCache_Fields.CacheEntry> valIdToItems, MapOfSets<ReaderField, int> readerFieldToValIds, ISet<ReaderField> valMismatchKeys)
+        private ICollection<Insanity> CheckValueMismatch(MapOfSets<int, FieldCache.CacheEntry> valIdToItems, MapOfSets<ReaderField, int> readerFieldToValIds, ISet<ReaderField> valMismatchKeys)
         {
             List<Insanity> insanity = new List<Insanity>(valMismatchKeys.Count * 3);
 
@@ -173,19 +171,19 @@ namespace Lucene.Net.Util
                 // we have multiple values for some ReaderFields
 
                 IDictionary<ReaderField, HashSet<int>> rfMap = readerFieldToValIds.Map;
-                IDictionary<int, HashSet<FieldCache_Fields.CacheEntry>> valMap = valIdToItems.Map;
+                IDictionary<int, HashSet<FieldCache.CacheEntry>> valMap = valIdToItems.Map;
                 foreach (ReaderField rf in valMismatchKeys)
                 {
-                    IList<FieldCache_Fields.CacheEntry> badEntries = new List<FieldCache_Fields.CacheEntry>(valMismatchKeys.Count * 2);
+                    IList<FieldCache.CacheEntry> badEntries = new List<FieldCache.CacheEntry>(valMismatchKeys.Count * 2);
                     foreach (int value in rfMap[rf])
                     {
-                        foreach (FieldCache_Fields.CacheEntry cacheEntry in valMap[value])
+                        foreach (FieldCache.CacheEntry cacheEntry in valMap[value])
                         {
                             badEntries.Add(cacheEntry);
                         }
                     }
 
-                    FieldCache_Fields.CacheEntry[] badness = new FieldCache_Fields.CacheEntry[badEntries.Count];
+                    FieldCache.CacheEntry[] badness = new FieldCache.CacheEntry[badEntries.Count];
                     badness = badEntries.ToArray(); //LUCENE TO-DO had param of badness before
 
                     insanity.Add(new Insanity(InsanityType.VALUEMISMATCH, "Multiple distinct value objects for " + rf.ToString(), badness));
@@ -201,14 +199,14 @@ namespace Lucene.Net.Util
         /// found that have an ancestry relationships.
         /// </summary>
         /// <seealso cref= InsanityType#SUBREADER </seealso>
-        private ICollection<Insanity> CheckSubreaders(MapOfSets<int, FieldCache_Fields.CacheEntry> valIdToItems, MapOfSets<ReaderField, int> readerFieldToValIds)
+        private ICollection<Insanity> CheckSubreaders(MapOfSets<int, FieldCache.CacheEntry> valIdToItems, MapOfSets<ReaderField, int> readerFieldToValIds)
         {
             List<Insanity> insanity = new List<Insanity>(23);
 
             Dictionary<ReaderField, HashSet<ReaderField>> badChildren = new Dictionary<ReaderField, HashSet<ReaderField>>(17);
             MapOfSets<ReaderField, ReaderField> badKids = new MapOfSets<ReaderField, ReaderField>(badChildren); // wrapper
 
-            IDictionary<int, HashSet<FieldCache_Fields.CacheEntry>> viToItemSets = valIdToItems.Map;
+            IDictionary<int, HashSet<FieldCache.CacheEntry>> viToItemSets = valIdToItems.Map;
             IDictionary<ReaderField, HashSet<int>> rfToValIdSets = readerFieldToValIds.Map;
 
             HashSet<ReaderField> seen = new HashSet<ReaderField>();
@@ -249,7 +247,7 @@ namespace Lucene.Net.Util
             {
                 HashSet<ReaderField> kids = badChildren[parent];
 
-                List<FieldCache_Fields.CacheEntry> badEntries = new List<FieldCache_Fields.CacheEntry>(kids.Count * 2);
+                List<FieldCache.CacheEntry> badEntries = new List<FieldCache.CacheEntry>(kids.Count * 2);
 
                 // put parent entr(ies) in first
                 {
@@ -268,7 +266,7 @@ namespace Lucene.Net.Util
                     }
                 }
 
-                FieldCache_Fields.CacheEntry[] badness = new FieldCache_Fields.CacheEntry[badEntries.Count];
+                FieldCache.CacheEntry[] badness = new FieldCache.CacheEntry[badEntries.Count];
                 badness = badEntries.ToArray();//LUCENE TO-DO had param of badness first
 
                 insanity.Add(new Insanity(InsanityType.SUBREADER, "Found caches for descendants of " + parent.ToString(), badness));
@@ -360,9 +358,9 @@ namespace Lucene.Net.Util
         {
             internal readonly InsanityType Type_Renamed;
             internal readonly string Msg_Renamed;
-            internal readonly FieldCache_Fields.CacheEntry[] Entries;
+            internal readonly FieldCache.CacheEntry[] Entries;
 
-            public Insanity(InsanityType type, string msg, params FieldCache_Fields.CacheEntry[] entries)
+            public Insanity(InsanityType type, string msg, params FieldCache.CacheEntry[] entries)
             {
                 if (null == type)
                 {
@@ -402,7 +400,7 @@ namespace Lucene.Net.Util
             /// <summary>
             /// CacheEntry objects which suggest a problem
             /// </summary>
-            public FieldCache_Fields.CacheEntry[] CacheEntries
+            public FieldCache.CacheEntry[] CacheEntries
             {
                 get
                 {
@@ -428,7 +426,7 @@ namespace Lucene.Net.Util
 
                 buf.Append('\n');
 
-                FieldCache_Fields.CacheEntry[] ce = CacheEntries;
+                FieldCache.CacheEntry[] ce = CacheEntries;
                 for (int i = 0; i < ce.Length; i++)
                 {
                     buf.Append('\t').Append(ce[i].ToString()).Append('\n');

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/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 bf74ea8..0bdbdbf 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
@@ -4,6 +4,7 @@ using Lucene.Net.Randomized.Generators;
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
+using Lucene.Net.Search;
 
 namespace Lucene.Net.Index
 {
@@ -37,7 +38,6 @@ namespace Lucene.Net.Index
     using Directory = Lucene.Net.Store.Directory;
     using Document = Documents.Document;
     using Field = Field;
-    using FieldCache_Fields = Lucene.Net.Search.FieldCache_Fields;
     using FloatDocValuesField = FloatDocValuesField;
     using IndexSearcher = Lucene.Net.Search.IndexSearcher;
     using Lucene42DocValuesFormat = Lucene.Net.Codecs.Lucene42.Lucene42DocValuesFormat;
@@ -1480,8 +1480,8 @@ namespace Lucene.Net.Index
             foreach (AtomicReaderContext context in ir.Leaves)
             {
                 AtomicReader r = context.AtomicReader;
-                Bits expected = FieldCache_Fields.DEFAULT.GetDocsWithField(r, "indexed");
-                Bits actual = FieldCache_Fields.DEFAULT.GetDocsWithField(r, "dv");
+                Bits expected = FieldCache.DEFAULT.GetDocsWithField(r, "indexed");
+                Bits actual = FieldCache.DEFAULT.GetDocsWithField(r, "dv");
                 Assert.AreEqual(expected, actual);
             }
             ir.Dispose();
@@ -1780,7 +1780,7 @@ namespace Lucene.Net.Index
             foreach (AtomicReaderContext context in ir.Leaves)
             {
                 AtomicReader r = context.AtomicReader;
-                SortedDocValues expected = FieldCache_Fields.DEFAULT.GetTermsIndex(r, "indexed");
+                SortedDocValues expected = FieldCache.DEFAULT.GetTermsIndex(r, "indexed");
                 SortedDocValues actual = r.GetSortedDocValues("dv");
                 AssertEquals(r.MaxDoc, expected, actual);
             }
@@ -2628,7 +2628,7 @@ namespace Lucene.Net.Index
             foreach (AtomicReaderContext context in ir.Leaves)
             {
                 AtomicReader r = context.AtomicReader;
-                SortedSetDocValues expected = FieldCache_Fields.DEFAULT.GetDocTermOrds(r, "indexed");
+                SortedSetDocValues expected = FieldCache.DEFAULT.GetDocTermOrds(r, "indexed");
                 SortedSetDocValues actual = r.GetSortedSetDocValues("dv");
                 AssertEquals(r.MaxDoc, expected, actual);
             }
@@ -2639,7 +2639,7 @@ namespace Lucene.Net.Index
             // now compare again after the merge
             ir = writer.Reader;
             AtomicReader ar = GetOnlySegmentReader(ir);
-            SortedSetDocValues expected_ = FieldCache_Fields.DEFAULT.GetDocTermOrds(ar, "indexed");
+            SortedSetDocValues expected_ = FieldCache.DEFAULT.GetDocTermOrds(ar, "indexed");
             SortedSetDocValues actual_ = ar.GetSortedSetDocValues("dv");
             AssertEquals(ir.MaxDoc, expected_, actual_);
             ir.Dispose();
@@ -3052,7 +3052,7 @@ namespace Lucene.Net.Index
 
             AtomicReader ar = SlowCompositeReaderWrapper.Wrap(r);
 
-            BinaryDocValues s = FieldCache_Fields.DEFAULT.GetTerms(ar, "field", false);
+            BinaryDocValues s = FieldCache.DEFAULT.GetTerms(ar, "field", false);
             for (int docID = 0; docID < docBytes.Count; docID++)
             {
                 Document doc = ar.Document(docID);
@@ -3137,7 +3137,7 @@ namespace Lucene.Net.Index
 
             AtomicReader ar = SlowCompositeReaderWrapper.Wrap(r);
 
-            BinaryDocValues s = FieldCache_Fields.DEFAULT.GetTerms(ar, "field", false);
+            BinaryDocValues s = FieldCache.DEFAULT.GetTerms(ar, "field", false);
             for (int docID = 0; docID < docBytes.Count; docID++)
             {
                 Document doc = ar.Document(docID);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/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 d9dc84a..9eef7af 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
@@ -2,6 +2,7 @@ using Apache.NMS.Util;
 using Lucene.Net.Codecs;
 using Lucene.Net.Documents;
 using Lucene.Net.Randomized.Generators;
+using Lucene.Net.Search;
 using Lucene.Net.Support;
 using Lucene.Net.Util;
 using NUnit.Framework;
@@ -19,7 +20,6 @@ namespace Lucene.Net.Index
     using Document = Documents.Document;
     using DoubleField = DoubleField;
     using Field = Field;
-    using FieldCache_Fields = Lucene.Net.Search.FieldCache_Fields;
     using FieldType = FieldType;
     using FloatField = FloatField;
     using IndexSearcher = Lucene.Net.Search.IndexSearcher;
@@ -330,7 +330,7 @@ namespace Lucene.Net.Index
             foreach (AtomicReaderContext ctx in r.Leaves)
             {
                 AtomicReader sub = (AtomicReader)ctx.Reader;
-                FieldCache_Fields.Ints ids = FieldCache_Fields.DEFAULT.GetInts(sub, "id", false);
+                FieldCache.Ints ids = FieldCache.DEFAULT.GetInts(sub, "id", false);
                 for (int docID = 0; docID < sub.NumDocs; docID++)
                 {
                     Document doc = sub.Document(docID);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Search/QueryUtils.cs b/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
index 1604347..6cf5f1d 100644
--- a/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
+++ b/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
@@ -157,7 +157,7 @@ namespace Lucene.Net.Search
         public static void PurgeFieldCache(IndexReader r)
         {
             // this is just a hack, to get an atomic reader that contains all subreaders for insanity checks
-            FieldCache_Fields.DEFAULT.PurgeByCacheKey(SlowCompositeReaderWrapper.Wrap(r).CoreCacheKey);
+            FieldCache.DEFAULT.PurgeByCacheKey(SlowCompositeReaderWrapper.Wrap(r).CoreCacheKey);
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
index 700433a..4139f9d 100644
--- a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
@@ -20,6 +20,7 @@ using Lucene.Net.Documents;
 using Lucene.Net.Index;
 using Lucene.Net.Randomized;
 using Lucene.Net.Randomized.Generators;
+using Lucene.Net.Search;
 using Lucene.Net.Support;
 using NUnit.Framework;
 using System;
@@ -44,7 +45,7 @@ namespace Lucene.Net.Util
     using AutomatonTestUtil = Lucene.Net.Util.Automaton.AutomatonTestUtil;
     using BaseDirectoryWrapper = Lucene.Net.Store.BaseDirectoryWrapper;
     using BinaryDocValues = Lucene.Net.Index.BinaryDocValues;
-    using CacheEntry = Lucene.Net.Search.FieldCache_Fields.CacheEntry;
+    using CacheEntry = Lucene.Net.Search.FieldCache.CacheEntry;
     using Codec = Lucene.Net.Codecs.Codec;
     using CompiledAutomaton = Lucene.Net.Util.Automaton.CompiledAutomaton;
     using CompositeReader = Lucene.Net.Index.CompositeReader;
@@ -57,7 +58,6 @@ namespace Lucene.Net.Util
     using Document = Documents.Document;
     using FCInvisibleMultiReader = Lucene.Net.Search.QueryUtils.FCInvisibleMultiReader;
     using Field = Field;
-    using FieldCache_Fields = Lucene.Net.Search.FieldCache_Fields;
     using FieldFilterAtomicReader = Lucene.Net.Index.FieldFilterAtomicReader;
     using FieldInfo = Lucene.Net.Index.FieldInfo;
     using FieldInfos = Lucene.Net.Index.FieldInfos;
@@ -745,7 +745,7 @@ namespace Lucene.Net.Util
         /// <seealso cref= Lucene.Net.Util.FieldCacheSanityChecker </seealso>
         protected static void AssertSaneFieldCaches(string msg)
         {
-            CacheEntry[] entries = FieldCache_Fields.DEFAULT.CacheEntries;
+            CacheEntry[] entries = FieldCache.DEFAULT.CacheEntries;
             Insanity[] insanity = null;
             try
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs b/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
index d3c3a9d..88eb374 100644
--- a/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.IO;
 using System.Threading;
 using Lucene.Net.Documents;
+using Lucene.Net.Search;
 
 namespace Lucene.Net.Index
 {
@@ -14,7 +15,6 @@ namespace Lucene.Net.Index
     using DocIdSetIterator = Lucene.Net.Search.DocIdSetIterator;
     using Document = Documents.Document;
     using Field = Field;
-    using FieldCache_Fields = Lucene.Net.Search.FieldCache_Fields;
     using FieldType = FieldType;
     using Lucene41PostingsFormat = Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat;
     using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
@@ -793,7 +793,7 @@ namespace Lucene.Net.Index
             // Open reader1
             DirectoryReader r = DirectoryReader.Open(dir);
             AtomicReader r1 = GetOnlySegmentReader(r);
-            FieldCache_Fields.Ints ints = FieldCache_Fields.DEFAULT.GetInts(r1, "number", false);
+            FieldCache.Ints ints = FieldCache.DEFAULT.GetInts(r1, "number", false);
             Assert.AreEqual(17, ints.Get(0));
 
             // Add new segment
@@ -805,7 +805,7 @@ namespace Lucene.Net.Index
             Assert.IsNotNull(r2);
             r.Dispose();
             AtomicReader sub0 = (AtomicReader)r2.Leaves[0].Reader;
-            FieldCache_Fields.Ints ints2 = FieldCache_Fields.DEFAULT.GetInts(sub0, "number", false);
+            FieldCache.Ints ints2 = FieldCache.DEFAULT.GetInts(sub0, "number", false);
             r2.Dispose();
             Assert.IsTrue(ints == ints2);
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Tests/core/Index/TestDocTermOrds.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestDocTermOrds.cs b/src/Lucene.Net.Tests/core/Index/TestDocTermOrds.cs
index c985e67..54ef5eb 100644
--- a/src/Lucene.Net.Tests/core/Index/TestDocTermOrds.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestDocTermOrds.cs
@@ -2,6 +2,7 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using Lucene.Net.Documents;
+using Lucene.Net.Search;
 
 namespace Lucene.Net.Index
 {
@@ -30,7 +31,6 @@ namespace Lucene.Net.Index
     using Directory = Lucene.Net.Store.Directory;
     using Document = Documents.Document;
     using Field = Field;
-    using FieldCache_Fields = Lucene.Net.Search.FieldCache_Fields;
     using IntField = IntField;
     using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
     using MockAnalyzer = Lucene.Net.Analysis.MockAnalyzer;
@@ -188,7 +188,7 @@ namespace Lucene.Net.Index
             AtomicReader slowR = SlowCompositeReaderWrapper.Wrap(r);
             Verify(slowR, idToOrds, termsArray, null);
 
-            FieldCache_Fields.DEFAULT.PurgeByCacheKey(slowR.CoreCacheKey);
+            FieldCache.DEFAULT.PurgeByCacheKey(slowR.CoreCacheKey);
 
             r.Dispose();
             dir.Dispose();
@@ -327,7 +327,7 @@ namespace Lucene.Net.Index
                 Verify(slowR, idToOrdsPrefix, termsArray, prefixRef);
             }
 
-            FieldCache_Fields.DEFAULT.PurgeByCacheKey(slowR.CoreCacheKey);
+            FieldCache.DEFAULT.PurgeByCacheKey(slowR.CoreCacheKey);
 
             r.Dispose();
             dir.Dispose();
@@ -337,7 +337,7 @@ namespace Lucene.Net.Index
         {
             DocTermOrds dto = new DocTermOrds(r, r.LiveDocs, "field", prefixRef, int.MaxValue, TestUtil.NextInt(Random(), 2, 10));
 
-            FieldCache_Fields.Ints docIDToID = FieldCache_Fields.DEFAULT.GetInts(r, "id", false);
+            FieldCache.Ints docIDToID = FieldCache.DEFAULT.GetInts(r, "id", false);
             /*
               for(int docID=0;docID<subR.MaxDoc;docID++) {
               System.out.println("  docID=" + docID + " id=" + docIDToID[docID]);
@@ -446,9 +446,9 @@ namespace Lucene.Net.Index
             iw.DeleteDocuments(new Term("foo", "baz"));
             DirectoryReader r2 = DirectoryReader.Open(iw, true);
 
-            FieldCache_Fields.DEFAULT.GetDocTermOrds(GetOnlySegmentReader(r2), "foo");
+            FieldCache.DEFAULT.GetDocTermOrds(GetOnlySegmentReader(r2), "foo");
 
-            SortedSetDocValues v = FieldCache_Fields.DEFAULT.GetDocTermOrds(GetOnlySegmentReader(r1), "foo");
+            SortedSetDocValues v = FieldCache.DEFAULT.GetDocTermOrds(GetOnlySegmentReader(r1), "foo");
             Assert.AreEqual(2, v.ValueCount);
             v.Document = 1;
             Assert.AreEqual(1, v.NextOrd());
@@ -485,7 +485,7 @@ namespace Lucene.Net.Index
             iwriter.Dispose();
 
             AtomicReader ar = GetOnlySegmentReader(ireader);
-            SortedSetDocValues dv = FieldCache_Fields.DEFAULT.GetDocTermOrds(ar, "field");
+            SortedSetDocValues dv = FieldCache.DEFAULT.GetDocTermOrds(ar, "field");
             Assert.AreEqual(3, dv.ValueCount);
 
             TermsEnum termsEnum = dv.TermsEnum();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Tests/core/Index/TestDocValuesIndexing.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestDocValuesIndexing.cs b/src/Lucene.Net.Tests/core/Index/TestDocValuesIndexing.cs
index 713f64c..ea2ae46 100644
--- a/src/Lucene.Net.Tests/core/Index/TestDocValuesIndexing.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestDocValuesIndexing.cs
@@ -1,6 +1,7 @@
 using Apache.NMS.Util;
 using System;
 using Lucene.Net.Documents;
+using Lucene.Net.Search;
 
 namespace Lucene.Net.Index
 {
@@ -31,7 +32,6 @@ namespace Lucene.Net.Index
     using Directory = Lucene.Net.Store.Directory;
     using Document = Documents.Document;
     using Field = Field;
-    using FieldCache_Fields = Lucene.Net.Search.FieldCache_Fields;
     using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
     using MockAnalyzer = Lucene.Net.Analysis.MockAnalyzer;
     using NumericDocValuesField = NumericDocValuesField;
@@ -120,7 +120,7 @@ namespace Lucene.Net.Index
             w.ForceMerge(1);
             DirectoryReader r = w.Reader;
             w.Dispose();
-            Assert.AreEqual(17, FieldCache_Fields.DEFAULT.GetInts(GetOnlySegmentReader(r), "field", false).Get(0));
+            Assert.AreEqual(17, FieldCache.DEFAULT.GetInts(GetOnlySegmentReader(r), "field", false).Get(0));
             r.Dispose();
             d.Dispose();
         }
@@ -152,7 +152,7 @@ namespace Lucene.Net.Index
             w.ForceMerge(1);
             DirectoryReader r = w.Reader;
             w.Dispose();
-            Assert.AreEqual(17, FieldCache_Fields.DEFAULT.GetInts(GetOnlySegmentReader(r), "field", false).Get(0));
+            Assert.AreEqual(17, FieldCache.DEFAULT.GetInts(GetOnlySegmentReader(r), "field", false).Get(0));
             r.Dispose();
             d.Dispose();
         }
@@ -205,7 +205,7 @@ namespace Lucene.Net.Index
             w.AddDocument(doc);
             w.ForceMerge(1);
             DirectoryReader r = w.Reader;
-            BinaryDocValues s = FieldCache_Fields.DEFAULT.GetTerms(GetOnlySegmentReader(r), "field", false);
+            BinaryDocValues s = FieldCache.DEFAULT.GetTerms(GetOnlySegmentReader(r), "field", false);
 
             BytesRef bytes1 = new BytesRef();
             s.Get(0, bytes1);
@@ -898,7 +898,7 @@ namespace Lucene.Net.Index
             AtomicReader subR = (AtomicReader)r.Leaves[0].Reader;
             Assert.AreEqual(2, subR.NumDocs);
 
-            Bits bits = FieldCache_Fields.DEFAULT.GetDocsWithField(subR, "dv");
+            Bits bits = FieldCache.DEFAULT.GetDocsWithField(subR, "dv");
             Assert.IsTrue(bits.Get(0));
             Assert.IsTrue(bits.Get(1));
             r.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Tests/core/Index/TestDocValuesWithThreads.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestDocValuesWithThreads.cs b/src/Lucene.Net.Tests/core/Index/TestDocValuesWithThreads.cs
index f043947..014d330 100644
--- a/src/Lucene.Net.Tests/core/Index/TestDocValuesWithThreads.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestDocValuesWithThreads.cs
@@ -2,6 +2,7 @@ using Apache.NMS.Util;
 using System;
 using System.Collections.Generic;
 using Lucene.Net.Documents;
+using Lucene.Net.Search;
 
 namespace Lucene.Net.Index
 {
@@ -13,7 +14,6 @@ namespace Lucene.Net.Index
     using BytesRef = Lucene.Net.Util.BytesRef;
     using Directory = Lucene.Net.Store.Directory;
     using Document = Documents.Document;
-    using FieldCache_Fields = Lucene.Net.Search.FieldCache_Fields;
     using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
 
     /*
@@ -124,10 +124,10 @@ namespace Lucene.Net.Index
                 try
                 {
                     //NumericDocValues ndv = ar.GetNumericDocValues("number");
-                    FieldCache_Fields.Longs ndv = FieldCache_Fields.DEFAULT.GetLongs(Ar, "number", false);
+                    FieldCache.Longs ndv = FieldCache.DEFAULT.GetLongs(Ar, "number", false);
                     //BinaryDocValues bdv = ar.GetBinaryDocValues("bytes");
-                    BinaryDocValues bdv = FieldCache_Fields.DEFAULT.GetTerms(Ar, "bytes", false);
-                    SortedDocValues sdv = FieldCache_Fields.DEFAULT.GetTermsIndex(Ar, "sorted");
+                    BinaryDocValues bdv = FieldCache.DEFAULT.GetTerms(Ar, "bytes", false);
+                    SortedDocValues sdv = FieldCache.DEFAULT.GetTermsIndex(Ar, "sorted");
                     StartingGun.@await();
                     int iters = AtLeast(1000);
                     BytesRef scratch = new BytesRef();
@@ -138,27 +138,27 @@ namespace Lucene.Net.Index
                         switch (ThreadRandom.Next(6))
                         {
                             case 0:
-                                Assert.AreEqual((long)(sbyte)Numbers[docID], FieldCache_Fields.DEFAULT.GetBytes(Ar, "number", false).Get(docID));
+                                Assert.AreEqual((long)(sbyte)Numbers[docID], FieldCache.DEFAULT.GetBytes(Ar, "number", false).Get(docID));
                                 break;
 
                             case 1:
-                                Assert.AreEqual((long)(short)Numbers[docID], FieldCache_Fields.DEFAULT.GetShorts(Ar, "number", false).Get(docID));
+                                Assert.AreEqual((long)(short)Numbers[docID], FieldCache.DEFAULT.GetShorts(Ar, "number", false).Get(docID));
                                 break;
 
                             case 2:
-                                Assert.AreEqual((long)(int)Numbers[docID], FieldCache_Fields.DEFAULT.GetInts(Ar, "number", false).Get(docID));
+                                Assert.AreEqual((long)(int)Numbers[docID], FieldCache.DEFAULT.GetInts(Ar, "number", false).Get(docID));
                                 break;
 
                             case 3:
-                                Assert.AreEqual((long)Numbers[docID], FieldCache_Fields.DEFAULT.GetLongs(Ar, "number", false).Get(docID));
+                                Assert.AreEqual((long)Numbers[docID], FieldCache.DEFAULT.GetLongs(Ar, "number", false).Get(docID));
                                 break;
 
                             case 4:
-                                Assert.AreEqual(Number.IntBitsToFloat((int)Numbers[docID]), FieldCache_Fields.DEFAULT.GetFloats(Ar, "number", false).Get(docID), 0.0f);
+                                Assert.AreEqual(Number.IntBitsToFloat((int)Numbers[docID]), FieldCache.DEFAULT.GetFloats(Ar, "number", false).Get(docID), 0.0f);
                                 break;
 
                             case 5:
-                                Assert.AreEqual(BitConverter.Int64BitsToDouble((long)Numbers[docID]), FieldCache_Fields.DEFAULT.GetDoubles(Ar, "number", false).Get(docID), 0.0);
+                                Assert.AreEqual(BitConverter.Int64BitsToDouble((long)Numbers[docID]), FieldCache.DEFAULT.GetDoubles(Ar, "number", false).Get(docID), 0.0);
                                 break;
                         }
                         bdv.Get(docID, scratch);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Tests/core/Index/TestIndexWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriter.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriter.cs
index afa0b1a..5b4ff59 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriter.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriter.cs
@@ -4,6 +4,7 @@ using System.Collections.Generic;
 using System.Text;
 using System.Threading;
 using Lucene.Net.Documents;
+using Lucene.Net.Search;
 
 namespace Lucene.Net.Index
 {
@@ -47,7 +48,6 @@ namespace Lucene.Net.Index
     using DocIdSetIterator = Lucene.Net.Search.DocIdSetIterator;
     using Document = Documents.Document;
     using Field = Field;
-    using FieldCache_Fields = Lucene.Net.Search.FieldCache_Fields;
     using FieldType = FieldType;
     using IndexOutput = Lucene.Net.Store.IndexOutput;
     using IndexSearcher = Lucene.Net.Search.IndexSearcher;
@@ -2001,7 +2001,7 @@ namespace Lucene.Net.Index
             w.Dispose();
             Assert.AreEqual(1, reader.DocFreq(new Term("content", bigTerm)));
 
-            SortedDocValues dti = FieldCache_Fields.DEFAULT.GetTermsIndex(SlowCompositeReaderWrapper.Wrap(reader), "content", (float)Random().NextDouble() * PackedInts.FAST);
+            SortedDocValues dti = FieldCache.DEFAULT.GetTermsIndex(SlowCompositeReaderWrapper.Wrap(reader), "content", (float)Random().NextDouble() * PackedInts.FAST);
             Assert.AreEqual(4, dti.ValueCount);
             BytesRef br = new BytesRef();
             dti.LookupOrd(2, br);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Tests/core/Index/TestPostingsOffsets.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestPostingsOffsets.cs b/src/Lucene.Net.Tests/core/Index/TestPostingsOffsets.cs
index 26f0ffc..c1e355a 100644
--- a/src/Lucene.Net.Tests/core/Index/TestPostingsOffsets.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestPostingsOffsets.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
 using Lucene.Net.Documents;
+using Lucene.Net.Search;
 
 namespace Lucene.Net.Index
 {
@@ -34,7 +35,6 @@ namespace Lucene.Net.Index
     using Document = Documents.Document;
     using English = Lucene.Net.Util.English;
     using Field = Field;
-    using FieldCache_Fields = Lucene.Net.Search.FieldCache_Fields;
     using FieldType = FieldType;
     using IntField = IntField;
     using IOUtils = Lucene.Net.Util.IOUtils;
@@ -330,7 +330,7 @@ namespace Lucene.Net.Index
                 DocsEnum docs = null;
                 DocsAndPositionsEnum docsAndPositions = null;
                 DocsAndPositionsEnum docsAndPositionsAndOffsets = null;
-                FieldCache_Fields.Ints docIDToID = FieldCache_Fields.DEFAULT.GetInts(sub, "id", false);
+                FieldCache.Ints docIDToID = FieldCache.DEFAULT.GetInts(sub, "id", false);
                 foreach (string term in terms)
                 {
                     //System.out.println("  term=" + term);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Tests/core/Index/TestTermsEnum.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestTermsEnum.cs b/src/Lucene.Net.Tests/core/Index/TestTermsEnum.cs
index d2f4b8c..8a7ca1a 100644
--- a/src/Lucene.Net.Tests/core/Index/TestTermsEnum.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestTermsEnum.cs
@@ -2,6 +2,7 @@ using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using Lucene.Net.Documents;
+using Lucene.Net.Search;
 
 namespace Lucene.Net.Index
 {
@@ -15,7 +16,6 @@ namespace Lucene.Net.Index
     using DocIdSetIterator = Lucene.Net.Search.DocIdSetIterator;
     using Document = Documents.Document;
     using Field = Field;
-    using FieldCache_Fields = Lucene.Net.Search.FieldCache_Fields;
     using IntField = IntField;
     using LineFileDocs = Lucene.Net.Util.LineFileDocs;
     using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
@@ -279,7 +279,7 @@ namespace Lucene.Net.Index
             w.Dispose();
 
             // NOTE: intentional insanity!!
-            FieldCache_Fields.Ints docIDToID = FieldCache_Fields.DEFAULT.GetInts(SlowCompositeReaderWrapper.Wrap(r), "id", false);
+            FieldCache.Ints docIDToID = FieldCache.DEFAULT.GetInts(SlowCompositeReaderWrapper.Wrap(r), "id", false);
 
             for (int iter = 0; iter < 10 * RANDOM_MULTIPLIER; iter++)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Tests/core/Search/JustCompileSearch.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/JustCompileSearch.cs b/src/Lucene.Net.Tests/core/Search/JustCompileSearch.cs
index 593b7da..8859494 100644
--- a/src/Lucene.Net.Tests/core/Search/JustCompileSearch.cs
+++ b/src/Lucene.Net.Tests/core/Search/JustCompileSearch.cs
@@ -100,7 +100,7 @@ namespace Lucene.Net.Search
             }
         }
 
-        internal sealed class JustCompileExtendedFieldCacheLongParser : FieldCache_Fields.ILongParser
+        internal sealed class JustCompileExtendedFieldCacheLongParser : FieldCache.ILongParser
         {
             public long ParseLong(BytesRef @string)
             {
@@ -113,7 +113,7 @@ namespace Lucene.Net.Search
             }
         }
 
-        internal sealed class JustCompileExtendedFieldCacheDoubleParser : FieldCache_Fields.IDoubleParser
+        internal sealed class JustCompileExtendedFieldCacheDoubleParser : FieldCache.IDoubleParser
         {
             public double ParseDouble(BytesRef term)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Tests/core/Search/TestDocValuesScoring.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestDocValuesScoring.cs b/src/Lucene.Net.Tests/core/Search/TestDocValuesScoring.cs
index 4bc33b2..8c9eae4 100644
--- a/src/Lucene.Net.Tests/core/Search/TestDocValuesScoring.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestDocValuesScoring.cs
@@ -183,7 +183,7 @@ namespace Lucene.Net.Search
             public override SimScorer DoSimScorer(SimWeight stats, AtomicReaderContext context)
             {
                 SimScorer sub = Sim.DoSimScorer(stats, context);
-                FieldCache_Fields.Floats values = FieldCache_Fields.DEFAULT.GetFloats(context.AtomicReader, BoostField, false);
+                FieldCache.Floats values = FieldCache.DEFAULT.GetFloats(context.AtomicReader, BoostField, false);
 
                 return new SimScorerAnonymousInnerClassHelper(this, sub, values);
             }
@@ -193,9 +193,9 @@ namespace Lucene.Net.Search
                 private readonly BoostingSimilarity OuterInstance;
 
                 private SimScorer Sub;
-                private FieldCache_Fields.Floats Values;
+                private FieldCache.Floats Values;
 
-                public SimScorerAnonymousInnerClassHelper(BoostingSimilarity outerInstance, SimScorer sub, FieldCache_Fields.Floats values)
+                public SimScorerAnonymousInnerClassHelper(BoostingSimilarity outerInstance, SimScorer sub, FieldCache.Floats values)
                 {
                     this.OuterInstance = outerInstance;
                     this.Sub = sub;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Tests/core/Search/TestElevationComparator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestElevationComparator.cs b/src/Lucene.Net.Tests/core/Search/TestElevationComparator.cs
index d641ae7..c42295a 100644
--- a/src/Lucene.Net.Tests/core/Search/TestElevationComparator.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestElevationComparator.cs
@@ -222,7 +222,7 @@ namespace Lucene.Net.Search
 
             public override FieldComparator SetNextReader(AtomicReaderContext context)
             {
-                idIndex = FieldCache_Fields.DEFAULT.GetTermsIndex(context.AtomicReader, Fieldname);
+                idIndex = FieldCache.DEFAULT.GetTermsIndex(context.AtomicReader, Fieldname);
                 return this;
             }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Tests/core/Search/TestSort.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestSort.cs b/src/Lucene.Net.Tests/core/Search/TestSort.cs
index b0f7f2f..57b4f82 100644
--- a/src/Lucene.Net.Tests/core/Search/TestSort.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestSort.cs
@@ -1508,7 +1508,7 @@ namespace Lucene.Net.Search
             dir.Dispose();
         }
 
-        private class IntParserAnonymousInnerClassHelper : FieldCache_Fields.IIntParser
+        private class IntParserAnonymousInnerClassHelper : FieldCache.IIntParser
         {
             private readonly TestSort OuterInstance;
 
@@ -1565,7 +1565,7 @@ namespace Lucene.Net.Search
             dir.Dispose();
         }
 
-        private class ByteParserAnonymousInnerClassHelper : FieldCache_Fields.IByteParser
+        private class ByteParserAnonymousInnerClassHelper : FieldCache.IByteParser
         {
             private readonly TestSort OuterInstance;
 
@@ -1623,7 +1623,7 @@ namespace Lucene.Net.Search
             dir.Dispose();
         }
 
-        private class ShortParserAnonymousInnerClassHelper : FieldCache_Fields.IShortParser
+        private class ShortParserAnonymousInnerClassHelper : FieldCache.IShortParser
         {
             private readonly TestSort OuterInstance;
 
@@ -1680,7 +1680,7 @@ namespace Lucene.Net.Search
             dir.Dispose();
         }
 
-        private class LongParserAnonymousInnerClassHelper : FieldCache_Fields.ILongParser
+        private class LongParserAnonymousInnerClassHelper : FieldCache.ILongParser
         {
             private readonly TestSort OuterInstance;
 
@@ -1737,7 +1737,7 @@ namespace Lucene.Net.Search
             dir.Dispose();
         }
 
-        private class FloatParserAnonymousInnerClassHelper : FieldCache_Fields.IFloatParser
+        private class FloatParserAnonymousInnerClassHelper : FieldCache.IFloatParser
         {
             private readonly TestSort OuterInstance;
 
@@ -1795,7 +1795,7 @@ namespace Lucene.Net.Search
             dir.Dispose();
         }
 
-        private class DoubleParserAnonymousInnerClassHelper : FieldCache_Fields.IDoubleParser
+        private class DoubleParserAnonymousInnerClassHelper : FieldCache.IDoubleParser
         {
             private readonly TestSort OuterInstance;
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Tests/core/Search/TestSortDocValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestSortDocValues.cs b/src/Lucene.Net.Tests/core/Search/TestSortDocValues.cs
index 0201569..eb4eb94 100644
--- a/src/Lucene.Net.Tests/core/Search/TestSortDocValues.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestSortDocValues.cs
@@ -47,13 +47,13 @@ namespace Lucene.Net.Search
         {
             base.SetUp();
             // ensure there is nothing in fieldcache before test starts
-            FieldCache_Fields.DEFAULT.PurgeAllCaches();
+            FieldCache.DEFAULT.PurgeAllCaches();
         }
 
         private void AssertNoFieldCaches()
         {
             // docvalues sorting should NOT create any fieldcache entries!
-            Assert.AreEqual(0, FieldCache_Fields.DEFAULT.CacheEntries.Length);
+            Assert.AreEqual(0, FieldCache.DEFAULT.CacheEntries.Length);
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Tests/core/Search/TestSortRandom.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestSortRandom.cs b/src/Lucene.Net.Tests/core/Search/TestSortRandom.cs
index e8a8ed1..37c24cd 100644
--- a/src/Lucene.Net.Tests/core/Search/TestSortRandom.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestSortRandom.cs
@@ -346,7 +346,7 @@ namespace Lucene.Net.Search
             public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs)
             {
                 int maxDoc = context.Reader.MaxDoc;
-                FieldCache_Fields.Ints idSource = FieldCache_Fields.DEFAULT.GetInts(context.AtomicReader, "id", false);
+                FieldCache.Ints idSource = FieldCache.DEFAULT.GetInts(context.AtomicReader, "id", false);
                 Assert.IsNotNull(idSource);
                 FixedBitSet bits = new FixedBitSet(maxDoc);
                 for (int docID = 0; docID < maxDoc; docID++)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ddec100a/src/Lucene.Net.Tests/core/Util/TestFieldCacheSanityChecker.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Util/TestFieldCacheSanityChecker.cs b/src/Lucene.Net.Tests/core/Util/TestFieldCacheSanityChecker.cs
index 7610611..136e3c8 100644
--- a/src/Lucene.Net.Tests/core/Util/TestFieldCacheSanityChecker.cs
+++ b/src/Lucene.Net.Tests/core/Util/TestFieldCacheSanityChecker.cs
@@ -1,4 +1,5 @@
 using Lucene.Net.Documents;
+using Lucene.Net.Search;
 using NUnit.Framework;
 using System;
 
@@ -9,8 +10,6 @@ namespace Lucene.Net.Util
     using DirectoryReader = Lucene.Net.Index.DirectoryReader;
     using Document = Documents.Document;
     using Field = Field;
-    using FieldCache = Lucene.Net.Search.FieldCache;
-    using FieldCache_Fields = Lucene.Net.Search.FieldCache_Fields;
     using IndexWriter = Lucene.Net.Index.IndexWriter;
     using Insanity = Lucene.Net.Util.FieldCacheSanityChecker.Insanity;
     using InsanityType = Lucene.Net.Util.FieldCacheSanityChecker.InsanityType;
@@ -104,16 +103,16 @@ namespace Lucene.Net.Util
         [Test]
         public virtual void TestSanity()
         {
-            FieldCache cache = FieldCache_Fields.DEFAULT;
+            IFieldCache cache = FieldCache.DEFAULT;
             cache.PurgeAllCaches();
 
             cache.GetDoubles(ReaderA, "theDouble", false);
-            cache.GetDoubles(ReaderA, "theDouble", FieldCache_Fields.DEFAULT_DOUBLE_PARSER, false);
-            cache.GetDoubles(ReaderAclone, "theDouble", FieldCache_Fields.DEFAULT_DOUBLE_PARSER, false);
-            cache.GetDoubles(ReaderB, "theDouble", FieldCache_Fields.DEFAULT_DOUBLE_PARSER, false);
+            cache.GetDoubles(ReaderA, "theDouble", FieldCache.DEFAULT_DOUBLE_PARSER, false);
+            cache.GetDoubles(ReaderAclone, "theDouble", FieldCache.DEFAULT_DOUBLE_PARSER, false);
+            cache.GetDoubles(ReaderB, "theDouble", FieldCache.DEFAULT_DOUBLE_PARSER, false);
 
             cache.GetInts(ReaderX, "theInt", false);
-            cache.GetInts(ReaderX, "theInt", FieldCache_Fields.DEFAULT_INT_PARSER, false);
+            cache.GetInts(ReaderX, "theInt", FieldCache.DEFAULT_INT_PARSER, false);
 
             // // //
 
@@ -131,10 +130,10 @@ namespace Lucene.Net.Util
         [Test]
         public virtual void TestInsanity1()
         {
-            FieldCache cache = FieldCache_Fields.DEFAULT;
+            IFieldCache cache = FieldCache.DEFAULT;
             cache.PurgeAllCaches();
 
-            cache.GetInts(ReaderX, "theInt", FieldCache_Fields.DEFAULT_INT_PARSER, false);
+            cache.GetInts(ReaderX, "theInt", FieldCache.DEFAULT_INT_PARSER, false);
             cache.GetTerms(ReaderX, "theInt", false);
             cache.GetBytes(ReaderX, "theByte", false);
 
@@ -153,7 +152,7 @@ namespace Lucene.Net.Util
         [Test]
         public virtual void TestInsanity2()
         {
-            FieldCache cache = FieldCache_Fields.DEFAULT;
+            IFieldCache cache = FieldCache.DEFAULT;
             cache.PurgeAllCaches();
 
             cache.GetTerms(ReaderA, "theInt", false);


Mime
View raw message