Lucene.Net.Queries: Renamed all type-derived classes and interfaces from Short, Int, Long, and Float to match CLR types Int16, Int32, Int64, and Single, respectively.
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/883ad7f4 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/883ad7f4 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/883ad7f4 Branch: refs/heads/api-work Commit: 883ad7f4765881702dc009d606f71da8e5d01aa8 Parents: 89e3de6 Author: Shad Storhaug <[email protected]> Authored: Wed Feb 8 03:24:41 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Wed Feb 8 21:08:23 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net.Expressions/SimpleBindings.cs | 6 ++-- .../Range/DoubleRangeFacetCounts.cs | 2 +- .../Range/LongRangeFacetCounts.cs | 6 ++-- .../Function/DocValues/FloatDocValues.cs | 10 ++++--- .../Function/DocValues/IntDocValues.cs | 14 +++++---- .../Function/DocValues/LongDocValues.cs | 14 +++++---- .../Function/ValueSources/ConstValueSource.cs | 6 ++-- .../Function/ValueSources/DivFloatFunction.cs | 6 ++-- .../Function/ValueSources/DocFreqValueSource.cs | 9 ++++-- .../Function/ValueSources/DualFloatFunction.cs | 16 ++++++----- .../Function/ValueSources/EnumFieldSource.cs | 14 ++++----- .../Function/ValueSources/FloatFieldSource.cs | 20 +++++++------ .../Function/ValueSources/IntFieldSource.cs | 22 +++++++------- .../ValueSources/JoinDocFreqValueSource.cs | 6 ++-- .../ValueSources/LinearFloatFunction.cs | 18 ++++++------ .../Function/ValueSources/LongFieldSource.cs | 22 +++++++------- .../Function/ValueSources/MaxDocValueSource.cs | 2 +- .../Function/ValueSources/MaxFloatFunction.cs | 8 ++++-- .../Function/ValueSources/MinFloatFunction.cs | 8 ++++-- .../Function/ValueSources/MultiFloatFunction.cs | 16 ++++++----- .../Function/ValueSources/NormValueSource.cs | 6 ++-- .../Function/ValueSources/NumDocsValueSource.cs | 2 +- .../Function/ValueSources/OrdFieldSource.cs | 10 +++---- .../Function/ValueSources/PowFloatFunction.cs | 6 ++-- .../ValueSources/ProductFloatFunction.cs | 8 ++++-- .../Function/ValueSources/QueryValueSource.cs | 2 +- .../ValueSources/RangeMapFloatFunction.cs | 22 +++++++------- .../ValueSources/ReciprocalFloatFunction.cs | 20 +++++++------ .../ValueSources/ReverseOrdFieldSource.cs | 6 ++-- .../Function/ValueSources/ScaleFloatFunction.cs | 16 ++++++----- .../Function/ValueSources/ShortFieldSource.cs | 16 ++++++----- .../ValueSources/SimpleFloatFunction.cs | 14 +++++---- .../Function/ValueSources/SingleFunction.cs | 2 +- .../Function/ValueSources/SumFloatFunction.cs | 8 ++++-- .../ValueSources/SumTotalTermFreqValueSource.cs | 6 ++-- .../Function/ValueSources/TFValueSource.cs | 10 +++---- .../ValueSources/TermFreqValueSource.cs | 10 +++---- .../ValueSources/TotalTermFreqValueSource.cs | 6 ++-- src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs | 26 +++++++++-------- src/Lucene.Net.Spatial/SpatialStrategy.cs | 2 +- .../Range/TestRangeFacetCounts.cs | 10 +++---- .../Taxonomy/TestTaxonomyFacetSumValueSource.cs | 20 ++++++------- .../Function/FunctionTestSetup.cs | 8 +++--- .../Function/TestDocValuesFieldSources.cs | 6 ++-- .../Function/TestFunctionQuerySort.cs | 2 +- .../Function/TestValueSources.cs | 30 ++++++++++---------- .../DocumentValueSourceDictionaryTest.cs | 16 +++++------ 47 files changed, 280 insertions(+), 235 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Expressions/SimpleBindings.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Expressions/SimpleBindings.cs b/src/Lucene.Net.Expressions/SimpleBindings.cs index dd8747e..89c121b 100644 --- a/src/Lucene.Net.Expressions/SimpleBindings.cs +++ b/src/Lucene.Net.Expressions/SimpleBindings.cs @@ -92,17 +92,17 @@ namespace Lucene.Net.Expressions { case SortFieldType.INT: { - return new IntFieldSource(field.Field, (FieldCache.IInt32Parser)field.Parser); + return new Int32FieldSource(field.Field, (FieldCache.IInt32Parser)field.Parser); } case SortFieldType.LONG: { - return new LongFieldSource(field.Field, (FieldCache.IInt64Parser)field.Parser); + return new Int64FieldSource(field.Field, (FieldCache.IInt64Parser)field.Parser); } case SortFieldType.FLOAT: { - return new FloatFieldSource(field.Field, (FieldCache.ISingleParser)field.Parser); + return new SingleFieldSource(field.Field, (FieldCache.ISingleParser)field.Parser); } case SortFieldType.DOUBLE: http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Facet/Range/DoubleRangeFacetCounts.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Facet/Range/DoubleRangeFacetCounts.cs b/src/Lucene.Net.Facet/Range/DoubleRangeFacetCounts.cs index efcfbcf..c15eb0d 100644 --- a/src/Lucene.Net.Facet/Range/DoubleRangeFacetCounts.cs +++ b/src/Lucene.Net.Facet/Range/DoubleRangeFacetCounts.cs @@ -40,7 +40,7 @@ namespace Lucene.Net.Facet.Range /// etc.). /// /// <para> If you had indexed your field using <see cref="Documents.SingleDocValuesField"/> - /// then pass <see cref="Queries.Function.ValueSources.FloatFieldSource"/> + /// then pass <see cref="Queries.Function.ValueSources.SingleFieldSource"/> /// as the <see cref="ValueSource"/>; if you used /// <see cref="Documents.DoubleDocValuesField"/> then pass /// <see cref="DoubleFieldSource"/> (this is the default used when you http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Facet/Range/LongRangeFacetCounts.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Facet/Range/LongRangeFacetCounts.cs b/src/Lucene.Net.Facet/Range/LongRangeFacetCounts.cs index 4f80fba..7cebc9d 100644 --- a/src/Lucene.Net.Facet/Range/LongRangeFacetCounts.cs +++ b/src/Lucene.Net.Facet/Range/LongRangeFacetCounts.cs @@ -24,7 +24,7 @@ namespace Lucene.Net.Facet.Range using DocIdSetIterator = Lucene.Net.Search.DocIdSetIterator; using Filter = Lucene.Net.Search.Filter; using FunctionValues = Lucene.Net.Queries.Function.FunctionValues; - using LongFieldSource = Lucene.Net.Queries.Function.ValueSources.LongFieldSource; + using Int64FieldSource = Lucene.Net.Queries.Function.ValueSources.Int64FieldSource; using MatchingDocs = FacetsCollector.MatchingDocs; using ValueSource = Lucene.Net.Queries.Function.ValueSource; @@ -46,10 +46,10 @@ namespace Lucene.Net.Facet.Range { /// <summary> /// Create <see cref="Int64RangeFacetCounts"/>, using - /// <see cref="LongFieldSource"/> from the specified field. + /// <see cref="Int64FieldSource"/> from the specified field. /// </summary> public Int64RangeFacetCounts(string field, FacetsCollector hits, params Int64Range[] ranges) - : this(field, new LongFieldSource(field), hits, ranges) + : this(field, new Int64FieldSource(field), hits, ranges) { } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/DocValues/FloatDocValues.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/DocValues/FloatDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/FloatDocValues.cs index 4991266..91d0b9a 100644 --- a/src/Lucene.Net.Queries/Function/DocValues/FloatDocValues.cs +++ b/src/Lucene.Net.Queries/Function/DocValues/FloatDocValues.cs @@ -23,12 +23,14 @@ namespace Lucene.Net.Queries.Function.DocValues /// <summary> /// Abstract <see cref="FunctionValues"/> implementation which supports retrieving <see cref="float"/> values. /// Implementations can control how the <see cref="float"/> values are loaded through <see cref="SingleVal(int)"/> + /// <para/> + /// NOTE: This was FloatDocValues in Lucene /// </summary> - public abstract class FloatDocValues : FunctionValues + public abstract class SingleDocValues : FunctionValues { protected readonly ValueSource m_vs; - public FloatDocValues(ValueSource vs) + public SingleDocValues(ValueSource vs) { this.m_vs = vs; } @@ -94,9 +96,9 @@ namespace Lucene.Net.Queries.Function.DocValues private class ValueFillerAnonymousInnerClassHelper : ValueFiller { - private readonly FloatDocValues outerInstance; + private readonly SingleDocValues outerInstance; - public ValueFillerAnonymousInnerClassHelper(FloatDocValues outerInstance) + public ValueFillerAnonymousInnerClassHelper(SingleDocValues outerInstance) { this.outerInstance = outerInstance; mval = new MutableValueSingle(); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/DocValues/IntDocValues.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/DocValues/IntDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/IntDocValues.cs index 2173e8c..01f66f0 100644 --- a/src/Lucene.Net.Queries/Function/DocValues/IntDocValues.cs +++ b/src/Lucene.Net.Queries/Function/DocValues/IntDocValues.cs @@ -24,12 +24,14 @@ namespace Lucene.Net.Queries.Function.DocValues /// <summary> /// Abstract <see cref="FunctionValues"/> implementation which supports retrieving <see cref="int"/> values. /// Implementations can control how the <see cref="int"/> values are loaded through <see cref="Int32Val(int)"/> + /// <para/> + /// NOTE: This was IntDocValues in Lucene /// </summary> - public abstract class IntDocValues : FunctionValues + public abstract class Int32DocValues : FunctionValues { protected readonly ValueSource m_vs; - public IntDocValues(ValueSource vs) + public Int32DocValues(ValueSource vs) { this.m_vs = vs; } @@ -128,12 +130,12 @@ namespace Lucene.Net.Queries.Function.DocValues private class ValueSourceScorerAnonymousInnerClassHelper : ValueSourceScorer { - private readonly IntDocValues outerInstance; + private readonly Int32DocValues outerInstance; private int ll; private int uu; - public ValueSourceScorerAnonymousInnerClassHelper(IntDocValues outerInstance, IndexReader reader, IntDocValues @this, int ll, int uu) + public ValueSourceScorerAnonymousInnerClassHelper(Int32DocValues outerInstance, IndexReader reader, Int32DocValues @this, int ll, int uu) : base(reader, @this) { this.outerInstance = outerInstance; @@ -157,9 +159,9 @@ namespace Lucene.Net.Queries.Function.DocValues private class ValueFillerAnonymousInnerClassHelper : ValueFiller { - private readonly IntDocValues outerInstance; + private readonly Int32DocValues outerInstance; - public ValueFillerAnonymousInnerClassHelper(IntDocValues outerInstance) + public ValueFillerAnonymousInnerClassHelper(Int32DocValues outerInstance) { this.outerInstance = outerInstance; mval = new MutableValueInt32(); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/DocValues/LongDocValues.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/DocValues/LongDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/LongDocValues.cs index afc059e..f779a60 100644 --- a/src/Lucene.Net.Queries/Function/DocValues/LongDocValues.cs +++ b/src/Lucene.Net.Queries/Function/DocValues/LongDocValues.cs @@ -24,12 +24,14 @@ namespace Lucene.Net.Queries.Function.DocValues /// <summary> /// Abstract <see cref="FunctionValues"/> implementation which supports retrieving <see cref="long"/> values. /// Implementations can control how the <see cref="long"/> values are loaded through <see cref="Int64Val(int)"/> + /// <para/> + /// NOTE: This was LongDocValues in Lucene /// </summary> - public abstract class LongDocValues : FunctionValues + public abstract class Int64DocValues : FunctionValues { protected readonly ValueSource m_vs; - public LongDocValues(ValueSource vs) + public Int64DocValues(ValueSource vs) { this.m_vs = vs; } @@ -138,12 +140,12 @@ namespace Lucene.Net.Queries.Function.DocValues private class ValueSourceScorerAnonymousInnerClassHelper : ValueSourceScorer { - private readonly LongDocValues outerInstance; + private readonly Int64DocValues outerInstance; private readonly long ll; private readonly long uu; - public ValueSourceScorerAnonymousInnerClassHelper(LongDocValues outerInstance, IndexReader reader, LongDocValues @this, long ll, long uu) + public ValueSourceScorerAnonymousInnerClassHelper(Int64DocValues outerInstance, IndexReader reader, Int64DocValues @this, long ll, long uu) : base(reader, @this) { this.outerInstance = outerInstance; @@ -167,9 +169,9 @@ namespace Lucene.Net.Queries.Function.DocValues private class ValueFillerAnonymousInnerClassHelper : ValueFiller { - private readonly LongDocValues outerInstance; + private readonly Int64DocValues outerInstance; - public ValueFillerAnonymousInnerClassHelper(LongDocValues outerInstance) + public ValueFillerAnonymousInnerClassHelper(Int64DocValues outerInstance) { this.outerInstance = outerInstance; mval = new MutableValueInt64(); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/ConstValueSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ConstValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/ConstValueSource.cs index a9bd1b5..884adf2 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/ConstValueSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/ConstValueSource.cs @@ -43,14 +43,14 @@ namespace Lucene.Net.Queries.Function.ValueSources public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext) { - return new FloatDocValuesAnonymousInnerClassHelper(this, this); + return new SingleDocValuesAnonymousInnerClassHelper(this, this); } - private class FloatDocValuesAnonymousInnerClassHelper : FloatDocValues + private class SingleDocValuesAnonymousInnerClassHelper : SingleDocValues { private readonly ConstValueSource outerInstance; - public FloatDocValuesAnonymousInnerClassHelper(ConstValueSource outerInstance, ConstValueSource @this) + public SingleDocValuesAnonymousInnerClassHelper(ConstValueSource outerInstance, ConstValueSource @this) : base(@this) { this.outerInstance = outerInstance; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/DivFloatFunction.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/DivFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/DivFloatFunction.cs index 1ee5d96..d902ec2 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/DivFloatFunction.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/DivFloatFunction.cs @@ -19,12 +19,14 @@ /// <summary> /// Function to divide "a" by "b" + /// <para/> + /// NOTE: This was DivFloatFunction in Lucene /// </summary> - public class DivFloatFunction : DualFloatFunction + public class DivSingleFunction : DualSingleFunction { /// <param name="a"> the numerator. </param> /// <param name="b"> the denominator. </param> - public DivFloatFunction(ValueSource a, ValueSource b) + public DivSingleFunction(ValueSource a, ValueSource b) : base(a, b) { } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/DocFreqValueSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/DocFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/DocFreqValueSource.cs index 5e46da2..9bab31f 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/DocFreqValueSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/DocFreqValueSource.cs @@ -24,7 +24,10 @@ namespace Lucene.Net.Queries.Function.ValueSources * limitations under the License. */ - internal class ConstIntDocValues : IntDocValues + /// <summary> + /// NOTE: This was ConstIntDocValues in Lucene + /// </summary> + internal class ConstInt32DocValues : Int32DocValues { internal readonly int ival; internal readonly float fval; @@ -33,7 +36,7 @@ namespace Lucene.Net.Queries.Function.ValueSources internal readonly string sval; internal readonly ValueSource parent; - internal ConstIntDocValues(int val, ValueSource parent) + internal ConstInt32DocValues(int val, ValueSource parent) : base(parent) { ival = val; @@ -172,7 +175,7 @@ namespace Lucene.Net.Queries.Function.ValueSources { var searcher = (IndexSearcher)context["searcher"]; int docfreq = searcher.IndexReader.DocFreq(new Term(m_indexedField, m_indexedBytes)); - return new ConstIntDocValues(docfreq, this); + return new ConstInt32DocValues(docfreq, this); } public override void CreateWeight(IDictionary context, IndexSearcher searcher) http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/DualFloatFunction.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/DualFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/DualFloatFunction.cs index 7d43753..f7621aa 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/DualFloatFunction.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/DualFloatFunction.cs @@ -25,15 +25,17 @@ namespace Lucene.Net.Queries.Function.ValueSources /// <summary> /// Abstract <see cref="ValueSource"/> implementation which wraps two <see cref="ValueSource"/>s /// and applies an extendible <see cref="float"/> function to their values. + /// <para/> + /// NOTE: This was DualFloatFunction in Lucene /// </summary> - public abstract class DualFloatFunction : ValueSource + public abstract class DualSingleFunction : ValueSource { protected readonly ValueSource m_a; protected readonly ValueSource m_b; /// <param name="a"> the base. </param> /// <param name="b"> the exponent. </param> - public DualFloatFunction(ValueSource a, ValueSource b) + public DualSingleFunction(ValueSource a, ValueSource b) { this.m_a = a; this.m_b = b; @@ -51,17 +53,17 @@ namespace Lucene.Net.Queries.Function.ValueSources { FunctionValues aVals = m_a.GetValues(context, readerContext); FunctionValues bVals = m_b.GetValues(context, readerContext); - return new FloatDocValuesAnonymousInnerClassHelper(this, this, aVals, bVals); + return new SingleDocValuesAnonymousInnerClassHelper(this, this, aVals, bVals); } - private class FloatDocValuesAnonymousInnerClassHelper : FloatDocValues + private class SingleDocValuesAnonymousInnerClassHelper : SingleDocValues { - private readonly DualFloatFunction outerInstance; + private readonly DualSingleFunction outerInstance; private readonly FunctionValues aVals; private readonly FunctionValues bVals; - public FloatDocValuesAnonymousInnerClassHelper(DualFloatFunction outerInstance, DualFloatFunction @this, FunctionValues aVals, FunctionValues bVals) + public SingleDocValuesAnonymousInnerClassHelper(DualSingleFunction outerInstance, DualSingleFunction @this, FunctionValues aVals, FunctionValues bVals) : base(@this) { this.outerInstance = outerInstance; @@ -101,7 +103,7 @@ namespace Lucene.Net.Queries.Function.ValueSources public override bool Equals(object o) { - var other = o as DualFloatFunction; + var other = o as DualSingleFunction; if (other == null) { return false; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs index 7092e78..4dd4c02 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs @@ -126,17 +126,17 @@ namespace Lucene.Net.Queries.Function.ValueSources var arr = m_cache.GetInt32s(readerContext.AtomicReader, m_field, parser, true); var valid = m_cache.GetDocsWithField(readerContext.AtomicReader, m_field); - return new IntDocValuesAnonymousInnerClassHelper(this, this, arr, valid); + return new Int32DocValuesAnonymousInnerClassHelper(this, this, arr, valid); } - private class IntDocValuesAnonymousInnerClassHelper : IntDocValues + private class Int32DocValuesAnonymousInnerClassHelper : Int32DocValues { private readonly EnumFieldSource outerInstance; private readonly FieldCache.Int32s arr; private readonly IBits valid; - public IntDocValuesAnonymousInnerClassHelper(EnumFieldSource outerInstance, EnumFieldSource @this, FieldCache.Int32s arr, IBits valid) + public Int32DocValuesAnonymousInnerClassHelper(EnumFieldSource outerInstance, EnumFieldSource @this, FieldCache.Int32s arr, IBits valid) : base(@this) { this.outerInstance = outerInstance; @@ -237,12 +237,12 @@ namespace Lucene.Net.Queries.Function.ValueSources private class ValueSourceScorerAnonymousInnerClassHelper : ValueSourceScorer { - private readonly IntDocValuesAnonymousInnerClassHelper outerInstance; + private readonly Int32DocValuesAnonymousInnerClassHelper outerInstance; private readonly int ll; private readonly int uu; - public ValueSourceScorerAnonymousInnerClassHelper(IntDocValuesAnonymousInnerClassHelper outerInstance, IndexReader reader, EnumFieldSource @this, int ll, int uu) + public ValueSourceScorerAnonymousInnerClassHelper(Int32DocValuesAnonymousInnerClassHelper outerInstance, IndexReader reader, EnumFieldSource @this, int ll, int uu) : base(reader, outerInstance) { this.outerInstance = outerInstance; @@ -266,9 +266,9 @@ namespace Lucene.Net.Queries.Function.ValueSources private class ValueFillerAnonymousInnerClassHelper : ValueFiller { - private readonly IntDocValuesAnonymousInnerClassHelper outerInstance; + private readonly Int32DocValuesAnonymousInnerClassHelper outerInstance; - public ValueFillerAnonymousInnerClassHelper(IntDocValuesAnonymousInnerClassHelper outerInstance) + public ValueFillerAnonymousInnerClassHelper(Int32DocValuesAnonymousInnerClassHelper outerInstance) { this.outerInstance = outerInstance; mval = new MutableValueInt32(); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/FloatFieldSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/FloatFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/FloatFieldSource.cs index ec0732c..26584e3 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/FloatFieldSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/FloatFieldSource.cs @@ -27,17 +27,19 @@ namespace Lucene.Net.Queries.Function.ValueSources /// <summary> /// Obtains <see cref="float"/> field values from <see cref="IFieldCache.GetFloats"/> and makes those /// values available as other numeric types, casting as needed. + /// <para/> + /// NOTE: This was FloatFieldSource in Lucene /// </summary> - public class FloatFieldSource : FieldCacheSource + public class SingleFieldSource : FieldCacheSource { protected readonly FieldCache.ISingleParser m_parser; - public FloatFieldSource(string field) + public SingleFieldSource(string field) : this(field, null) { } - public FloatFieldSource(string field, FieldCache.ISingleParser parser) + public SingleFieldSource(string field, FieldCache.ISingleParser parser) : base(field) { this.m_parser = parser; @@ -52,15 +54,15 @@ namespace Lucene.Net.Queries.Function.ValueSources { var arr = m_cache.GetSingles(readerContext.AtomicReader, m_field, m_parser, true); var valid = m_cache.GetDocsWithField(readerContext.AtomicReader, m_field); - return new FloatDocValuesAnonymousInnerClassHelper(this, arr, valid); + return new SingleDocValuesAnonymousInnerClassHelper(this, arr, valid); } - private class FloatDocValuesAnonymousInnerClassHelper : FloatDocValues + private class SingleDocValuesAnonymousInnerClassHelper : SingleDocValues { private readonly FieldCache.Singles arr; private readonly IBits valid; - public FloatDocValuesAnonymousInnerClassHelper(FloatFieldSource @this, FieldCache.Singles arr, IBits valid) + public SingleDocValuesAnonymousInnerClassHelper(SingleFieldSource @this, FieldCache.Singles arr, IBits valid) : base(@this) { this.arr = arr; @@ -92,9 +94,9 @@ namespace Lucene.Net.Queries.Function.ValueSources private class ValueFillerAnonymousInnerClassHelper : ValueFiller { - private readonly FloatDocValuesAnonymousInnerClassHelper outerInstance; + private readonly SingleDocValuesAnonymousInnerClassHelper outerInstance; - public ValueFillerAnonymousInnerClassHelper(FloatDocValuesAnonymousInnerClassHelper outerInstance) + public ValueFillerAnonymousInnerClassHelper(SingleDocValuesAnonymousInnerClassHelper outerInstance) { this.outerInstance = outerInstance; mval = new MutableValueSingle(); @@ -120,7 +122,7 @@ namespace Lucene.Net.Queries.Function.ValueSources public override bool Equals(object o) { - var other = o as FloatFieldSource; + var other = o as SingleFieldSource; if (other == null) return false; return base.Equals(other) && (this.m_parser == null ? other.m_parser == null : this.m_parser.GetType() == other.m_parser.GetType()); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/IntFieldSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/IntFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/IntFieldSource.cs index 136f22a..d021256 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/IntFieldSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/IntFieldSource.cs @@ -28,17 +28,19 @@ namespace Lucene.Net.Queries.Function.ValueSources /// <summary> /// Obtains <see cref="int"/> field values from <see cref="IFieldCache.GetInt32s"/> and makes those /// values available as other numeric types, casting as needed. + /// <para/> + /// NOTE: This was IntFieldSource in Lucene /// </summary> - public class IntFieldSource : FieldCacheSource + public class Int32FieldSource : FieldCacheSource { private readonly FieldCache.IInt32Parser parser; - public IntFieldSource(string field) + public Int32FieldSource(string field) : this(field, null) { } - public IntFieldSource(string field, FieldCache.IInt32Parser parser) + public Int32FieldSource(string field, FieldCache.IInt32Parser parser) : base(field) { this.parser = parser; @@ -54,17 +56,17 @@ namespace Lucene.Net.Queries.Function.ValueSources FieldCache.Int32s arr = m_cache.GetInt32s(readerContext.AtomicReader, m_field, parser, true); IBits valid = m_cache.GetDocsWithField(readerContext.AtomicReader, m_field); - return new IntDocValuesAnonymousInnerClassHelper(this, this, arr, valid); + return new Int32DocValuesAnonymousInnerClassHelper(this, this, arr, valid); } - private class IntDocValuesAnonymousInnerClassHelper : IntDocValues + private class Int32DocValuesAnonymousInnerClassHelper : Int32DocValues { - private readonly IntFieldSource outerInstance; + private readonly Int32FieldSource outerInstance; private readonly FieldCache.Int32s arr; private readonly IBits valid; - public IntDocValuesAnonymousInnerClassHelper(IntFieldSource outerInstance, IntFieldSource @this, FieldCache.Int32s arr, IBits valid) + public Int32DocValuesAnonymousInnerClassHelper(Int32FieldSource outerInstance, Int32FieldSource @this, FieldCache.Int32s arr, IBits valid) : base(@this) { this.outerInstance = outerInstance; @@ -131,9 +133,9 @@ namespace Lucene.Net.Queries.Function.ValueSources private class ValueFillerAnonymousInnerClassHelper : ValueFiller { - private readonly IntDocValuesAnonymousInnerClassHelper outerInstance; + private readonly Int32DocValuesAnonymousInnerClassHelper outerInstance; - public ValueFillerAnonymousInnerClassHelper(IntDocValuesAnonymousInnerClassHelper outerInstance) + public ValueFillerAnonymousInnerClassHelper(Int32DocValuesAnonymousInnerClassHelper outerInstance) { this.outerInstance = outerInstance; mval = new MutableValueInt32(); @@ -159,7 +161,7 @@ namespace Lucene.Net.Queries.Function.ValueSources public override bool Equals(object o) { - var other = o as IntFieldSource; + var other = o as Int32FieldSource; if (other == null) return false; return base.Equals(other) && (this.parser == null ? other.parser == null : this.parser.GetType() == other.parser.GetType()); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/JoinDocFreqValueSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/JoinDocFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/JoinDocFreqValueSource.cs index 5a8d6e8..bca06eb 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/JoinDocFreqValueSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/JoinDocFreqValueSource.cs @@ -54,17 +54,17 @@ namespace Lucene.Net.Queries.Function.ValueSources Terms t = MultiFields.GetTerms(top, m_qfield); TermsEnum termsEnum = t == null ? TermsEnum.EMPTY : t.GetIterator(null); - return new IntDocValuesAnonymousInnerClassHelper(this, this, terms, termsEnum); + return new Int32DocValuesAnonymousInnerClassHelper(this, this, terms, termsEnum); } - private class IntDocValuesAnonymousInnerClassHelper : IntDocValues + private class Int32DocValuesAnonymousInnerClassHelper : Int32DocValues { private readonly JoinDocFreqValueSource outerInstance; private readonly BinaryDocValues terms; private readonly TermsEnum termsEnum; - public IntDocValuesAnonymousInnerClassHelper(JoinDocFreqValueSource outerInstance, JoinDocFreqValueSource @this, BinaryDocValues terms, TermsEnum termsEnum) + public Int32DocValuesAnonymousInnerClassHelper(JoinDocFreqValueSource outerInstance, JoinDocFreqValueSource @this, BinaryDocValues terms, TermsEnum termsEnum) : base(@this) { this.outerInstance = outerInstance; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/LinearFloatFunction.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/LinearFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/LinearFloatFunction.cs index 179995f..ba7f20b 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/LinearFloatFunction.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/LinearFloatFunction.cs @@ -24,18 +24,20 @@ namespace Lucene.Net.Queries.Function.ValueSources */ /// <summary> - /// <see cref="LinearFloatFunction"/> implements a linear function over + /// <see cref="LinearSingleFunction"/> implements a linear function over /// another <see cref="ValueSource"/>. /// <para/> /// Normally Used as an argument to a <see cref="FunctionQuery"/> + /// <para/> + /// NOTE: This was LinearFloatFunction in Lucene /// </summary> - public class LinearFloatFunction : ValueSource + public class LinearSingleFunction : ValueSource { protected readonly ValueSource m_source; protected readonly float m_slope; protected readonly float m_intercept; - public LinearFloatFunction(ValueSource source, float slope, float intercept) + public LinearSingleFunction(ValueSource source, float slope, float intercept) { this.m_source = source; this.m_slope = slope; @@ -50,15 +52,15 @@ namespace Lucene.Net.Queries.Function.ValueSources public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext) { FunctionValues vals = m_source.GetValues(context, readerContext); - return new FloatDocValuesAnonymousInnerClassHelper(this, this, vals); + return new SingleDocValuesAnonymousInnerClassHelper(this, this, vals); } - private class FloatDocValuesAnonymousInnerClassHelper : FloatDocValues + private class SingleDocValuesAnonymousInnerClassHelper : SingleDocValues { - private readonly LinearFloatFunction outerInstance; + private readonly LinearSingleFunction outerInstance; private readonly FunctionValues vals; - public FloatDocValuesAnonymousInnerClassHelper(LinearFloatFunction outerInstance, LinearFloatFunction @this, FunctionValues vals) + public SingleDocValuesAnonymousInnerClassHelper(LinearSingleFunction outerInstance, LinearSingleFunction @this, FunctionValues vals) : base(@this) { this.outerInstance = outerInstance; @@ -94,7 +96,7 @@ namespace Lucene.Net.Queries.Function.ValueSources public override bool Equals(object o) { - var other = o as LinearFloatFunction; + var other = o as LinearSingleFunction; if (other == null) return false; return this.m_slope == other.m_slope && this.m_intercept == other.m_intercept && this.m_source.Equals(other.m_source); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/LongFieldSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/LongFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/LongFieldSource.cs index fffa459..6c48b86 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/LongFieldSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/LongFieldSource.cs @@ -28,17 +28,19 @@ namespace Lucene.Net.Queries.Function.ValueSources /// <summary> /// Obtains <see cref="long"/> field values from <see cref="IFieldCache.GetInt64s"/> and makes those /// values available as other numeric types, casting as needed. + /// <para/> + /// NOTE: This was LongFieldSource in Lucene /// </summary> - public class LongFieldSource : FieldCacheSource + public class Int64FieldSource : FieldCacheSource { protected readonly FieldCache.IInt64Parser m_parser; - public LongFieldSource(string field) + public Int64FieldSource(string field) : this(field, null) { } - public LongFieldSource(string field, FieldCache.IInt64Parser parser) + public Int64FieldSource(string field, FieldCache.IInt64Parser parser) : base(field) { this.m_parser = parser; @@ -77,17 +79,17 @@ namespace Lucene.Net.Queries.Function.ValueSources { var arr = m_cache.GetInt64s(readerContext.AtomicReader, m_field, m_parser, true); var valid = m_cache.GetDocsWithField(readerContext.AtomicReader, m_field); - return new LongDocValuesAnonymousInnerClassHelper(this, this, arr, valid); + return new Int64DocValuesAnonymousInnerClassHelper(this, this, arr, valid); } - private class LongDocValuesAnonymousInnerClassHelper : LongDocValues + private class Int64DocValuesAnonymousInnerClassHelper : Int64DocValues { - private readonly LongFieldSource outerInstance; + private readonly Int64FieldSource outerInstance; private readonly FieldCache.Int64s arr; private readonly IBits valid; - public LongDocValuesAnonymousInnerClassHelper(LongFieldSource outerInstance, LongFieldSource @this, FieldCache.Int64s arr, IBits valid) + public Int64DocValuesAnonymousInnerClassHelper(Int64FieldSource outerInstance, Int64FieldSource @this, FieldCache.Int64s arr, IBits valid) : base(@this) { this.outerInstance = outerInstance; @@ -133,9 +135,9 @@ namespace Lucene.Net.Queries.Function.ValueSources private class ValueFillerAnonymousInnerClassHelper : ValueFiller { - private readonly LongDocValuesAnonymousInnerClassHelper outerInstance; + private readonly Int64DocValuesAnonymousInnerClassHelper outerInstance; - public ValueFillerAnonymousInnerClassHelper(LongDocValuesAnonymousInnerClassHelper outerInstance) + public ValueFillerAnonymousInnerClassHelper(Int64DocValuesAnonymousInnerClassHelper outerInstance) { this.outerInstance = outerInstance; mval = outerInstance.outerInstance.NewMutableValueInt64(); @@ -173,7 +175,7 @@ namespace Lucene.Net.Queries.Function.ValueSources { return false; } - var other = o as LongFieldSource; + var other = o as Int64FieldSource; if (other == null) return false; return base.Equals(other) && (this.m_parser == null ? other.m_parser == null : this.m_parser.GetType() == other.m_parser.GetType()); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/MaxDocValueSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/MaxDocValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/MaxDocValueSource.cs index f231997..229c0cf 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/MaxDocValueSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/MaxDocValueSource.cs @@ -46,7 +46,7 @@ namespace Lucene.Net.Queries.Function.ValueSources public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext) { var searcher = (IndexSearcher)context["searcher"]; - return new ConstIntDocValues(searcher.IndexReader.MaxDoc, this); + return new ConstInt32DocValues(searcher.IndexReader.MaxDoc, this); } public override bool Equals(object o) http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/MaxFloatFunction.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/MaxFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/MaxFloatFunction.cs index 914df30..726f6cb 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/MaxFloatFunction.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/MaxFloatFunction.cs @@ -20,11 +20,13 @@ namespace Lucene.Net.Queries.Function.ValueSources */ /// <summary> - /// <see cref="MaxFloatFunction"/> returns the max of it's components. + /// <see cref="MaxSingleFunction"/> returns the max of it's components. + /// <para/> + /// NOTE: This was MaxFloatFunction in Lucene /// </summary> - public class MaxFloatFunction : MultiFloatFunction + public class MaxSingleFunction : MultiSingleFunction { - public MaxFloatFunction(ValueSource[] sources) + public MaxSingleFunction(ValueSource[] sources) : base(sources) { } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/MinFloatFunction.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/MinFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/MinFloatFunction.cs index 83e6784..0a41dd5 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/MinFloatFunction.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/MinFloatFunction.cs @@ -20,11 +20,13 @@ namespace Lucene.Net.Queries.Function.ValueSources */ /// <summary> - /// <see cref="MinFloatFunction"/> returns the min of it's components. + /// <see cref="MinSingleFunction"/> returns the min of it's components. + /// <para/> + /// NOTE: This was MinFloatFunction in Lucene /// </summary> - public class MinFloatFunction : MultiFloatFunction + public class MinSingleFunction : MultiSingleFunction { - public MinFloatFunction(ValueSource[] sources) + public MinSingleFunction(ValueSource[] sources) : base(sources) { } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/MultiFloatFunction.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/MultiFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/MultiFloatFunction.cs index a4ac19c..3815796 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/MultiFloatFunction.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/MultiFloatFunction.cs @@ -27,12 +27,14 @@ namespace Lucene.Net.Queries.Function.ValueSources /// <summary> /// Abstract <see cref="ValueSource"/> implementation which wraps multiple <see cref="ValueSource"/>s /// and applies an extendible <see cref="float"/> function to their values. + /// <para/> + /// NOTE: This was MultiFloatFunction in Lucene /// </summary> - public abstract class MultiFloatFunction : ValueSource + public abstract class MultiSingleFunction : ValueSource { protected readonly ValueSource[] m_sources; - public MultiFloatFunction(ValueSource[] sources) + public MultiSingleFunction(ValueSource[] sources) { this.m_sources = sources; } @@ -70,16 +72,16 @@ namespace Lucene.Net.Queries.Function.ValueSources valsArr[i] = m_sources[i].GetValues(context, readerContext); } - return new FloatDocValuesAnonymousInnerClassHelper(this, this, valsArr); + return new SingleDocValuesAnonymousInnerClassHelper(this, this, valsArr); } - private class FloatDocValuesAnonymousInnerClassHelper : FloatDocValues + private class SingleDocValuesAnonymousInnerClassHelper : SingleDocValues { - private readonly MultiFloatFunction outerInstance; + private readonly MultiSingleFunction outerInstance; private readonly FunctionValues[] valsArr; - public FloatDocValuesAnonymousInnerClassHelper(MultiFloatFunction outerInstance, MultiFloatFunction @this, FunctionValues[] valsArr) + public SingleDocValuesAnonymousInnerClassHelper(MultiSingleFunction outerInstance, MultiSingleFunction @this, FunctionValues[] valsArr) : base(@this) { this.outerInstance = outerInstance; @@ -134,7 +136,7 @@ namespace Lucene.Net.Queries.Function.ValueSources { return false; } - var other = o as MultiFloatFunction; + var other = o as MultiSingleFunction; if (other == null) return false; return Name.Equals(other.Name) && Arrays.Equals(this.m_sources, other.m_sources); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/NormValueSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/NormValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/NormValueSource.cs index 5fd0546..7d06ab8 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/NormValueSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/NormValueSource.cs @@ -70,17 +70,17 @@ namespace Lucene.Net.Queries.Function.ValueSources return new ConstDoubleDocValues(0.0, this); } - return new FloatDocValuesAnonymousInnerClassHelper(this, this, similarity, norms); + return new SingleDocValuesAnonymousInnerClassHelper(this, this, similarity, norms); } - private class FloatDocValuesAnonymousInnerClassHelper : FloatDocValues + private class SingleDocValuesAnonymousInnerClassHelper : SingleDocValues { private readonly NormValueSource outerInstance; private readonly TFIDFSimilarity similarity; private readonly NumericDocValues norms; - public FloatDocValuesAnonymousInnerClassHelper(NormValueSource outerInstance, NormValueSource @this, TFIDFSimilarity similarity, NumericDocValues norms) + public SingleDocValuesAnonymousInnerClassHelper(NormValueSource outerInstance, NormValueSource @this, TFIDFSimilarity similarity, NumericDocValues norms) : base(@this) { this.outerInstance = outerInstance; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/NumDocsValueSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/NumDocsValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/NumDocsValueSource.cs index f0d6531..f34e14b 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/NumDocsValueSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/NumDocsValueSource.cs @@ -40,7 +40,7 @@ namespace Lucene.Net.Queries.Function.ValueSources public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext) { // Searcher has no numdocs so we must use the reader instead - return new ConstIntDocValues(ReaderUtil.GetTopLevelContext(readerContext).Reader.NumDocs, this); + return new ConstInt32DocValues(ReaderUtil.GetTopLevelContext(readerContext).Reader.NumDocs, this); } public override bool Equals(object o) http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs index ef50b28..9bb3ab8 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs @@ -65,17 +65,17 @@ namespace Lucene.Net.Queries.Function.ValueSources IndexReader topReader = ReaderUtil.GetTopLevelContext(readerContext).Reader; AtomicReader r = SlowCompositeReaderWrapper.Wrap(topReader); SortedDocValues sindex = FieldCache.DEFAULT.GetTermsIndex(r, m_field); - return new IntDocValuesAnonymousInnerClassHelper(this, this, off, sindex); + return new Int32DocValuesAnonymousInnerClassHelper(this, this, off, sindex); } - private sealed class IntDocValuesAnonymousInnerClassHelper : IntDocValues + private sealed class Int32DocValuesAnonymousInnerClassHelper : Int32DocValues { private readonly OrdFieldSource outerInstance; private readonly int off; private readonly SortedDocValues sindex; - public IntDocValuesAnonymousInnerClassHelper(OrdFieldSource outerInstance, OrdFieldSource @this, int off, SortedDocValues sindex) + public Int32DocValuesAnonymousInnerClassHelper(OrdFieldSource outerInstance, OrdFieldSource @this, int off, SortedDocValues sindex) : base(@this) { this.outerInstance = outerInstance; @@ -116,9 +116,9 @@ namespace Lucene.Net.Queries.Function.ValueSources private class ValueFillerAnonymousInnerClassHelper : ValueFiller { - private readonly IntDocValuesAnonymousInnerClassHelper outerInstance; + private readonly Int32DocValuesAnonymousInnerClassHelper outerInstance; - public ValueFillerAnonymousInnerClassHelper(IntDocValuesAnonymousInnerClassHelper outerInstance) + public ValueFillerAnonymousInnerClassHelper(Int32DocValuesAnonymousInnerClassHelper outerInstance) { this.outerInstance = outerInstance; mval = new MutableValueInt32(); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/PowFloatFunction.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/PowFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/PowFloatFunction.cs index 8a2a10b..7f849f0 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/PowFloatFunction.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/PowFloatFunction.cs @@ -21,12 +21,14 @@ namespace Lucene.Net.Queries.Function.ValueSources /// <summary> /// Function to raise the base "a" to the power "b" + /// <para/> + /// NOTE: This was PowFloatFunction in Lucene /// </summary> - public class PowFloatFunction : DualFloatFunction + public class PowSingleFunction : DualSingleFunction { /// <param name="a"> the base. </param> /// <param name="b"> the exponent. </param> - public PowFloatFunction(ValueSource a, ValueSource b) + public PowSingleFunction(ValueSource a, ValueSource b) : base(a, b) { } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/ProductFloatFunction.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ProductFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/ProductFloatFunction.cs index 1fda318..24c5235 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/ProductFloatFunction.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/ProductFloatFunction.cs @@ -20,11 +20,13 @@ namespace Lucene.Net.Queries.Function.ValueSources */ /// <summary> - /// <see cref="ProductFloatFunction"/> returns the product of it's components. + /// <see cref="ProductSingleFunction"/> returns the product of it's components. + /// <para/> + /// NOTE: This was ProductFloatFunction in Lucene /// </summary> - public class ProductFloatFunction : MultiFloatFunction + public class ProductSingleFunction : MultiSingleFunction { - public ProductFloatFunction(ValueSource[] sources) + public ProductSingleFunction(ValueSource[] sources) : base(sources) { } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/QueryValueSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/QueryValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/QueryValueSource.cs index 7eedfab..c321dc2 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/QueryValueSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/QueryValueSource.cs @@ -90,7 +90,7 @@ namespace Lucene.Net.Queries.Function.ValueSources } - internal class QueryDocValues : FloatDocValues + internal class QueryDocValues : SingleDocValues { internal readonly AtomicReaderContext readerContext; internal readonly IBits acceptDocs; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/RangeMapFloatFunction.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/RangeMapFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/RangeMapFloatFunction.cs index 3d7ecc6..23a15e3 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/RangeMapFloatFunction.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/RangeMapFloatFunction.cs @@ -24,12 +24,14 @@ namespace Lucene.Net.Queries.Function.ValueSources */ /// <summary> - /// <see cref="RangeMapFloatFunction"/> implements a map function over + /// <see cref="RangeMapSingleFunction"/> implements a map function over /// another <see cref="ValueSource"/> whose values fall within <c>min</c> and <c>max</c> inclusive to <c>target</c>. /// <para/> /// Normally used as an argument to a <see cref="FunctionQuery"/> + /// <para/> + /// NOTE: This was RangeMapFloatFunction in Lucene /// </summary> - public class RangeMapFloatFunction : ValueSource + public class RangeMapSingleFunction : ValueSource { protected readonly ValueSource m_source; protected readonly float m_min; @@ -37,12 +39,12 @@ namespace Lucene.Net.Queries.Function.ValueSources protected readonly ValueSource m_target; protected readonly ValueSource m_defaultVal; - public RangeMapFloatFunction(ValueSource source, float min, float max, float target, float? def) + public RangeMapSingleFunction(ValueSource source, float min, float max, float target, float? def) : this(source, min, max, new ConstValueSource(target), def == null ? null : new ConstValueSource(def.Value)) { } - public RangeMapFloatFunction(ValueSource source, float min, float max, ValueSource target, ValueSource def) + public RangeMapSingleFunction(ValueSource source, float min, float max, ValueSource target, ValueSource def) { this.m_source = source; this.m_min = min; @@ -61,18 +63,18 @@ namespace Lucene.Net.Queries.Function.ValueSources FunctionValues vals = m_source.GetValues(context, readerContext); FunctionValues targets = m_target.GetValues(context, readerContext); FunctionValues defaults = (this.m_defaultVal == null) ? null : m_defaultVal.GetValues(context, readerContext); - return new FloatDocValuesAnonymousInnerClassHelper(this, this, vals, targets, defaults); + return new SingleDocValuesAnonymousInnerClassHelper(this, this, vals, targets, defaults); } - private class FloatDocValuesAnonymousInnerClassHelper : FloatDocValues + private class SingleDocValuesAnonymousInnerClassHelper : SingleDocValues { - private readonly RangeMapFloatFunction outerInstance; + private readonly RangeMapSingleFunction outerInstance; private readonly FunctionValues vals; private readonly FunctionValues targets; private readonly FunctionValues defaults; - public FloatDocValuesAnonymousInnerClassHelper(RangeMapFloatFunction outerInstance, RangeMapFloatFunction @this, FunctionValues vals, FunctionValues targets, FunctionValues defaults) + public SingleDocValuesAnonymousInnerClassHelper(RangeMapSingleFunction outerInstance, RangeMapSingleFunction @this, FunctionValues vals, FunctionValues targets, FunctionValues defaults) : base(@this) { this.outerInstance = outerInstance; @@ -117,11 +119,11 @@ namespace Lucene.Net.Queries.Function.ValueSources public override bool Equals(object o) { - if (typeof(RangeMapFloatFunction) != o.GetType()) + if (typeof(RangeMapSingleFunction) != o.GetType()) { return false; } - var other = o as RangeMapFloatFunction; + var other = o as RangeMapSingleFunction; if (other == null) return false; return this.m_min == other.m_min http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/ReciprocalFloatFunction.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ReciprocalFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/ReciprocalFloatFunction.cs index a803e8c..4f8bae6 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/ReciprocalFloatFunction.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/ReciprocalFloatFunction.cs @@ -25,7 +25,7 @@ namespace Lucene.Net.Queries.Function.ValueSources */ /// <summary> - /// <see cref="ReciprocalFloatFunction"/> implements a reciprocal function <c>f(x) = a/(mx+b)</c>, based on + /// <see cref="ReciprocalSingleFunction"/> implements a reciprocal function <c>f(x) = a/(mx+b)</c>, based on /// the <see cref="float"/> value of a field or function as exported by <see cref="ValueSource"/>. /// <para/> /// When a and b are equal, and <c>x>=0</c>, this function has a maximum value of 1 that drops as x increases. @@ -36,9 +36,11 @@ namespace Lucene.Net.Queries.Function.ValueSources /// per year). Thus, a very recent date will yield a value close to 1/(0+1) or 1, /// a date a year in the past will get a multiplier of about 1/(1+1) or 1/2, /// and date two years old will yield 1/(2+1) or 1/3. + /// <para/> + /// NOTE: This was ReciprocalFloatFunction in Lucene /// </summary> /// <seealso cref="FunctionQuery"/> - public class ReciprocalFloatFunction : ValueSource + public class ReciprocalSingleFunction : ValueSource { protected readonly ValueSource m_source; protected readonly float m_m; @@ -48,7 +50,7 @@ namespace Lucene.Net.Queries.Function.ValueSources /// <summary> /// f(source) = a/(m*float(source)+b) /// </summary> - public ReciprocalFloatFunction(ValueSource source, float m, float a, float b) + public ReciprocalSingleFunction(ValueSource source, float m, float a, float b) { this.m_source = source; this.m_m = m; @@ -59,15 +61,15 @@ namespace Lucene.Net.Queries.Function.ValueSources public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext) { var vals = m_source.GetValues(context, readerContext); - return new FloatDocValuesAnonymousInnerClassHelper(this, this, vals); + return new SingleDocValuesAnonymousInnerClassHelper(this, this, vals); } - private class FloatDocValuesAnonymousInnerClassHelper : FloatDocValues + private class SingleDocValuesAnonymousInnerClassHelper : SingleDocValues { - private readonly ReciprocalFloatFunction outerInstance; + private readonly ReciprocalSingleFunction outerInstance; private readonly FunctionValues vals; - public FloatDocValuesAnonymousInnerClassHelper(ReciprocalFloatFunction outerInstance, ReciprocalFloatFunction @this, FunctionValues vals) + public SingleDocValuesAnonymousInnerClassHelper(ReciprocalSingleFunction outerInstance, ReciprocalSingleFunction @this, FunctionValues vals) : base(@this) { this.outerInstance = outerInstance; @@ -106,11 +108,11 @@ namespace Lucene.Net.Queries.Function.ValueSources public override bool Equals(object o) { - if (typeof(ReciprocalFloatFunction) != o.GetType()) + if (typeof(ReciprocalSingleFunction) != o.GetType()) { return false; } - var other = o as ReciprocalFloatFunction; + var other = o as ReciprocalSingleFunction; if (other == null) return false; return this.m_m == other.m_m && this.m_a == other.m_a && this.m_b == other.m_b && this.m_source.Equals(other.m_source); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs index 88c9d1b..3374c0c 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs @@ -71,10 +71,10 @@ namespace Lucene.Net.Queries.Function.ValueSources var sindex = FieldCache.DEFAULT.GetTermsIndex(r, field); var end = sindex.ValueCount; - return new IntDocValuesAnonymousInnerClassHelper(this, this, off, sindex, end); + return new Int32DocValuesAnonymousInnerClassHelper(this, this, off, sindex, end); } - private class IntDocValuesAnonymousInnerClassHelper : IntDocValues + private class Int32DocValuesAnonymousInnerClassHelper : Int32DocValues { private readonly ReverseOrdFieldSource outerInstance; @@ -82,7 +82,7 @@ namespace Lucene.Net.Queries.Function.ValueSources private readonly SortedDocValues sindex; private readonly int end; - public IntDocValuesAnonymousInnerClassHelper(ReverseOrdFieldSource outerInstance, ReverseOrdFieldSource @this, int off, SortedDocValues sindex, int end) + public Int32DocValuesAnonymousInnerClassHelper(ReverseOrdFieldSource outerInstance, ReverseOrdFieldSource @this, int off, SortedDocValues sindex, int end) : base(@this) { this.outerInstance = outerInstance; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/ScaleFloatFunction.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ScaleFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/ScaleFloatFunction.cs index ffae7c7..4c798a2 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/ScaleFloatFunction.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/ScaleFloatFunction.cs @@ -33,14 +33,16 @@ namespace Lucene.Net.Queries.Function.ValueSources /// still end up with 0.0 as the min value to map from. In these cases, an /// appropriate map() function could be used as a workaround to change 0.0 /// to a value in the real range. + /// <para/> + /// NOTE: This was ScaleFloatFunction in Lucene /// </summary> - public class ScaleFloatFunction : ValueSource + public class ScaleSingleFunction : ValueSource { protected readonly ValueSource m_source; protected readonly float m_min; protected readonly float m_max; - public ScaleFloatFunction(ValueSource source, float min, float max) + public ScaleSingleFunction(ValueSource source, float min, float max) { this.m_source = source; this.m_min = min; @@ -115,19 +117,19 @@ namespace Lucene.Net.Queries.Function.ValueSources float maxSource = scaleInfo.MaxVal; var vals = m_source.GetValues(context, readerContext); - return new FloatDocValuesAnonymousInnerClassHelper(this, this, scale, minSource, maxSource, vals); + return new SingleDocValuesAnonymousInnerClassHelper(this, this, scale, minSource, maxSource, vals); } - private class FloatDocValuesAnonymousInnerClassHelper : FloatDocValues + private class SingleDocValuesAnonymousInnerClassHelper : SingleDocValues { - private readonly ScaleFloatFunction outerInstance; + private readonly ScaleSingleFunction outerInstance; private readonly float scale; private readonly float minSource; private readonly float maxSource; private readonly FunctionValues vals; - public FloatDocValuesAnonymousInnerClassHelper(ScaleFloatFunction outerInstance, ScaleFloatFunction @this, float scale, float minSource, float maxSource, FunctionValues vals) + public SingleDocValuesAnonymousInnerClassHelper(ScaleSingleFunction outerInstance, ScaleSingleFunction @this, float scale, float minSource, float maxSource, FunctionValues vals) : base(@this) { this.outerInstance = outerInstance; @@ -167,7 +169,7 @@ namespace Lucene.Net.Queries.Function.ValueSources public override bool Equals(object o) { - var other = o as ScaleFloatFunction; + var other = o as ScaleSingleFunction; if (other == null) return false; return this.m_min == other.m_min http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/ShortFieldSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ShortFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/ShortFieldSource.cs index d8b8708..dab833f 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/ShortFieldSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/ShortFieldSource.cs @@ -24,20 +24,22 @@ namespace Lucene.Net.Queries.Function.ValueSources /// <summary> /// Obtains <see cref="short"/> field values from the <see cref="FieldCache"/> - /// using <see cref="IFieldCache.GetShorts"/> + /// using <see cref="IFieldCache.GetInt16s"/> /// and makes those values available as other numeric types, casting as needed. + /// <para/> + /// NOTE: This was ShortFieldSource in Lucene /// </summary> [Obsolete] - public class ShortFieldSource : FieldCacheSource + public class Int16FieldSource : FieldCacheSource { private readonly FieldCache.IInt16Parser parser; - public ShortFieldSource(string field) + public Int16FieldSource(string field) : this(field, null) { } - public ShortFieldSource(string field, FieldCache.IInt16Parser parser) + public Int16FieldSource(string field, FieldCache.IInt16Parser parser) : base(field) { this.parser = parser; @@ -56,10 +58,10 @@ namespace Lucene.Net.Queries.Function.ValueSources private class FunctionValuesAnonymousInnerClassHelper : FunctionValues { - private readonly ShortFieldSource outerInstance; + private readonly Int16FieldSource outerInstance; private readonly FieldCache.Int16s arr; - public FunctionValuesAnonymousInnerClassHelper(ShortFieldSource outerInstance, FieldCache.Int16s arr) + public FunctionValuesAnonymousInnerClassHelper(Int16FieldSource outerInstance, FieldCache.Int16s arr) { this.outerInstance = outerInstance; this.arr = arr; @@ -120,7 +122,7 @@ namespace Lucene.Net.Queries.Function.ValueSources public override bool Equals(object o) { - var other = o as ShortFieldSource; + var other = o as Int16FieldSource; if (other == null) return false; return base.Equals(other) http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs index 400e496..eef0434 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs @@ -23,10 +23,12 @@ namespace Lucene.Net.Queries.Function.ValueSources /// <summary> /// A simple <see cref="float"/> function with a single argument + /// <para/> + /// NOTE: This was SimpleFloatFunction in Lucene /// </summary> - public abstract class SimpleFloatFunction : SingularFunction + public abstract class SimpleSingleFunction : SingularFunction { - public SimpleFloatFunction(ValueSource source) + public SimpleSingleFunction(ValueSource source) : base(source) { } @@ -36,15 +38,15 @@ namespace Lucene.Net.Queries.Function.ValueSources public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext) { FunctionValues vals = m_source.GetValues(context, readerContext); - return new FloatDocValuesAnonymousInnerClassHelper(this, this, vals); + return new SingleDocValuesAnonymousInnerClassHelper(this, this, vals); } - private class FloatDocValuesAnonymousInnerClassHelper : FloatDocValues + private class SingleDocValuesAnonymousInnerClassHelper : SingleDocValues { - private readonly SimpleFloatFunction outerInstance; + private readonly SimpleSingleFunction outerInstance; private readonly FunctionValues vals; - public FloatDocValuesAnonymousInnerClassHelper(SimpleFloatFunction outerInstance, SimpleFloatFunction @this, FunctionValues vals) + public SingleDocValuesAnonymousInnerClassHelper(SimpleSingleFunction outerInstance, SimpleSingleFunction @this, FunctionValues vals) : base(@this) { this.outerInstance = outerInstance; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs index f74cd34..89c225f 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs @@ -21,7 +21,7 @@ namespace Lucene.Net.Queries.Function.ValueSources */ /// <summary> - /// A function with a single argument. + /// A function with a single (one) argument. /// <para/> /// NOTE: This was SingleFunction in Lucene, changed to avoid conusion with operations on the datatype <see cref="System.Single"/>. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs index 90472a2..3ec8ffc 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs @@ -20,11 +20,13 @@ namespace Lucene.Net.Queries.Function.ValueSources */ /// <summary> - /// <see cref="SumFloatFunction"/> returns the sum of its components. + /// <see cref="SumSingleFunction"/> returns the sum of its components. + /// <para/> + /// NOTE: This was SumFloatFunction in Lucene /// </summary> - public class SumFloatFunction : MultiFloatFunction + public class SumSingleFunction : MultiSingleFunction { - public SumFloatFunction(ValueSource[] sources) + public SumSingleFunction(ValueSource[] sources) : base(sources) { } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs index 27de789..0ffc576 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs @@ -80,16 +80,16 @@ namespace Lucene.Net.Queries.Function.ValueSources } } long ttf = sumTotalTermFreq; - context[this] = new LongDocValuesAnonymousInnerClassHelper(this, this, ttf); + context[this] = new Int64DocValuesAnonymousInnerClassHelper(this, this, ttf); } - private class LongDocValuesAnonymousInnerClassHelper : LongDocValues + private class Int64DocValuesAnonymousInnerClassHelper : Int64DocValues { private readonly SumTotalTermFreqValueSource outerInstance; private long ttf; - public LongDocValuesAnonymousInnerClassHelper(SumTotalTermFreqValueSource outerInstance, SumTotalTermFreqValueSource @this, long ttf) + public Int64DocValuesAnonymousInnerClassHelper(SumTotalTermFreqValueSource outerInstance, SumTotalTermFreqValueSource @this, long ttf) : base(@this) { this.outerInstance = outerInstance; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs index e9bbee7..2ffe4f8 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs @@ -62,17 +62,17 @@ namespace Lucene.Net.Queries.Function.ValueSources throw new System.NotSupportedException("requires a TFIDFSimilarity (such as DefaultSimilarity)"); } - return new FloatDocValuesAnonymousInnerClassHelper(this, this, terms, similarity); + return new SingleDocValuesAnonymousInnerClassHelper(this, this, terms, similarity); } - private class FloatDocValuesAnonymousInnerClassHelper : FloatDocValues + private class SingleDocValuesAnonymousInnerClassHelper : SingleDocValues { private readonly TFValueSource outerInstance; private readonly Terms terms; private readonly TFIDFSimilarity similarity; - public FloatDocValuesAnonymousInnerClassHelper(TFValueSource outerInstance, TFValueSource @this, Terms terms, TFIDFSimilarity similarity) + public SingleDocValuesAnonymousInnerClassHelper(TFValueSource outerInstance, TFValueSource @this, Terms terms, TFIDFSimilarity similarity) : base(@this) { this.outerInstance = outerInstance; @@ -116,9 +116,9 @@ namespace Lucene.Net.Queries.Function.ValueSources private class DocsEnumAnonymousInnerClassHelper : DocsEnum { - private readonly FloatDocValuesAnonymousInnerClassHelper outerInstance; + private readonly SingleDocValuesAnonymousInnerClassHelper outerInstance; - public DocsEnumAnonymousInnerClassHelper(FloatDocValuesAnonymousInnerClassHelper outerInstance) + public DocsEnumAnonymousInnerClassHelper(SingleDocValuesAnonymousInnerClassHelper outerInstance) { this.outerInstance = outerInstance; } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs index 749c208..96b9ad7 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs @@ -49,16 +49,16 @@ namespace Lucene.Net.Queries.Function.ValueSources Fields fields = readerContext.AtomicReader.Fields; Terms terms = fields.Terms(m_indexedField); - return new IntDocValuesAnonymousInnerClassHelper(this, this, terms); + return new Int32DocValuesAnonymousInnerClassHelper(this, this, terms); } - private class IntDocValuesAnonymousInnerClassHelper : IntDocValues + private class Int32DocValuesAnonymousInnerClassHelper : Int32DocValues { private readonly TermFreqValueSource outerInstance; private Terms terms; - public IntDocValuesAnonymousInnerClassHelper(TermFreqValueSource outerInstance, TermFreqValueSource @this, Terms terms) + public Int32DocValuesAnonymousInnerClassHelper(TermFreqValueSource outerInstance, TermFreqValueSource @this, Terms terms) : base(@this) { this.outerInstance = outerInstance; @@ -101,9 +101,9 @@ namespace Lucene.Net.Queries.Function.ValueSources private class DocsEnumAnonymousInnerClassHelper : DocsEnum { - private readonly IntDocValuesAnonymousInnerClassHelper outerInstance; + private readonly Int32DocValuesAnonymousInnerClassHelper outerInstance; - public DocsEnumAnonymousInnerClassHelper(IntDocValuesAnonymousInnerClassHelper outerInstance) + public DocsEnumAnonymousInnerClassHelper(Int32DocValuesAnonymousInnerClassHelper outerInstance) { this.outerInstance = outerInstance; } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs index 86511b7..e008090 100644 --- a/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs +++ b/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs @@ -77,16 +77,16 @@ namespace Lucene.Net.Queries.Function.ValueSources } } var ttf = totalTermFreq; - context[this] = new LongDocValuesAnonymousInnerClassHelper(this, this, ttf); + context[this] = new Int64DocValuesAnonymousInnerClassHelper(this, this, ttf); } - private class LongDocValuesAnonymousInnerClassHelper : LongDocValues + private class Int64DocValuesAnonymousInnerClassHelper : Int64DocValues { private readonly TotalTermFreqValueSource outerInstance; private readonly long ttf; - public LongDocValuesAnonymousInnerClassHelper(TotalTermFreqValueSource outerInstance, TotalTermFreqValueSource @this, long ttf) + public Int64DocValuesAnonymousInnerClassHelper(TotalTermFreqValueSource outerInstance, TotalTermFreqValueSource @this, long ttf) : base(@this) { this.outerInstance = outerInstance; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs b/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs index f3bfb1c..9ab7dc9 100644 --- a/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs +++ b/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs @@ -420,9 +420,9 @@ namespace Lucene.Net.Queries.Mlt /// <summary> /// Create a <see cref="T:Util.PriorityQueue{object[]}"/> from a word->tf map. /// </summary> - /// <param name="words"> a map of words keyed on the word(<see cref="string"/>) with <see cref="Int"/> objects as the values. </param> + /// <param name="words"> a map of words keyed on the word(<see cref="string"/>) with <see cref="Int32"/> objects as the values. </param> /// <exception cref="IOException"/> - private Util.PriorityQueue<object[]> CreateQueue(IDictionary<string, Int> words) + private Util.PriorityQueue<object[]> CreateQueue(IDictionary<string, Int32> words) { // have collected all words in doc and their freqs int numDocs = ir.NumDocs; @@ -500,7 +500,7 @@ namespace Lucene.Net.Queries.Mlt /// <exception cref="IOException"/> public Util.PriorityQueue<object[]> RetrieveTerms(int docNum) { - IDictionary<string, Int> termFreqMap = new Dictionary<string, Int>(); + IDictionary<string, Int32> termFreqMap = new Dictionary<string, Int32>(); foreach (string fieldName in FieldNames) { Fields vectors = ir.GetTermVectors(docNum); @@ -542,7 +542,7 @@ namespace Lucene.Net.Queries.Mlt /// </summary> /// <param name="termFreqMap"> a <see cref="T:IDictionary{string, Int}"/> of terms and their frequencies </param> /// <param name="vector"> List of terms and their frequencies for a doc/field </param> - private void AddTermFrequencies(IDictionary<string, Int> termFreqMap, Terms vector) + private void AddTermFrequencies(IDictionary<string, Int32> termFreqMap, Terms vector) { var termsEnum = vector.GetIterator(null); var spare = new CharsRef(); @@ -558,10 +558,10 @@ namespace Lucene.Net.Queries.Mlt var freq = (int)termsEnum.TotalTermFreq; // increment frequency - Int cnt; + Int32 cnt; if (!termFreqMap.TryGetValue(term, out cnt)) { - cnt = new Int(); + cnt = new Int32(); termFreqMap[term] = cnt; cnt.x = freq; } @@ -578,7 +578,7 @@ namespace Lucene.Net.Queries.Mlt /// <param name="r"> a source of text to be tokenized </param> /// <param name="termFreqMap"> a <see cref="T:IDictionary{string, Int}"/> of terms and their frequencies </param> /// <param name="fieldName"> Used by analyzer for any special per-field analysis </param> - private void AddTermFrequencies(TextReader r, IDictionary<string, Int> termFreqMap, string fieldName) + private void AddTermFrequencies(TextReader r, IDictionary<string, Int32> termFreqMap, string fieldName) { if (Analyzer == null) { @@ -605,10 +605,10 @@ namespace Lucene.Net.Queries.Mlt } // increment frequency - Int cnt; + Int32 cnt; if (!termFreqMap.TryGetValue(word, out cnt)) { - termFreqMap[word] = new Int(); + termFreqMap[word] = new Int32(); } else { @@ -668,7 +668,7 @@ namespace Lucene.Net.Queries.Mlt /// <seealso cref="RetrieveInterestingTerms"/> public Util.PriorityQueue<object[]> RetrieveTerms(TextReader r, string fieldName) { - IDictionary<string, Int> words = new Dictionary<string, Int>(); + IDictionary<string, Int32> words = new Dictionary<string, Int32>(); AddTermFrequencies(r, words, fieldName); return CreateQueue(words); } @@ -733,12 +733,14 @@ namespace Lucene.Net.Queries.Mlt /// <summary> /// Use for frequencies and to avoid renewing <see cref="int"/>s. + /// <para/> + /// NOTE: This was Int in Lucene /// </summary> - private class Int + private class Int32 { internal int x; - internal Int() + internal Int32() { x = 1; } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Spatial/SpatialStrategy.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Spatial/SpatialStrategy.cs b/src/Lucene.Net.Spatial/SpatialStrategy.cs index 3bfc929..348ca7e 100644 --- a/src/Lucene.Net.Spatial/SpatialStrategy.cs +++ b/src/Lucene.Net.Spatial/SpatialStrategy.cs @@ -158,7 +158,7 @@ namespace Lucene.Net.Spatial m_ctx.MakePoint(bbox.MinX, bbox.MinY), bbox.MaxX, bbox.MaxY); double distToEdge = diagonalDist * 0.5; float c = (float)distToEdge * 0.1f; //one tenth - return new ReciprocalFloatFunction(MakeDistanceValueSource(queryShape.Center, 1.0), 1f, c, c); + return new ReciprocalSingleFunction(MakeDistanceValueSource(queryShape.Center, 1.0), 1f, c, c); } public override string ToString()
