lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [36/53] [abbrv] lucenenet git commit: 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.
Date Wed, 08 Feb 2017 14:32:15 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs b/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
index b41e3df..9233dfd 100644
--- a/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
+++ b/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
@@ -50,8 +50,8 @@ namespace Lucene.Net.Facet.Range
     using ValueSource = Lucene.Net.Queries.Function.ValueSource;
     using DoubleDocValues = Lucene.Net.Queries.Function.DocValues.DoubleDocValues;
     using DoubleFieldSource = Lucene.Net.Queries.Function.ValueSources.DoubleFieldSource;
-    using FloatFieldSource = Lucene.Net.Queries.Function.ValueSources.FloatFieldSource;
-    using LongFieldSource = Lucene.Net.Queries.Function.ValueSources.LongFieldSource;
+    using SingleFieldSource = Lucene.Net.Queries.Function.ValueSources.SingleFieldSource;
+    using Int64FieldSource = Lucene.Net.Queries.Function.ValueSources.Int64FieldSource;
     using CachingWrapperFilter = Lucene.Net.Search.CachingWrapperFilter;
     using DocIdSet = Lucene.Net.Search.DocIdSet;
     using DocIdSetIterator = Lucene.Net.Search.DocIdSetIterator;
@@ -373,7 +373,7 @@ namespace Lucene.Net.Facet.Range
             IndexSearcher s = NewSearcher(r);
             s.Search(new MatchAllDocsQuery(), fc);
 
