diff --git lucene/expressions/src/java/org/apache/lucene/expressions/ExpressionValueSource.java lucene/expressions/src/java/org/apache/lucene/expressions/ExpressionValueSource.java
index 02f50df..a6f5ad6 100644
--- lucene/expressions/src/java/org/apache/lucene/expressions/ExpressionValueSource.java
+++ lucene/expressions/src/java/org/apache/lucene/expressions/ExpressionValueSource.java
@@ -58,7 +58,7 @@ final class ExpressionValueSource extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     Map<String, FunctionValues> valuesCache = (Map<String, FunctionValues>)context.get("valuesCache");
     if (valuesCache == null) {
       valuesCache = new HashMap<String, FunctionValues>();
diff --git lucene/expressions/src/java/org/apache/lucene/expressions/ScoreValueSource.java lucene/expressions/src/java/org/apache/lucene/expressions/ScoreValueSource.java
index 6502cf1..f324df5 100644
--- lucene/expressions/src/java/org/apache/lucene/expressions/ScoreValueSource.java
+++ lucene/expressions/src/java/org/apache/lucene/expressions/ScoreValueSource.java
@@ -36,7 +36,7 @@ class ScoreValueSource extends ValueSource {
    * <code>context</code> must contain a key "scorer" which is a {@link Scorer}.
    */
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     Scorer v = (Scorer) context.get("scorer");
     if (v == null) {
       throw new IllegalStateException("Expressions referencing the score can only be used for sorting");
diff --git lucene/facet/src/java/org/apache/lucene/facet/range/RangeFacetRequest.java lucene/facet/src/java/org/apache/lucene/facet/range/RangeFacetRequest.java
index 8786fe9..2a677f6 100644
--- lucene/facet/src/java/org/apache/lucene/facet/range/RangeFacetRequest.java
+++ lucene/facet/src/java/org/apache/lucene/facet/range/RangeFacetRequest.java
@@ -96,7 +96,7 @@ public class RangeFacetRequest<T extends Range> extends FacetRequest {
    * returned.
    */
   public FunctionValues getValues(AtomicReaderContext context) throws IOException {
-    return valueSource.getValues(Collections.emptyMap(), context);
+    return valueSource.getValues(Collections.<String,Object>emptyMap(), context);
   }
   
   @Override
diff --git lucene/facet/src/java/org/apache/lucene/facet/search/SumValueSourceFacetRequest.java lucene/facet/src/java/org/apache/lucene/facet/search/SumValueSourceFacetRequest.java
index 3c5288b..e5dabbd 100644
--- lucene/facet/src/java/org/apache/lucene/facet/search/SumValueSourceFacetRequest.java
+++ lucene/facet/src/java/org/apache/lucene/facet/search/SumValueSourceFacetRequest.java
@@ -107,7 +107,7 @@ public class SumValueSourceFacetRequest extends FacetRequest {
       assert matchingDocs.scores != null;
 
       final FakeScorer scorer = new FakeScorer();
-      Map<String, Scorer> context = new HashMap<String, Scorer>();
+      Map<String, Object> context = new HashMap<String, Object>();
       context.put("scorer", scorer);
 
       final FunctionValues fvalues = valueSource.getValues(context, matchingDocs.context);
@@ -147,7 +147,7 @@ public class SumValueSourceFacetRequest extends FacetRequest {
         return;
       }
 
-      final FunctionValues fvalues = valueSource.getValues(Collections.emptyMap(), matchingDocs.context);
+      final FunctionValues fvalues = valueSource.getValues(Collections.<String,Object>emptyMap(), matchingDocs.context);
       final int length = matchingDocs.bits.length();
       final float[] aggValues = facetArrays.getFloatArray();
       int doc = 0;
diff --git lucene/facet/src/test/org/apache/lucene/facet/search/TestSumValueSourceFacetRequest.java lucene/facet/src/test/org/apache/lucene/facet/search/TestSumValueSourceFacetRequest.java
index 315f31c..d9883ef 100644
--- lucene/facet/src/test/org/apache/lucene/facet/search/TestSumValueSourceFacetRequest.java
+++ lucene/facet/src/test/org/apache/lucene/facet/search/TestSumValueSourceFacetRequest.java
@@ -111,7 +111,7 @@ public class TestSumValueSourceFacetRequest extends FacetTestCase {
 
     ValueSource valueSource = new ValueSource() {
       @Override
-      public FunctionValues getValues(@SuppressWarnings("rawtypes") Map context, AtomicReaderContext readerContext) throws IOException {
+      public FunctionValues getValues(@SuppressWarnings("rawtypes") Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
         final Scorer scorer = (Scorer) context.get("scorer");
         assert scorer != null;
         return new DoubleDocValues(this) {
diff --git lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupHeadsCollector.java lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupHeadsCollector.java
index 8372ac5..af58c00 100644
--- lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupHeadsCollector.java
+++ lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupHeadsCollector.java
@@ -41,7 +41,7 @@ import java.util.Map;
 public class FunctionAllGroupHeadsCollector extends AbstractAllGroupHeadsCollector<FunctionAllGroupHeadsCollector.GroupHead> {
 
   private final ValueSource groupBy;
-  private final Map<?, ?> vsContext;
+  private final Map<String, Object> vsContext;
   private final Map<MutableValue, GroupHead> groups;
   private final Sort sortWithinGroup;
 
@@ -53,11 +53,11 @@ public class FunctionAllGroupHeadsCollector extends AbstractAllGroupHeadsCollect
   /**
    * Constructs a {@link FunctionAllGroupHeadsCollector} instance.
    *
-   * @param groupBy The {@link ValueSource} to group by
+   * @param groupBy The {@link org.apache.lucene.queries.function.ValueSource} to group by
    * @param vsContext The ValueSource context
    * @param sortWithinGroup The sort within a group
    */
-  public FunctionAllGroupHeadsCollector(ValueSource groupBy, Map<?, ?> vsContext, Sort sortWithinGroup) {
+  public FunctionAllGroupHeadsCollector(ValueSource groupBy, Map<String, Object> vsContext, Sort sortWithinGroup) {
     super(sortWithinGroup.getSort().length);
     groups = new HashMap<>();
     this.sortWithinGroup = sortWithinGroup;
diff --git lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupsCollector.java lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupsCollector.java
index 72b8246..4b37b2b 100644
--- lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupsCollector.java
+++ lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupsCollector.java
@@ -43,7 +43,7 @@ import java.util.TreeSet;
  */
 public class FunctionAllGroupsCollector extends AbstractAllGroupsCollector<MutableValue> {
 
-  private final Map<?, ?> vsContext;
+  private final Map<String, Object> vsContext;
   private final ValueSource groupBy;
   private final SortedSet<MutableValue> groups = new TreeSet<MutableValue>();
 
@@ -53,10 +53,10 @@ public class FunctionAllGroupsCollector extends AbstractAllGroupsCollector<Mutab
   /**
    * Constructs a {@link FunctionAllGroupsCollector} instance.
    *
-   * @param groupBy The {@link ValueSource} to group by
+   * @param groupBy The {@link org.apache.lucene.queries.function.ValueSource} to group by
    * @param vsContext The ValueSource context
    */
-  public FunctionAllGroupsCollector(ValueSource groupBy, Map<?, ?> vsContext) {
+  public FunctionAllGroupsCollector(ValueSource groupBy, Map<String, Object> vsContext) {
     this.vsContext = vsContext;
     this.groupBy = groupBy;
   }
diff --git lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionDistinctValuesCollector.java lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionDistinctValuesCollector.java
index 3bc7074..f1458fa 100644
--- lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionDistinctValuesCollector.java
+++ lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionDistinctValuesCollector.java
@@ -34,7 +34,7 @@ import java.util.*;
  */
 public class FunctionDistinctValuesCollector extends AbstractDistinctValuesCollector<FunctionDistinctValuesCollector.GroupCount> {
 
-  private final Map<?, ?> vsContext;
+  private final Map<String, Object> vsContext;
   private final ValueSource groupSource;
   private final ValueSource countSource;
   private final Map<MutableValue, GroupCount> groupMap;
@@ -44,7 +44,7 @@ public class FunctionDistinctValuesCollector extends AbstractDistinctValuesColle
   private MutableValue groupMval;
   private MutableValue countMval;
 
-  public FunctionDistinctValuesCollector(Map<?, ?> vsContext, ValueSource groupSource, ValueSource countSource, Collection<SearchGroup<MutableValue>> groups) {
+  public FunctionDistinctValuesCollector(Map<String, Object> vsContext, ValueSource groupSource, ValueSource countSource, Collection<SearchGroup<MutableValue>> groups) {
     this.vsContext = vsContext;
     this.groupSource = groupSource;
     this.countSource = countSource;
diff --git lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionFirstPassGroupingCollector.java lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionFirstPassGroupingCollector.java
index 6355a51..2c01938 100644
--- lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionFirstPassGroupingCollector.java
+++ lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionFirstPassGroupingCollector.java
@@ -36,7 +36,7 @@ import java.util.Map;
 public class FunctionFirstPassGroupingCollector extends AbstractFirstPassGroupingCollector<MutableValue> {
 
   private final ValueSource groupByVS;
-  private final Map<?, ?> vsContext;
+  private final Map<String, Object> vsContext;
 
   private FunctionValues.ValueFiller filler;
   private MutableValue mval;
@@ -44,9 +44,10 @@ public class FunctionFirstPassGroupingCollector extends AbstractFirstPassGroupin
   /**
    * Creates a first pass collector.
    *
-   * @param groupByVS  The {@link ValueSource} instance to group by
+   *
+   * @param groupByVS  The {@link org.apache.lucene.queries.function.ValueSource} instance to group by
    * @param vsContext  The ValueSource context
-   * @param groupSort  The {@link Sort} used to sort the
+   * @param groupSort  The {@link org.apache.lucene.search.Sort} used to sort the
    *                   groups.  The top sorted document within each group
    *                   according to groupSort, determines how that group
    *                   sorts against other groups.  This must be non-null,
@@ -55,7 +56,7 @@ public class FunctionFirstPassGroupingCollector extends AbstractFirstPassGroupin
    * @param topNGroups How many top groups to keep.
    * @throws IOException When I/O related errors occur
    */
-  public FunctionFirstPassGroupingCollector(ValueSource groupByVS, Map<?, ?> vsContext, Sort groupSort, int topNGroups) throws IOException {
+  public FunctionFirstPassGroupingCollector(ValueSource groupByVS, Map<String, Object> vsContext, Sort groupSort, int topNGroups) throws IOException {
     super(groupSort, topNGroups);
     this.groupByVS = groupByVS;
     this.vsContext = vsContext;
diff --git lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionSecondPassGroupingCollector.java lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionSecondPassGroupingCollector.java
index d2f1d59..9959ec2 100644
--- lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionSecondPassGroupingCollector.java
+++ lucene/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionSecondPassGroupingCollector.java
@@ -39,7 +39,7 @@ import java.util.Map;
 public class FunctionSecondPassGroupingCollector extends AbstractSecondPassGroupingCollector<MutableValue> {
 
   private final ValueSource groupByVS;
-  private final Map<?, ?> vsContext;
+  private final Map<String, Object> vsContext;
 
   private FunctionValues.ValueFiller filler;
   private MutableValue mval;
@@ -47,18 +47,19 @@ public class FunctionSecondPassGroupingCollector extends AbstractSecondPassGroup
   /**
    * Constructs a {@link FunctionSecondPassGroupingCollector} instance.
    *
-   * @param searchGroups The {@link SearchGroup} instances collected during the first phase.
+   *
+   * @param searchGroups The {@link org.apache.lucene.search.grouping.SearchGroup} instances collected during the first phase.
    * @param groupSort The group sort
    * @param withinGroupSort The sort inside a group
    * @param maxDocsPerGroup The maximum number of documents to collect inside a group
    * @param getScores Whether to include the scores
    * @param getMaxScores Whether to include the maximum score
-   * @param fillSortFields Whether to fill the sort values in {@link TopGroups#withinGroupSort}
-   * @param groupByVS The {@link ValueSource} to group by
+   * @param fillSortFields Whether to fill the sort values in {@link org.apache.lucene.search.grouping.TopGroups#withinGroupSort}
+   * @param groupByVS The {@link org.apache.lucene.queries.function.ValueSource} to group by
    * @param vsContext The value source context
    * @throws IOException IOException When I/O related errors occur
    */
-  public FunctionSecondPassGroupingCollector(Collection<SearchGroup<MutableValue>> searchGroups, Sort groupSort, Sort withinGroupSort, int maxDocsPerGroup, boolean getScores, boolean getMaxScores, boolean fillSortFields, ValueSource groupByVS, Map<?, ?> vsContext) throws IOException {
+  public FunctionSecondPassGroupingCollector(Collection<SearchGroup<MutableValue>> searchGroups, Sort groupSort, Sort withinGroupSort, int maxDocsPerGroup, boolean getScores, boolean getMaxScores, boolean fillSortFields, ValueSource groupByVS, Map<String, Object> vsContext) throws IOException {
     super(searchGroups, groupSort, withinGroupSort, maxDocsPerGroup, getScores, getMaxScores, fillSortFields);
     this.groupByVS = groupByVS;
     this.vsContext = vsContext;
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/ValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/ValueSource.java
index d1dd994..77edf66 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/ValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/ValueSource.java
@@ -40,7 +40,7 @@ public abstract class ValueSource {
    * Gets the values for this reader and the context that was previously
    * passed to createWeight()
    */
-  public abstract FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException;
+  public abstract FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException;
 
   @Override
   public abstract boolean equals(Object o);
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/BytesRefFieldSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/BytesRefFieldSource.java
index 5d33ef3..a35f4ad 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/BytesRefFieldSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/BytesRefFieldSource.java
@@ -40,7 +40,7 @@ public class BytesRefFieldSource extends FieldCacheSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FieldInfo fieldInfo = readerContext.reader().getFieldInfos().fieldInfo(field);
     // To be sorted or not to be sorted, that is the question
     // TODO: do it cleaner?
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ConstValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ConstValueSource.java
index 457a87d..f26153c 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ConstValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ConstValueSource.java
@@ -42,7 +42,7 @@ public class ConstValueSource extends ConstNumberSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     return new FloatDocValues(this) {
       @Override
       public float floatVal(int doc) {
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DefFunction.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DefFunction.java
index c947824..019f350 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DefFunction.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DefFunction.java
@@ -19,11 +19,9 @@ package org.apache.lucene.queries.function.valuesource;
 import org.apache.lucene.index.AtomicReaderContext;
 import org.apache.lucene.queries.function.FunctionValues;
 import org.apache.lucene.queries.function.ValueSource;
-import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.util.BytesRef;
 
 import java.io.IOException;
-import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
@@ -45,7 +43,7 @@ public class DefFunction extends MultiFunction {
 
 
   @Override
-  public FunctionValues getValues(Map fcontext, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> fcontext, AtomicReaderContext readerContext) throws IOException {
 
 
     return new Values(valsArr(sources, fcontext, readerContext)) {
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DocFreqValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DocFreqValueSource.java
index 3b42539..e0e17c9 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DocFreqValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DocFreqValueSource.java
@@ -146,7 +146,7 @@ public class DocFreqValueSource extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     IndexSearcher searcher = (IndexSearcher)context.get("searcher");
     int docfreq = searcher.getIndexReader().docFreq(new Term(indexedField, indexedBytes));
     return new ConstIntDocValues(docfreq, this);
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DoubleConstValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DoubleConstValueSource.java
index a3cea88..be10ae8 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DoubleConstValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DoubleConstValueSource.java
@@ -44,7 +44,7 @@ public class DoubleConstValueSource extends ConstNumberSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     return new DoubleDocValues(this) {
       @Override
       public float floatVal(int doc) {
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DoubleFieldSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DoubleFieldSource.java
index 89d4a69..1363be7 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DoubleFieldSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DoubleFieldSource.java
@@ -21,9 +21,7 @@ import java.io.IOException;
 import java.util.Map;
 
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.queries.function.FunctionValues;
-import org.apache.lucene.queries.function.ValueSourceScorer;
 import org.apache.lucene.queries.function.docvalues.DoubleDocValues;
 import org.apache.lucene.search.FieldCache;
 import org.apache.lucene.util.Bits;
@@ -53,7 +51,7 @@ public class DoubleFieldSource extends FieldCacheSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FieldCache.Doubles arr = cache.getDoubles(readerContext.reader(), field, parser, true);
     final Bits valid = cache.getDocsWithField(readerContext.reader(), field);
     return new DoubleDocValues(this) {
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DualFloatFunction.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DualFloatFunction.java
index 241dfa0..aa99ccd 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DualFloatFunction.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DualFloatFunction.java
@@ -52,7 +52,7 @@ public abstract class DualFloatFunction extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FunctionValues aVals =  a.getValues(context, readerContext);
     final FunctionValues bVals =  b.getValues(context, readerContext);
     return new FloatDocValues(this) {
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/EnumFieldSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/EnumFieldSource.java
index cd83c94..a39f55b 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/EnumFieldSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/EnumFieldSource.java
@@ -97,7 +97,7 @@ public class EnumFieldSource extends FieldCacheSource {
 
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FieldCache.Ints arr = cache.getInts(readerContext.reader(), field, parser, true);
     final Bits valid = cache.getDocsWithField(readerContext.reader(), field);
 
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/FloatFieldSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/FloatFieldSource.java
index 3c7f3b1..b21b21c 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/FloatFieldSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/FloatFieldSource.java
@@ -51,7 +51,7 @@ public class FloatFieldSource extends FieldCacheSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FieldCache.Floats arr = cache.getFloats(readerContext.reader(), field, parser, true);
     final Bits valid = cache.getDocsWithField(readerContext.reader(), field);
 
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/IDFValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/IDFValueSource.java
index 0c62020..262e2b7 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/IDFValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/IDFValueSource.java
@@ -46,7 +46,7 @@ public class IDFValueSource extends DocFreqValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     IndexSearcher searcher = (IndexSearcher)context.get("searcher");
     TFIDFSimilarity sim = asTFIDF(searcher.getSimilarity(), field);
     if (sim == null) {
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/IfFunction.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/IfFunction.java
index fde5c5c..e254127 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/IfFunction.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/IfFunction.java
@@ -18,15 +18,12 @@
 package org.apache.lucene.queries.function.valuesource;
 
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.queries.function.FunctionValues;
 import org.apache.lucene.queries.function.ValueSource;
-import org.apache.lucene.search.Explanation;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.util.BytesRef;
 
 import java.io.IOException;
-import java.util.List;
 import java.util.Map;
 
 
@@ -47,7 +44,7 @@ public class IfFunction extends BoolFunction {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FunctionValues ifVals = ifSource.getValues(context, readerContext);
     final FunctionValues trueVals = trueSource.getValues(context, readerContext);
     final FunctionValues falseVals = falseSource.getValues(context, readerContext);
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/IntFieldSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/IntFieldSource.java
index a6ca74e..86cdfa0 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/IntFieldSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/IntFieldSource.java
@@ -21,9 +21,7 @@ import java.io.IOException;
 import java.util.Map;
 
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.queries.function.FunctionValues;
-import org.apache.lucene.queries.function.ValueSourceScorer;
 import org.apache.lucene.queries.function.docvalues.IntDocValues;
 import org.apache.lucene.search.FieldCache;
 import org.apache.lucene.util.Bits;
@@ -53,7 +51,7 @@ public class IntFieldSource extends FieldCacheSource {
 
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FieldCache.Ints arr = cache.getInts(readerContext.reader(), field, parser, true);
     final Bits valid = cache.getDocsWithField(readerContext.reader(), field);
     
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/JoinDocFreqValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/JoinDocFreqValueSource.java
index 173ca57..1cbf58b 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/JoinDocFreqValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/JoinDocFreqValueSource.java
@@ -54,7 +54,7 @@ public class JoinDocFreqValueSource extends FieldCacheSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException
   {
     final BinaryDocValues terms = cache.getTerms(readerContext.reader(), field, false, PackedInts.FAST);
     final IndexReader top = ReaderUtil.getTopLevelContext(readerContext).reader();
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/LinearFloatFunction.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/LinearFloatFunction.java
index 34eed4b..d0d0e04 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/LinearFloatFunction.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/LinearFloatFunction.java
@@ -51,7 +51,7 @@ public class LinearFloatFunction extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FunctionValues vals =  source.getValues(context, readerContext);
     return new FloatDocValues(this) {
       @Override
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/LiteralValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/LiteralValueSource.java
index 1762a80..35c275b 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/LiteralValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/LiteralValueSource.java
@@ -45,7 +45,7 @@ public class LiteralValueSource extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
 
     return new StrDocValues(this) {
       @Override
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/LongFieldSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/LongFieldSource.java
index 6270531..969f4d8 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/LongFieldSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/LongFieldSource.java
@@ -21,9 +21,7 @@ import java.io.IOException;
 import java.util.Map;
 
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.queries.function.FunctionValues;
-import org.apache.lucene.queries.function.ValueSourceScorer;
 import org.apache.lucene.queries.function.docvalues.LongDocValues;
 import org.apache.lucene.search.FieldCache;
 import org.apache.lucene.util.Bits;
@@ -65,7 +63,7 @@ public class LongFieldSource extends FieldCacheSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FieldCache.Longs arr = cache.getLongs(readerContext.reader(), field, parser, true);
     final Bits valid = cache.getDocsWithField(readerContext.reader(), field);
     
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MaxDocValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MaxDocValueSource.java
index 66c58e5..3bd8089 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MaxDocValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MaxDocValueSource.java
@@ -46,7 +46,7 @@ public class MaxDocValueSource extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     IndexSearcher searcher = (IndexSearcher)context.get("searcher");
     return new ConstIntDocValues(searcher.getIndexReader().maxDoc(), this);
   }
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MultiBoolFunction.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MultiBoolFunction.java
index 0075aa4..66cef98 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MultiBoolFunction.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MultiBoolFunction.java
@@ -43,7 +43,7 @@ public abstract class MultiBoolFunction extends BoolFunction {
   protected abstract boolean func(int doc, FunctionValues[] vals);
 
   @Override
-  public BoolDocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public BoolDocValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FunctionValues[] vals =  new FunctionValues[sources.size()];
     int i=0;
     for (ValueSource source : sources) {
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MultiFloatFunction.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MultiFloatFunction.java
index d23c209..7282288 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MultiFloatFunction.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MultiFloatFunction.java
@@ -59,7 +59,7 @@ public abstract class MultiFloatFunction extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FunctionValues[] valsArr = new FunctionValues[sources.length];
     for (int i=0; i<sources.length; i++) {
       valsArr[i] = sources[i].getValues(context, readerContext);
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NormValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NormValueSource.java
index c6b86ae..2141e64 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NormValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NormValueSource.java
@@ -56,7 +56,7 @@ public class NormValueSource extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     IndexSearcher searcher = (IndexSearcher)context.get("searcher");
     final TFIDFSimilarity similarity = IDFValueSource.asTFIDF(searcher.getSimilarity(), field);
     if (similarity == null) {
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NumDocsValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NumDocsValueSource.java
index 3d874ee..6143fbf 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NumDocsValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NumDocsValueSource.java
@@ -41,7 +41,7 @@ public class NumDocsValueSource extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     // Searcher has no numdocs so we must use the reader instead
     return new ConstIntDocValues(ReaderUtil.getTopLevelContext(readerContext).reader().numDocs(), this);
   }
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/OrdFieldSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/OrdFieldSource.java
index ab937a1..ce96c65 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/OrdFieldSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/OrdFieldSource.java
@@ -22,7 +22,6 @@ import java.util.Map;
 
 import org.apache.lucene.index.AtomicReader;
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.CompositeReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.ReaderUtil;
 import org.apache.lucene.index.SlowCompositeReaderWrapper;
@@ -67,7 +66,7 @@ public class OrdFieldSource extends ValueSource {
 
   // TODO: this is trappy? perhaps this query instead should make you pass a slow reader yourself?
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final int off = readerContext.docBase;
     final IndexReader topReader = ReaderUtil.getTopLevelContext(readerContext).reader();
     final AtomicReader r = SlowCompositeReaderWrapper.wrap(topReader);
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java
index 3e22e8e..a684596 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java
@@ -51,7 +51,7 @@ public class QueryValueSource extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map fcontext, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> fcontext, AtomicReaderContext readerContext) throws IOException {
     return new QueryDocValues(this, readerContext, fcontext);
   }
 
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/RangeMapFloatFunction.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/RangeMapFloatFunction.java
index 79df9b9..111d77a 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/RangeMapFloatFunction.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/RangeMapFloatFunction.java
@@ -55,7 +55,7 @@ public class RangeMapFloatFunction extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FunctionValues vals =  source.getValues(context, readerContext);
     return new FloatDocValues(this) {
       @Override
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ReciprocalFloatFunction.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ReciprocalFloatFunction.java
index 63aa5d6..a177260 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ReciprocalFloatFunction.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ReciprocalFloatFunction.java
@@ -61,7 +61,7 @@ public class ReciprocalFloatFunction extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FunctionValues vals = source.getValues(context, readerContext);
     return new FloatDocValues(this) {
       @Override
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ReverseOrdFieldSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ReverseOrdFieldSource.java
index 2d3bc8f..7355c9e 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ReverseOrdFieldSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ReverseOrdFieldSource.java
@@ -22,7 +22,6 @@ import java.util.Map;
 
 import org.apache.lucene.index.AtomicReader;
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.CompositeReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.ReaderUtil;
 import org.apache.lucene.index.SlowCompositeReaderWrapper;
@@ -67,7 +66,7 @@ public class ReverseOrdFieldSource extends ValueSource {
 
   // TODO: this is trappy? perhaps this query instead should make you pass a slow reader yourself?
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final IndexReader topReader = ReaderUtil.getTopLevelContext(readerContext).reader();
     final AtomicReader r = SlowCompositeReaderWrapper.wrap(topReader);
     final int off = readerContext.docBase;
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ScaleFloatFunction.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ScaleFloatFunction.java
index 388f3a2..dda698f 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ScaleFloatFunction.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/ScaleFloatFunction.java
@@ -99,7 +99,7 @@ public class ScaleFloatFunction extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
 
     ScaleInfo scaleInfo = (ScaleInfo)context.get(source);
     if (scaleInfo == null) {
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/SimpleBoolFunction.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/SimpleBoolFunction.java
index d29aeff..7c9c516 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/SimpleBoolFunction.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/SimpleBoolFunction.java
@@ -45,7 +45,7 @@ public abstract class SimpleBoolFunction extends BoolFunction {
   protected abstract boolean func(int doc, FunctionValues vals);
 
   @Override
-  public BoolDocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public BoolDocValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FunctionValues vals =  source.getValues(context, readerContext);
     return new BoolDocValues(this) {
       @Override
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/SimpleFloatFunction.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/SimpleFloatFunction.java
index 54dd606..27dabe4 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/SimpleFloatFunction.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/SimpleFloatFunction.java
@@ -35,7 +35,7 @@ import java.util.Map;
   protected abstract float func(int doc, FunctionValues vals);
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FunctionValues vals =  source.getValues(context, readerContext);
     return new FloatDocValues(this) {
       @Override
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/SumTotalTermFreqValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/SumTotalTermFreqValueSource.java
index e9ab075..b838e57 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/SumTotalTermFreqValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/SumTotalTermFreqValueSource.java
@@ -24,7 +24,6 @@ import org.apache.lucene.queries.function.FunctionValues;
 import org.apache.lucene.queries.function.ValueSource;
 import org.apache.lucene.queries.function.docvalues.LongDocValues;
 import org.apache.lucene.search.IndexSearcher;
-import org.apache.lucene.util.BytesRef;
 
 import java.io.IOException;
 import java.util.Map;
@@ -53,7 +52,7 @@ public class SumTotalTermFreqValueSource extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     return (FunctionValues)context.get(this);
   }
 
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TFValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TFValueSource.java
index 5fe1af4..b7127c0 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TFValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TFValueSource.java
@@ -46,7 +46,7 @@ public class TFValueSource extends TermFreqValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     Fields fields = readerContext.reader().fields();
     final Terms terms = fields.terms(indexedField);
     IndexSearcher searcher = (IndexSearcher)context.get("searcher");
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TermFreqValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TermFreqValueSource.java
index 3fba5f8..0074703 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TermFreqValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TermFreqValueSource.java
@@ -44,7 +44,7 @@ public class TermFreqValueSource extends DocFreqValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     Fields fields = readerContext.reader().fields();
     final Terms terms = fields.terms(indexedField);
 
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TotalTermFreqValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TotalTermFreqValueSource.java
index 90ae4e1..f3cb0a7 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TotalTermFreqValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TotalTermFreqValueSource.java
@@ -58,7 +58,7 @@ public class TotalTermFreqValueSource extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     return (FunctionValues)context.get(this);
   }
 
diff --git lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/VectorValueSource.java lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/VectorValueSource.java
index 8d443b4..1319bf6 100644
--- lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/VectorValueSource.java
+++ lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/VectorValueSource.java
@@ -53,7 +53,7 @@ public class VectorValueSource extends MultiValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     int size = sources.size();
 
     // special-case x,y and lat,lon since it's so common
diff --git lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxSimilarityValueSource.java lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxSimilarityValueSource.java
index 2a3b2a7..fe8c6ce 100644
--- lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxSimilarityValueSource.java
+++ lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxSimilarityValueSource.java
@@ -58,11 +58,13 @@ public class BBoxSimilarityValueSource extends ValueSource {
   /**
    * Returns the DocValues used by the function query.
    *
+   *
+   * @param context
    * @param readerContext the AtomicReaderContext which holds an AtomicReader
    * @return the values
    */
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     AtomicReader reader = readerContext.reader();
     final FieldCache.Doubles minX = FieldCache.DEFAULT.getDoubles(reader, strategy.field_minX, true);
     final FieldCache.Doubles minY = FieldCache.DEFAULT.getDoubles(reader, strategy.field_minY, true);
diff --git lucene/spatial/src/java/org/apache/lucene/spatial/util/CachingDoubleValueSource.java lucene/spatial/src/java/org/apache/lucene/spatial/util/CachingDoubleValueSource.java
index fa9fb85..33257bc 100644
--- lucene/spatial/src/java/org/apache/lucene/spatial/util/CachingDoubleValueSource.java
+++ lucene/spatial/src/java/org/apache/lucene/spatial/util/CachingDoubleValueSource.java
@@ -47,7 +47,7 @@ public class CachingDoubleValueSource extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final int base = readerContext.docBase;
     final FunctionValues vals = source.getValues(context,readerContext);
     return new FunctionValues() {
diff --git lucene/spatial/src/java/org/apache/lucene/spatial/util/ShapeFieldCacheDistanceValueSource.java lucene/spatial/src/java/org/apache/lucene/spatial/util/ShapeFieldCacheDistanceValueSource.java
index b99e9de..b2492f3 100644
--- lucene/spatial/src/java/org/apache/lucene/spatial/util/ShapeFieldCacheDistanceValueSource.java
+++ lucene/spatial/src/java/org/apache/lucene/spatial/util/ShapeFieldCacheDistanceValueSource.java
@@ -57,7 +57,7 @@ public class ShapeFieldCacheDistanceValueSource extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, final AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, final AtomicReaderContext readerContext) throws IOException {
     return new FunctionValues() {
       private final ShapeFieldCache<Point> cache =
           provider.getCache(readerContext.reader());
diff --git lucene/spatial/src/java/org/apache/lucene/spatial/vector/DistanceValueSource.java lucene/spatial/src/java/org/apache/lucene/spatial/vector/DistanceValueSource.java
index ba9621d..0d5c814 100644
--- lucene/spatial/src/java/org/apache/lucene/spatial/vector/DistanceValueSource.java
+++ lucene/spatial/src/java/org/apache/lucene/spatial/vector/DistanceValueSource.java
@@ -62,7 +62,7 @@ public class DistanceValueSource extends ValueSource {
    * Returns the FunctionValues used by the function query.
    */
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     AtomicReader reader = readerContext.reader();
 
     final FieldCache.Doubles ptX = FieldCache.DEFAULT.getDoubles(reader, strategy.getFieldNameX(), true);
diff --git solr/core/src/java/org/apache/solr/handler/component/FieldFacetStats.java solr/core/src/java/org/apache/solr/handler/component/FieldFacetStats.java
index 6cd9a19..e4728e0 100644
--- solr/core/src/java/org/apache/solr/handler/component/FieldFacetStats.java
+++ solr/core/src/java/org/apache/solr/handler/component/FieldFacetStats.java
@@ -152,7 +152,7 @@ public class FieldFacetStats {
 
   public void setNextReader(AtomicReaderContext ctx) throws IOException {
     this.context = ctx;
-    values = valueSource.getValues(Collections.emptyMap(), ctx);
+    values = valueSource.getValues(Collections.<String,Object>emptyMap(), ctx);
     for (StatsValues stats : facetStatsValues.values()) {
       stats.setNextReader(ctx);
     }
diff --git solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java
index 2777a48..90d8482 100644
--- solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java
+++ solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java
@@ -200,7 +200,7 @@ abstract class AbstractStatsValues<T> implements StatsValues {
     if (valueSource == null) {
       valueSource = ft.getValueSource(sf, null);
     }
-    values = valueSource.getValues(Collections.emptyMap(), ctx);
+    values = valueSource.getValues(Collections.<String,Object>emptyMap(), ctx);
   }
 
   /**
diff --git solr/core/src/java/org/apache/solr/request/NumericFacets.java solr/core/src/java/org/apache/solr/request/NumericFacets.java
index 62950e2..f099f44 100644
--- solr/core/src/java/org/apache/solr/request/NumericFacets.java
+++ solr/core/src/java/org/apache/solr/request/NumericFacets.java
@@ -249,7 +249,7 @@ final class NumericFacets {
       // Entries from the PQ first, then using the terms dictionary
       for (Entry entry : counts) {
         final int readerIdx = ReaderUtil.subIndex(entry.docID, leaves);
-        final FunctionValues values = vs.getValues(Collections.emptyMap(), leaves.get(readerIdx));
+        final FunctionValues values = vs.getValues(Collections.<String,Object>emptyMap(), leaves.get(readerIdx));
         result.add(values.strVal(entry.docID - leaves.get(readerIdx).docBase), entry.count);
       }
 
@@ -262,7 +262,7 @@ final class NumericFacets {
         while (pq.size() > 0) {
           Entry entry = pq.pop();
           final int readerIdx = ReaderUtil.subIndex(entry.docID, leaves);
-          final FunctionValues values = vs.getValues(Collections.emptyMap(), leaves.get(readerIdx));
+          final FunctionValues values = vs.getValues(Collections.<String,Object>emptyMap(), leaves.get(readerIdx));
           alreadySeen.add(values.strVal(entry.docID - leaves.get(readerIdx).docBase));
         }
         for (int i = 0; i < result.size(); ++i) {
@@ -318,7 +318,7 @@ final class NumericFacets {
       while (pq.size() > 0) {
         final Entry entry = pq.pop();
         final int readerIdx = ReaderUtil.subIndex(entry.docID, leaves);
-        final FunctionValues values = vs.getValues(Collections.emptyMap(), leaves.get(readerIdx));
+        final FunctionValues values = vs.getValues(Collections.<String,Object>emptyMap(), leaves.get(readerIdx));
         counts.put(values.strVal(entry.docID - leaves.get(readerIdx).docBase), entry.count);
       }
       final Terms terms = searcher.getAtomicReader().terms(fieldName);
diff --git solr/core/src/java/org/apache/solr/schema/BoolField.java solr/core/src/java/org/apache/solr/schema/BoolField.java
index bb9a259..c68983a 100644
--- solr/core/src/java/org/apache/solr/schema/BoolField.java
+++ solr/core/src/java/org/apache/solr/schema/BoolField.java
@@ -25,7 +25,6 @@ import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.Tokenizer;
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.GeneralField;
 import org.apache.lucene.index.SortedDocValues;
 import org.apache.lucene.index.StorableField;
 import org.apache.lucene.queries.function.FunctionValues;
@@ -168,7 +167,7 @@ class BoolFieldSource extends ValueSource {
 
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final SortedDocValues sindex = FieldCache.DEFAULT.getTermsIndex(readerContext.reader(), field);
 
     // figure out what ord maps to true
diff --git solr/core/src/java/org/apache/solr/schema/CurrencyField.java solr/core/src/java/org/apache/solr/schema/CurrencyField.java
index ab4e839..e4b6b978 100644
--- solr/core/src/java/org/apache/solr/schema/CurrencyField.java
+++ solr/core/src/java/org/apache/solr/schema/CurrencyField.java
@@ -379,7 +379,7 @@ public class CurrencyField extends FieldType implements SchemaAware, ResourceLoa
     }
 
     @Override
-    public FunctionValues getValues(Map context, AtomicReaderContext reader) 
+    public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext reader)
       throws IOException {
       final FunctionValues amounts = source.getValues(context, reader);
       // the target digits & currency of our source, 
@@ -492,7 +492,7 @@ public class CurrencyField extends FieldType implements SchemaAware, ResourceLoa
     public Currency getTargetCurrency() { return targetCurrency; }
 
     @Override
-    public FunctionValues getValues(Map context, AtomicReaderContext reader) throws IOException {
+    public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext reader) throws IOException {
       final FunctionValues amounts = amountValues.getValues(context, reader);
       final FunctionValues currencies = currencyValues.getValues(context, reader);
 
diff --git solr/core/src/java/org/apache/solr/schema/DateField.java solr/core/src/java/org/apache/solr/schema/DateField.java
index faf9c4f..82d5e0f 100644
--- solr/core/src/java/org/apache/solr/schema/DateField.java
+++ solr/core/src/java/org/apache/solr/schema/DateField.java
@@ -18,8 +18,6 @@
 package org.apache.solr.schema;
 
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.GeneralField;
-import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.StorableField;
 import org.apache.lucene.queries.function.docvalues.DocTermsIndexDocValues;
 import org.apache.lucene.search.Query;
@@ -476,7 +474,7 @@ class DateFieldSource extends FieldCacheSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     return new DocTermsIndexDocValues(this, readerContext, field) {
       @Override
       protected String toTerm(String readableValue) {
diff --git solr/core/src/java/org/apache/solr/schema/RandomSortField.java solr/core/src/java/org/apache/solr/schema/RandomSortField.java
index 3ee8667..344e7b9 100644
--- solr/core/src/java/org/apache/solr/schema/RandomSortField.java
+++ solr/core/src/java/org/apache/solr/schema/RandomSortField.java
@@ -20,8 +20,6 @@ package org.apache.solr.schema;
 import java.io.IOException;
 import java.util.Map;
 
-import org.apache.lucene.index.GeneralField;
-import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.AtomicReaderContext;
 import org.apache.lucene.index.ReaderUtil;
@@ -165,7 +163,7 @@ public class RandomSortField extends FieldType {
     }
 
     @Override
-    public FunctionValues getValues(Map context, final AtomicReaderContext readerContext) throws IOException {
+    public FunctionValues getValues(Map<String, Object> context, final AtomicReaderContext readerContext) throws IOException {
       return new IntDocValues(this) {
           private final int seed = getSeed(field, readerContext);
           @Override
diff --git solr/core/src/java/org/apache/solr/schema/SortableDoubleField.java solr/core/src/java/org/apache/solr/schema/SortableDoubleField.java
index 2f4b0a6..4c0a2b7 100644
--- solr/core/src/java/org/apache/solr/schema/SortableDoubleField.java
+++ solr/core/src/java/org/apache/solr/schema/SortableDoubleField.java
@@ -29,8 +29,6 @@ import org.apache.lucene.util.mutable.MutableValue;
 import org.apache.lucene.util.mutable.MutableValueDouble;
 import org.apache.solr.search.QParser;
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.GeneralField;
-import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.StorableField;
 import org.apache.solr.util.NumberUtils;
 import org.apache.solr.response.TextResponseWriter;
@@ -120,7 +118,7 @@ class SortableDoubleFieldSource extends FieldCacheSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final double def = defVal;
 
     return new DocTermsIndexDocValues(this, readerContext, field) {
diff --git solr/core/src/java/org/apache/solr/schema/SortableFloatField.java solr/core/src/java/org/apache/solr/schema/SortableFloatField.java
index e66e255..58e6169 100644
--- solr/core/src/java/org/apache/solr/schema/SortableFloatField.java
+++ solr/core/src/java/org/apache/solr/schema/SortableFloatField.java
@@ -29,8 +29,6 @@ import org.apache.lucene.util.mutable.MutableValue;
 import org.apache.lucene.util.mutable.MutableValueFloat;
 import org.apache.solr.search.QParser;
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.GeneralField;
-import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.StorableField;
 import org.apache.solr.util.NumberUtils;
 import org.apache.solr.response.TextResponseWriter;
@@ -124,7 +122,7 @@ class SortableFloatFieldSource extends FieldCacheSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final float def = defVal;
 
     return new DocTermsIndexDocValues(this, readerContext, field) {
diff --git solr/core/src/java/org/apache/solr/schema/SortableIntField.java solr/core/src/java/org/apache/solr/schema/SortableIntField.java
index 9558573..7bc3410 100644
--- solr/core/src/java/org/apache/solr/schema/SortableIntField.java
+++ solr/core/src/java/org/apache/solr/schema/SortableIntField.java
@@ -29,8 +29,6 @@ import org.apache.lucene.util.mutable.MutableValue;
 import org.apache.lucene.util.mutable.MutableValueInt;
 import org.apache.solr.search.QParser;
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.GeneralField;
-import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.StorableField;
 import org.apache.solr.util.NumberUtils;
 import org.apache.solr.response.TextResponseWriter;
@@ -126,7 +124,7 @@ class SortableIntFieldSource extends FieldCacheSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final int def = defVal;
 
     return new DocTermsIndexDocValues(this, readerContext, field) {
diff --git solr/core/src/java/org/apache/solr/schema/SortableLongField.java solr/core/src/java/org/apache/solr/schema/SortableLongField.java
index 0e61eef..14c6927 100644
--- solr/core/src/java/org/apache/solr/schema/SortableLongField.java
+++ solr/core/src/java/org/apache/solr/schema/SortableLongField.java
@@ -29,8 +29,6 @@ import org.apache.lucene.util.mutable.MutableValue;
 import org.apache.lucene.util.mutable.MutableValueLong;
 import org.apache.solr.search.QParser;
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.GeneralField;
-import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.StorableField;
 import org.apache.solr.util.NumberUtils;
 import org.apache.solr.response.TextResponseWriter;
@@ -124,7 +122,7 @@ class SortableLongFieldSource extends FieldCacheSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final long def = defVal;
 
     return new DocTermsIndexDocValues(this, readerContext, field) {
diff --git solr/core/src/java/org/apache/solr/schema/StrFieldSource.java solr/core/src/java/org/apache/solr/schema/StrFieldSource.java
index 7cf4784..38195af 100644
--- solr/core/src/java/org/apache/solr/schema/StrFieldSource.java
+++ solr/core/src/java/org/apache/solr/schema/StrFieldSource.java
@@ -37,7 +37,7 @@ public class StrFieldSource extends FieldCacheSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     return new DocTermsIndexDocValues(this, readerContext, field) {
 
       @Override
diff --git solr/core/src/java/org/apache/solr/search/ValueSourceParser.java solr/core/src/java/org/apache/solr/search/ValueSourceParser.java
index e426b8b..ff93a69 100644
--- solr/core/src/java/org/apache/solr/search/ValueSourceParser.java
+++ solr/core/src/java/org/apache/solr/search/ValueSourceParser.java
@@ -992,7 +992,7 @@ class LongConstValueSource extends ConstNumberSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     return new LongDocValues(this) {
       @Override
       public float floatVal(int doc) {
@@ -1099,7 +1099,7 @@ abstract class DoubleParser extends NamedParser {
     }
 
     @Override
-    public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
       final FunctionValues vals =  source.getValues(context, readerContext);
       return new DoubleDocValues(this) {
         @Override
@@ -1147,7 +1147,7 @@ abstract class Double2Parser extends NamedParser {
     }
 
     @Override
-    public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
       final FunctionValues aVals =  a.getValues(context, readerContext);
       final FunctionValues bVals =  b.getValues(context, readerContext);
       return new DoubleDocValues(this) {
@@ -1201,7 +1201,7 @@ class BoolConstValueSource extends ConstNumberSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     return new BoolDocValues(this) {
       @Override
       public boolean boolVal(int doc) {
@@ -1262,7 +1262,7 @@ class TestValueSource extends ValueSource {
   }
   
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     if (context.get(this) == null) {
       SolrRequestInfo requestInfo = SolrRequestInfo.getRequestInfo();
       throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "testfunc: unweighted value source detected.  delegate="+source + " request=" + (requestInfo==null ? "null" : requestInfo.getReq()));
diff --git solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java
index b6bb66b..7974ed5 100644
--- solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java
+++ solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java
@@ -77,7 +77,7 @@ public class FileFloatSource extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final int off = readerContext.docBase;
     IndexReaderContext topLevelContext = ReaderUtil.getTopLevelContext(readerContext);
 
diff --git solr/core/src/java/org/apache/solr/search/function/distance/GeohashFunction.java solr/core/src/java/org/apache/solr/search/function/distance/GeohashFunction.java
index 0be1dd4..8f157b6 100644
--- solr/core/src/java/org/apache/solr/search/function/distance/GeohashFunction.java
+++ solr/core/src/java/org/apache/solr/search/function/distance/GeohashFunction.java
@@ -46,7 +46,7 @@ public class GeohashFunction extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FunctionValues latDV = lat.getValues(context, readerContext);
     final FunctionValues lonDV = lon.getValues(context, readerContext);
 
diff --git solr/core/src/java/org/apache/solr/search/function/distance/GeohashHaversineFunction.java solr/core/src/java/org/apache/solr/search/function/distance/GeohashHaversineFunction.java
index 35e95d4..6e53023 100644
--- solr/core/src/java/org/apache/solr/search/function/distance/GeohashHaversineFunction.java
+++ solr/core/src/java/org/apache/solr/search/function/distance/GeohashHaversineFunction.java
@@ -61,7 +61,7 @@ public class GeohashHaversineFunction extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FunctionValues gh1DV = geoHash1.getValues(context, readerContext);
     final FunctionValues gh2DV = geoHash2.getValues(context, readerContext);
 
diff --git solr/core/src/java/org/apache/solr/search/function/distance/HaversineConstFunction.java solr/core/src/java/org/apache/solr/search/function/distance/HaversineConstFunction.java
index 3352720..d09d8b3 100644
--- solr/core/src/java/org/apache/solr/search/function/distance/HaversineConstFunction.java
+++ solr/core/src/java/org/apache/solr/search/function/distance/HaversineConstFunction.java
@@ -57,7 +57,7 @@ public class HaversineConstFunction extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FunctionValues latVals = latSource.getValues(context, readerContext);
     final FunctionValues lonVals = lonSource.getValues(context, readerContext);
     final double latCenterRad = this.latCenter * DEGREES_TO_RADIANS;
diff --git solr/core/src/java/org/apache/solr/search/function/distance/HaversineFunction.java solr/core/src/java/org/apache/solr/search/function/distance/HaversineFunction.java
index 7484a2a..9673102 100644
--- solr/core/src/java/org/apache/solr/search/function/distance/HaversineFunction.java
+++ solr/core/src/java/org/apache/solr/search/function/distance/HaversineFunction.java
@@ -94,7 +94,7 @@ public class HaversineFunction extends ValueSource {
 
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FunctionValues vals1 = p1.getValues(context, readerContext);
 
     final FunctionValues vals2 = p2.getValues(context, readerContext);
diff --git solr/core/src/java/org/apache/solr/search/function/distance/StringDistanceFunction.java solr/core/src/java/org/apache/solr/search/function/distance/StringDistanceFunction.java
index f0bd4903..52eb868 100644
--- solr/core/src/java/org/apache/solr/search/function/distance/StringDistanceFunction.java
+++ solr/core/src/java/org/apache/solr/search/function/distance/StringDistanceFunction.java
@@ -44,7 +44,7 @@ public class StringDistanceFunction extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
     final FunctionValues str1DV = str1.getValues(context, readerContext);
     final FunctionValues str2DV = str2.getValues(context, readerContext);
     return new FloatDocValues(this) {
diff --git solr/core/src/java/org/apache/solr/search/function/distance/VectorDistanceFunction.java solr/core/src/java/org/apache/solr/search/function/distance/VectorDistanceFunction.java
index 9fc5203..0a9728b 100644
--- solr/core/src/java/org/apache/solr/search/function/distance/VectorDistanceFunction.java
+++ solr/core/src/java/org/apache/solr/search/function/distance/VectorDistanceFunction.java
@@ -79,7 +79,7 @@ public class VectorDistanceFunction extends ValueSource {
   }
 
   @Override
-  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+  public FunctionValues getValues(Map<String, Object> context, AtomicReaderContext readerContext) throws IOException {
 
     final FunctionValues vals1 = source1.getValues(context, readerContext);
 
