Class SourceValueFetcher

java.lang.Object
org.elasticsearch.index.mapper.SourceValueFetcher
All Implemented Interfaces:
ValueFetcher

public abstract class SourceValueFetcher
extends java.lang.Object
implements ValueFetcher
An implementation of ValueFetcher that knows how to extract values from the document source. Most standard field mappers will use this class to implement value fetching. Field types that handle arrays directly should instead use ArraySourceValueFetcher.
  • Constructor Summary

    Constructors 
    Constructor Description
    SourceValueFetcher​(java.lang.String fieldName, MapperService mapperService)  
    SourceValueFetcher​(java.lang.String fieldName, MapperService mapperService, java.lang.Object nullValue)  
  • Method Summary

    Modifier and Type Method Description
    java.util.List<java.lang.Object> fetchValues​(SourceLookup lookup)
    Given access to a document's _source, return this field's values.
    static SourceValueFetcher identity​(java.lang.String fieldName, MapperService mapperService, java.lang.String format)
    Creates a SourceValueFetcher that passes through source values unmodified.
    protected abstract java.lang.Object parseSourceValue​(java.lang.Object value)
    Given a value that has been extracted from a document's source, parse it into a standard format.
    static SourceValueFetcher toString​(java.lang.String fieldName, MapperService mapperService, java.lang.String format)
    Creates a SourceValueFetcher that converts source values to strings.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.elasticsearch.index.mapper.ValueFetcher

    setNextReader