Package org.apache.solr.search.function

Examples of org.apache.solr.search.function.DocValues


    vs.createWeight(context, sqr.getSearcher());
    SolrIndexReader sr = sqr.getSearcher().getReader();
    int idx = SolrIndexReader.readerIndex(doc, sr.getLeafOffsets());
    int base = sr.getLeafOffsets()[idx];
    SolrIndexReader sub = sr.getLeafReaders()[idx];
    DocValues vals = vs.getValues(context, sub);
    return vals.strVal(doc-base);
  }
View Full Code Here


    final FieldCache.StringIndex index = cache.getStringIndex(reader, field);
    final int[] order = index.order;
    final String[] lookup = index.lookup;
    final float def = defVal;

    return new DocValues() {
      public float floatVal(int doc) {
        int ord=order[doc];
        return ord==0 ? def  : NumberUtils.SortableStr2float(lookup[ord]);
      }
View Full Code Here

    final FieldCache.StringIndex index = cache.getStringIndex(reader, field);
    final int[] order = index.order;
    final String[] lookup = index.lookup;
    final long def = defVal;

    return new DocValues() {
      public float floatVal(int doc) {
        return (float)longVal(doc);
      }

      public int intVal(int doc) {
View Full Code Here

    final FieldCache.StringIndex index = cache.getStringIndex(reader, field);
    final int[] order = index.order;
    final String[] lookup = index.lookup;
    final double def = defVal;

    return new DocValues() {
      public float floatVal(int doc) {
        return (float)doubleVal(doc);
      }

      public int intVal(int doc) {
View Full Code Here

    final FieldCache.StringIndex index = cache.getStringIndex(reader, field);
    final int[] order = index.order;
    final String[] lookup = index.lookup;
    final int def = defVal;

    return new DocValues() {
      public float floatVal(int doc) {
        return (float)intVal(doc);
      }

      public int intVal(int doc) {
View Full Code Here

      return field;
    }

    @Override
    public DocValues getValues(final IndexReader reader) throws IOException {
      return new DocValues() {
          private final int seed = getSeed(field, reader);
          @Override
          public float floatVal(int doc) {
            return (float)hash(doc+seed);
          }
View Full Code Here

  public DocValues getValues(IndexReader reader) throws IOException {
    final int[] arr = (parser==null) ?
            cache.getInts(reader, field) :
            cache.getInts(reader, field, parser);
    return new DocValues() {
      public float floatVal(int doc) {
        return (float)arr[doc];
      }

      public int intVal(int doc) {
View Full Code Here

    final FieldCache.StringIndex sindex = FieldCache.DEFAULT.getStringIndex(reader, field);

    final int arr[] = sindex.order;
    final int end = sindex.lookup.length;

    return new DocValues() {
      public float floatVal(int doc) {
        return (float)(end - arr[doc]);
      }

      public int intVal(int doc) {
View Full Code Here

    return "ord(" + field + ')';
  }

  public DocValues getValues(IndexReader reader) throws IOException {
    final int[] arr = FieldCache.DEFAULT.getStringIndex(reader, field).order;
    return new DocValues() {
      public float floatVal(int doc) {
        return (float)arr[doc];
      }

      public int intVal(int doc) {
View Full Code Here

  public DocValues getValues(IndexReader reader) throws IOException {
    final float[] arr = (parser==null) ?
            cache.getFloats(reader, field) :
            cache.getFloats(reader, field, parser);
    return new DocValues() {
      public float floatVal(int doc) {
        return arr[doc];
      }

      public int intVal(int doc) {
View Full Code Here

TOP

Related Classes of org.apache.solr.search.function.DocValues

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.