-            Facets facets = new DoubleRangeFacetCounts("field", new FloatFieldSource("field"),
fc, new DoubleRange("less than 10", 0.0f, true, 10.0f, false), new DoubleRange("less than
or equal to 10", 0.0f, true, 10.0f, true), new DoubleRange("over 90", 90.0f, false, 100.0f,
false), new DoubleRange("90 or above", 90.0f, true, 100.0f, false), new DoubleRange("over
1000", 1000.0f, false, double.PositiveInfinity, false));
+            Facets facets = new DoubleRangeFacetCounts("field", new SingleFieldSource("field"),
fc, new DoubleRange("less than 10", 0.0f, true, 10.0f, false), new DoubleRange("less than
or equal to 10", 0.0f, true, 10.0f, true), new DoubleRange("over 90", 90.0f, false, 100.0f,
false), new DoubleRange("90 or above", 90.0f, true, 100.0f, false), new DoubleRange("over
1000", 1000.0f, false, double.PositiveInfinity, false));
 
             Assert.AreEqual("dim=field path=[] value=21 childCount=5\n  less than 10 (10)\n
 less than or equal to 10 (11)\n  over 90 (9)\n  90 or above (10)\n  over 1000 (0)\n", facets.GetTopChildren(10,
"field").ToString());
 
@@ -533,7 +533,7 @@ namespace Lucene.Net.Facet.Range
                 {
                     fastMatchFilter = null;
                 }
-                ValueSource vs = new LongFieldSource("field");
+                ValueSource vs = new Int64FieldSource("field");
                 Facets facets = new Int64RangeFacetCounts("field", vs, sfc, fastMatchFilter,
ranges);
                 FacetResult result = facets.GetTopChildren(10, "field");
                 Assert.AreEqual(numRange, result.LabelValues.Length);
@@ -738,7 +738,7 @@ namespace Lucene.Net.Facet.Range
                 {
                     fastMatchFilter = null;
                 }
-                ValueSource vs = new FloatFieldSource("field");
+                ValueSource vs = new SingleFieldSource("field");
                 Facets facets = new DoubleRangeFacetCounts("field", vs, sfc, fastMatchFilter,
ranges);
                 FacetResult result = facets.GetTopChildren(10, "field");
                 Assert.AreEqual(numRange, result.LabelValues.Length);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
index 5f3972b..0ca9461 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
@@ -46,9 +46,9 @@ namespace Lucene.Net.Facet.Taxonomy
     using FunctionValues = Lucene.Net.Queries.Function.FunctionValues;
     using ValueSource = Lucene.Net.Queries.Function.ValueSource;
     using DoubleDocValues = Lucene.Net.Queries.Function.DocValues.DoubleDocValues;
-    using FloatFieldSource = Lucene.Net.Queries.Function.ValueSources.FloatFieldSource;
-    using IntFieldSource = Lucene.Net.Queries.Function.ValueSources.IntFieldSource;
-    using LongFieldSource = Lucene.Net.Queries.Function.ValueSources.LongFieldSource;
+    using SingleFieldSource = Lucene.Net.Queries.Function.ValueSources.SingleFieldSource;
+    using Int32FieldSource = Lucene.Net.Queries.Function.ValueSources.Int32FieldSource;
+    using Int64FieldSource = Lucene.Net.Queries.Function.ValueSources.Int64FieldSource;
     using ConstantScoreQuery = Lucene.Net.Search.ConstantScoreQuery;
     using IndexSearcher = Lucene.Net.Search.IndexSearcher;
     using MatchAllDocsQuery = Lucene.Net.Search.MatchAllDocsQuery;
@@ -123,7 +123,7 @@ namespace Lucene.Net.Facet.Taxonomy
             // Facets.search utility methods:
             searcher.Search(new MatchAllDocsQuery(), c);
 
-            TaxonomyFacetSumValueSource facets = new TaxonomyFacetSumValueSource(taxoReader,
new FacetsConfig(), c, new IntFieldSource("num"));
+            TaxonomyFacetSumValueSource facets = new TaxonomyFacetSumValueSource(taxoReader,
new FacetsConfig(), c, new Int32FieldSource("num"));
 
             // Retrieve & verify results:
             Assert.AreEqual("dim=Author path=[] value=145.0 childCount=4\n  Lisa (50.0)\n
 Frank (45.0)\n  Susan (40.0)\n  Bob (10.0)\n", facets.GetTopChildren(10, "Author").ToString());
@@ -187,7 +187,7 @@ namespace Lucene.Net.Facet.Taxonomy
             FacetsCollector c = new FacetsCollector();
             searcher.Search(new MatchAllDocsQuery(), c);
 
-            TaxonomyFacetSumValueSource facets = new TaxonomyFacetSumValueSource(taxoReader,
new FacetsConfig(), c, new IntFieldSource("num"));
+            TaxonomyFacetSumValueSource facets = new TaxonomyFacetSumValueSource(taxoReader,
new FacetsConfig(), c, new Int32FieldSource("num"));
 
             // Ask for top 10 labels for any dims that have counts:
             IList<FacetResult> results = facets.GetAllDims(10);
@@ -232,7 +232,7 @@ namespace Lucene.Net.Facet.Taxonomy
             FacetsCollector c = new FacetsCollector();
             searcher.Search(new MatchAllDocsQuery(), c);
 
-            TaxonomyFacetSumValueSource facets = new TaxonomyFacetSumValueSource(taxoReader,
config, c, new IntFieldSource("num"));
+            TaxonomyFacetSumValueSource facets = new TaxonomyFacetSumValueSource(taxoReader,
config, c, new Int32FieldSource("num"));
 
             // Ask for top 10 labels for any dims that have counts:
             IList<FacetResult> results = facets.GetAllDims(10);
@@ -322,7 +322,7 @@ namespace Lucene.Net.Facet.Taxonomy
 
             FacetsCollector sfc = new FacetsCollector();
             NewSearcher(r).Search(new MatchAllDocsQuery(), sfc);
-            Facets facets = new TaxonomyFacetSumValueSource(taxoReader, config, sfc, new
LongFieldSource("price"));
+            Facets facets = new TaxonomyFacetSumValueSource(taxoReader, config, sfc, new
Int64FieldSource("price"));
             Assert.AreEqual("dim=a path=[] value=10.0 childCount=2\n  1 (6.0)\n  0 (4.0)\n",
facets.GetTopChildren(10, "a").ToString());
 
             IOUtils.Close(taxoWriter, iw, taxoReader, taxoDir, r, indexDir);
@@ -353,7 +353,7 @@ namespace Lucene.Net.Facet.Taxonomy
 
             FacetsCollector fc = new FacetsCollector(true);
             // score documents by their 'price' field - makes asserting the correct counts
for the categories easier
-            Query q = new FunctionQuery(new LongFieldSource("price"));
+            Query q = new FunctionQuery(new Int64FieldSource("price"));
             FacetsCollector.Search(NewSearcher(r), q, 10, fc);
             Facets facets = new TaxonomyFacetSumValueSource(taxoReader, config, fc, valueSource);
 
@@ -444,7 +444,7 @@ namespace Lucene.Net.Facet.Taxonomy
             DirectoryReader r = DirectoryReader.Open(iw, true);
             DirectoryTaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoWriter);
 
-            ValueSource valueSource = new LongFieldSource("price");
+            ValueSource valueSource = new Int64FieldSource("price");
             FacetsCollector sfc = new FacetsCollector();
             NewSearcher(r).Search(new MatchAllDocsQuery(), sfc);
             Facets facets = new TaxonomyFacetSumValueSource(taxoReader, config, sfc, valueSource);
@@ -523,7 +523,7 @@ namespace Lucene.Net.Facet.Taxonomy
             // NRT open
             var tr = new DirectoryTaxonomyReader(tw);
 
-            ValueSource values = new FloatFieldSource("value");
+            ValueSource values = new SingleFieldSource("value");
 
             int iters = AtLeast(100);
             for (int iter = 0; iter < iters; iter++)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Tests.Queries/Function/FunctionTestSetup.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/Function/FunctionTestSetup.cs b/src/Lucene.Net.Tests.Queries/Function/FunctionTestSetup.cs
index 2fd778a..f89775c 100644
--- a/src/Lucene.Net.Tests.Queries/Function/FunctionTestSetup.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/FunctionTestSetup.cs
@@ -31,11 +31,11 @@ namespace Lucene.Net.Tests.Queries.Function
 
 #pragma warning disable 612, 618
         protected internal ValueSource BYTE_VALUESOURCE = new ByteFieldSource(INT_FIELD);
-        protected internal ValueSource SHORT_VALUESOURCE = new ShortFieldSource(INT_FIELD);
+        protected internal ValueSource SHORT_VALUESOURCE = new Int16FieldSource(INT_FIELD);
 #pragma warning restore 612, 618
-        protected internal ValueSource INT_VALUESOURCE = new IntFieldSource(INT_FIELD);
-        protected internal ValueSource INT_AS_FLOAT_VALUESOURCE = new FloatFieldSource(INT_FIELD);
-        protected internal ValueSource FLOAT_VALUESOURCE = new FloatFieldSource(FLOAT_FIELD);
+        protected internal ValueSource INT_VALUESOURCE = new Int32FieldSource(INT_FIELD);
+        protected internal ValueSource INT_AS_FLOAT_VALUESOURCE = new SingleFieldSource(INT_FIELD);
+        protected internal ValueSource FLOAT_VALUESOURCE = new SingleFieldSource(FLOAT_FIELD);
 
         private static readonly string[] DOC_TEXT_LINES =
         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs b/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
index 835b170..fab9d0d 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
@@ -75,7 +75,7 @@ namespace Lucene.Net.Tests.Queries.Function
             DirectoryReader rd = DirectoryReader.Open(d);
             foreach (AtomicReaderContext leave in rd.Leaves)
             {
-                FunctionValues ids = (new LongFieldSource("id")).GetValues(null, leave);
+                FunctionValues ids = (new Int64FieldSource("id")).GetValues(null, leave);
                 ValueSource vs;
                 switch (type)
                 {
@@ -84,7 +84,7 @@ namespace Lucene.Net.Tests.Queries.Function
                         vs = new BytesRefFieldSource("dv");
                         break;
                     case DocValuesType.NUMERIC:
-                        vs = new LongFieldSource("dv");
+                        vs = new Int64FieldSource("dv");
                         break;
                     default:
                         throw new InvalidOperationException();
@@ -98,7 +98,7 @@ namespace Lucene.Net.Tests.Queries.Function
                     {
                         assertTrue(values.ObjectVal(i) is string);
                     }
-                    else if (vs is LongFieldSource)
+                    else if (vs is Int64FieldSource)
                     {
                         assertTrue(values.ObjectVal(i) is long?);
                         assertTrue(values.BytesVal(i, bytes));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Tests.Queries/Function/TestFunctionQuerySort.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestFunctionQuerySort.cs b/src/Lucene.Net.Tests.Queries/Function/TestFunctionQuerySort.cs
index a8aec5e..50dfb43 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestFunctionQuerySort.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestFunctionQuerySort.cs
@@ -40,7 +40,7 @@ namespace Lucene.Net.Tests.Queries.Function
             IndexSearcher searcher = NewSearcher(reader);
 
             // Get ValueSource from FieldCache
-            IntFieldSource src = new IntFieldSource("value");
+            Int32FieldSource src = new Int32FieldSource("value");
             // ...and make it a sort criterion
             SortField sf = src.GetSortField(false).Rewrite(searcher);
             Sort orderBy = new Sort(sf);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs b/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
index 35ce6a0..8df2b1a 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
@@ -108,7 +108,7 @@ namespace Lucene.Net.Tests.Queries.Function
         [Test]
         public void TestDiv()
         {
-            AssertHits(new FunctionQuery(new DivFloatFunction(new ConstValueSource(10f),
new ConstValueSource(5f))), new[] { 2f, 2f });
+            AssertHits(new FunctionQuery(new DivSingleFunction(new ConstValueSource(10f),
new ConstValueSource(5f))), new[] { 2f, 2f });
         }
 
         [Test]
@@ -132,7 +132,7 @@ namespace Lucene.Net.Tests.Queries.Function
         [Test]
         public void TestFloat()
         {
-            AssertHits(new FunctionQuery(new FloatFieldSource("float")), new[] { 5.2f, 9.3f
});
+            AssertHits(new FunctionQuery(new SingleFieldSource("float")), new[] { 5.2f, 9.3f
});
         }
 
         [Test]
@@ -163,7 +163,7 @@ namespace Lucene.Net.Tests.Queries.Function
         [Test]
         public void TestInt()
         {
-            AssertHits(new FunctionQuery(new IntFieldSource("int")), new[] { 35f, 54f });
+            AssertHits(new FunctionQuery(new Int32FieldSource("int")), new[] { 35f, 54f });
         }
 
         [Test]
@@ -175,13 +175,13 @@ namespace Lucene.Net.Tests.Queries.Function
         [Test]
         public void TestLinearFloat()
         {
-            AssertHits(new FunctionQuery(new LinearFloatFunction(new ConstValueSource(2.0f),
3, 1)), new[] { 7f, 7f });
+            AssertHits(new FunctionQuery(new LinearSingleFunction(new ConstValueSource(2.0f),
3, 1)), new[] { 7f, 7f });
         }
 
         [Test]
         public void TestLong()
         {
-            AssertHits(new FunctionQuery(new LongFieldSource("long")), new[] { 4343f, 1954f
});
+            AssertHits(new FunctionQuery(new Int64FieldSource("long")), new[] { 4343f, 1954f
});
         }
 
         [Test]
@@ -193,13 +193,13 @@ namespace Lucene.Net.Tests.Queries.Function
         [Test]
         public void TestMaxFloat()
         {
-            AssertHits(new FunctionQuery(new MaxFloatFunction(new ValueSource[] { new ConstValueSource(1f),
new ConstValueSource(2f) })), new[] { 2f, 2f });
+            AssertHits(new FunctionQuery(new MaxSingleFunction(new ValueSource[] { new ConstValueSource(1f),
new ConstValueSource(2f) })), new[] { 2f, 2f });
         }
 
         [Test]
         public void TestMinFloat()
         {
-            AssertHits(new FunctionQuery(new MinFloatFunction(new ValueSource[] { new ConstValueSource(1f),
new ConstValueSource(2f) })), new[] { 1f, 1f });
+            AssertHits(new FunctionQuery(new MinSingleFunction(new ValueSource[] { new ConstValueSource(1f),
new ConstValueSource(2f) })), new[] { 1f, 1f });
         }
 
         [Test]
@@ -227,13 +227,13 @@ namespace Lucene.Net.Tests.Queries.Function
         [Test]
         public void TestPow()
         {
-            AssertHits(new FunctionQuery(new PowFloatFunction(new ConstValueSource(2f), new
ConstValueSource(3f))), new[] { 8f, 8f });
+            AssertHits(new FunctionQuery(new PowSingleFunction(new ConstValueSource(2f),
new ConstValueSource(3f))), new[] { 8f, 8f });
         }
 
         [Test]
         public void TestProduct()
         {
-            AssertHits(new FunctionQuery(new ProductFloatFunction(new ValueSource[] { new
ConstValueSource(2f), new ConstValueSource(3f) })), new[] { 6f, 6f });
+            AssertHits(new FunctionQuery(new ProductSingleFunction(new ValueSource[] { new
ConstValueSource(2f), new ConstValueSource(3f) })), new[] { 6f, 6f });
         }
 
         [Test]
@@ -245,34 +245,34 @@ namespace Lucene.Net.Tests.Queries.Function
         [Test]
         public void TestRangeMap()
         {
-            AssertHits(new FunctionQuery(new RangeMapFloatFunction(new FloatFieldSource("float"),
5, 6, 1, 0f)), new[] { 1f, 0f });
-            AssertHits(new FunctionQuery(new RangeMapFloatFunction(new FloatFieldSource("float"),
5, 6, new SumFloatFunction(new ValueSource[] { new ConstValueSource(1f), new ConstValueSource(2f)
}), new ConstValueSource(11f))), new[] { 3f, 11f });
+            AssertHits(new FunctionQuery(new RangeMapSingleFunction(new SingleFieldSource("float"),
5, 6, 1, 0f)), new[] { 1f, 0f });
+            AssertHits(new FunctionQuery(new RangeMapSingleFunction(new SingleFieldSource("float"),
5, 6, new SumSingleFunction(new ValueSource[] { new ConstValueSource(1f), new ConstValueSource(2f)
}), new ConstValueSource(11f))), new[] { 3f, 11f });
         }
 
         [Test]
         public void TestReciprocal()
         {
-            AssertHits(new FunctionQuery(new ReciprocalFloatFunction(new ConstValueSource(2f),
3, 1, 4)), new[] { 0.1f, 0.1f });
+            AssertHits(new FunctionQuery(new ReciprocalSingleFunction(new ConstValueSource(2f),
3, 1, 4)), new[] { 0.1f, 0.1f });
         }
 
         [Test]
         public void TestScale()
         {
-            AssertHits(new FunctionQuery(new ScaleFloatFunction(new IntFieldSource("int"),
0, 1)), new[] { 0.0f, 1.0f });
+            AssertHits(new FunctionQuery(new ScaleSingleFunction(new Int32FieldSource("int"),
0, 1)), new[] { 0.0f, 1.0f });
         }
 
         [Test]
         public void TestShort()
         {
 #pragma warning disable 612, 618
-            AssertHits(new FunctionQuery(new ShortFieldSource("short")), new[] { 945f, 123f
});
+            AssertHits(new FunctionQuery(new Int16FieldSource("short")), new[] { 945f, 123f
});
 #pragma warning restore 612, 618
         }
 
         [Test]
         public void TestSumFloat()
         {
-            AssertHits(new FunctionQuery(new SumFloatFunction(new ValueSource[] { new ConstValueSource(1f),
new ConstValueSource(2f) })), new[] { 3f, 3f });
+            AssertHits(new FunctionQuery(new SumSingleFunction(new ValueSource[] { new ConstValueSource(1f),
new ConstValueSource(2f) })), new[] { 3f, 3f });
         }
 
         [Test]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/883ad7f4/src/Lucene.Net.Tests.Suggest/Suggest/DocumentValueSourceDictionaryTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Suggest/Suggest/DocumentValueSourceDictionaryTest.cs b/src/Lucene.Net.Tests.Suggest/Suggest/DocumentValueSourceDictionaryTest.cs
index 463c773..6508dc6 100644
--- a/src/Lucene.Net.Tests.Suggest/Suggest/DocumentValueSourceDictionaryTest.cs
+++ b/src/Lucene.Net.Tests.Suggest/Suggest/DocumentValueSourceDictionaryTest.cs
@@ -106,8 +106,8 @@ namespace Lucene.Net.Search.Suggest
             writer.Dispose();
 
             IndexReader ir = DirectoryReader.Open(dir);
-            ValueSource[] toAdd = new ValueSource[] { new LongFieldSource(WEIGHT_FIELD_NAME_1),
new LongFieldSource(WEIGHT_FIELD_NAME_2), new LongFieldSource(WEIGHT_FIELD_NAME_3) };
-            IDictionary dictionary = new DocumentValueSourceDictionary(ir, FIELD_NAME, new
SumFloatFunction(toAdd), PAYLOAD_FIELD_NAME);
+            ValueSource[] toAdd = new ValueSource[] { new Int64FieldSource(WEIGHT_FIELD_NAME_1),
new Int64FieldSource(WEIGHT_FIELD_NAME_2), new Int64FieldSource(WEIGHT_FIELD_NAME_3) };
+            IDictionary dictionary = new DocumentValueSourceDictionary(ir, FIELD_NAME, new
SumSingleFunction(toAdd), PAYLOAD_FIELD_NAME);
             IInputIterator inputIterator = dictionary.EntryIterator;
             BytesRef f;
             while ((f = inputIterator.Next()) != null)
@@ -144,8 +144,8 @@ namespace Lucene.Net.Search.Suggest
             writer.Dispose();
 
             IndexReader ir = DirectoryReader.Open(dir);
-            ValueSource[] toAdd = new ValueSource[] { new LongFieldSource(WEIGHT_FIELD_NAME_1),
new LongFieldSource(WEIGHT_FIELD_NAME_2), new LongFieldSource(WEIGHT_FIELD_NAME_3) };
-            IDictionary dictionary = new DocumentValueSourceDictionary(ir, FIELD_NAME, new
SumFloatFunction(toAdd), PAYLOAD_FIELD_NAME, CONTEXTS_FIELD_NAME);
+            ValueSource[] toAdd = new ValueSource[] { new Int64FieldSource(WEIGHT_FIELD_NAME_1),
new Int64FieldSource(WEIGHT_FIELD_NAME_2), new Int64FieldSource(WEIGHT_FIELD_NAME_3) };
+            IDictionary dictionary = new DocumentValueSourceDictionary(ir, FIELD_NAME, new
SumSingleFunction(toAdd), PAYLOAD_FIELD_NAME, CONTEXTS_FIELD_NAME);
             IInputIterator inputIterator = dictionary.EntryIterator;
             BytesRef f;
             while ((f = inputIterator.Next()) != null)
@@ -187,8 +187,8 @@ namespace Lucene.Net.Search.Suggest
             writer.Dispose();
 
             IndexReader ir = DirectoryReader.Open(dir);
-            ValueSource[] toAdd = new ValueSource[] { new LongFieldSource(WEIGHT_FIELD_NAME_1),
new LongFieldSource(WEIGHT_FIELD_NAME_2), new LongFieldSource(WEIGHT_FIELD_NAME_3) };
-            IDictionary dictionary = new DocumentValueSourceDictionary(ir, FIELD_NAME, new
SumFloatFunction(toAdd));
+            ValueSource[] toAdd = new ValueSource[] { new Int64FieldSource(WEIGHT_FIELD_NAME_1),
new Int64FieldSource(WEIGHT_FIELD_NAME_2), new Int64FieldSource(WEIGHT_FIELD_NAME_3) };
+            IDictionary dictionary = new DocumentValueSourceDictionary(ir, FIELD_NAME, new
SumSingleFunction(toAdd));
             IInputIterator inputIterator = dictionary.EntryIterator;
             BytesRef f;
             while ((f = inputIterator.Next()) != null)
@@ -251,9 +251,9 @@ namespace Lucene.Net.Search.Suggest
             IndexReader ir = DirectoryReader.Open(dir);
             assertTrue("NumDocs should be > 0 but was " + ir.NumDocs, ir.NumDocs >
0);
             assertEquals(ir.NumDocs, docs.size());
-            ValueSource[] toAdd = new ValueSource[] { new LongFieldSource(WEIGHT_FIELD_NAME_1),
new LongFieldSource(WEIGHT_FIELD_NAME_2) };
+            ValueSource[] toAdd = new ValueSource[] { new Int64FieldSource(WEIGHT_FIELD_NAME_1),
new Int64FieldSource(WEIGHT_FIELD_NAME_2) };
 
-            IDictionary dictionary = new DocumentValueSourceDictionary(ir, FIELD_NAME, new
SumFloatFunction(toAdd), PAYLOAD_FIELD_NAME);
+            IDictionary dictionary = new DocumentValueSourceDictionary(ir, FIELD_NAME, new
SumSingleFunction(toAdd), PAYLOAD_FIELD_NAME);
             IInputIterator inputIterator = dictionary.EntryIterator;
             BytesRef f;
             while ((f = inputIterator.Next()) != null)


Mime
View raw message