@@ -0,0 +1,2671 @@
+/**%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.apache.solr.schema;%0A%0Aimport org.apache.lucene.index.IndexReader;%0Aimport org.apache.lucene.util.BytesRef;%0Aimport org.apache.solr.search.function.DocValues;%0Aimport org.apache.solr.search.function.FieldCacheSource;%0Aimport org.apache.solr.search.function.StringIndexDocValues;%0A%0Aimport java.io.IOException;%0Aimport java.util.Map;%0A%0Apublic class StrFieldSource extends FieldCacheSource %7B%0A%0A  public StrFieldSource(String field) %7B%0A    super(field);%0A  %7D%0A%0A  public String description() %7B%0A    return %22str(%22 + field + ')';%0A  %7D%0A%0A  public DocValues getValues(Map context, IndexReader reader) throws IOException %7B%0A    return new StringIndexDocValues(this, reader, field) %7B%0A      protected String toTerm(String readableValue) %7B%0A        return readableValue;%0A      %7D%0A%0A      public float floatVal(int doc) %7B%0A        return (float)intVal(doc);%0A      %7D%0A%0A      public int intVal(int doc) %7B%0A        int ord=termsIndex.getOrd(doc);%0A        return ord;%0A      %7D%0A%0A      public long longVal(int doc) %7B%0A        return (long)intVal(doc);%0A      %7D%0A%0A      public double doubleVal(int doc) %7B%0A        return (double)intVal(doc);%0A      %7D%0A%0A      public int ordVal(int doc) %7B%0A        return termsIndex.getOrd(doc);%0A      %7D%0A%0A      public int numOrd() %7B%0A        return termsIndex.numOrd();%0A      %7D%0A%0A      public String strVal(int doc) %7B%0A        int ord=termsIndex.getOrd(doc);%0A        if (ord == 0) %7B%0A          return null;%0A        %7D else %7B%0A          return termsIndex.lookup(ord, new BytesRef()).utf8ToString();%0A        %7D%0A      %7D%0A%0A      public String toString(int doc) %7B%0A        return description() + '=' + strVal(doc);%0A      %7D%0A    %7D;%0A  %7D%0A%0A  public boolean equals(Object o) %7B%0A    return o instanceof StrFieldSource%0A            && super.equals(o);%0A  %7D%0A%0A  private static int hcode = SortableFloatFieldSource.class.hashCode();%0A  public int hashCode() %7B%0A    return hcode + super.hashCode();%0A  %7D;%0A%7D%0A

fix pivot facet native type representation via FieldType.toObject(indexedTerm)