org.elasticsearch.index.mapper.core
Class DoubleFieldMapper

java.lang.Object
  extended by org.elasticsearch.index.mapper.core.AbstractFieldMapper<T>
      extended by org.elasticsearch.index.mapper.core.NumberFieldMapper<Double>
          extended by org.elasticsearch.index.mapper.core.DoubleFieldMapper
All Implemented Interfaces:
ToXContent, FieldMapper<Double>, AllFieldMapper.IncludeInAll, Mapper

public class DoubleFieldMapper
extends NumberFieldMapper<Double>


Nested Class Summary
static class DoubleFieldMapper.Builder
           
static class DoubleFieldMapper.CustomDoubleNumericField
           
static class DoubleFieldMapper.Defaults
           
static class DoubleFieldMapper.TypeParser
           
 
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.core.NumberFieldMapper
NumberFieldMapper.CustomNumericField
 
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.core.AbstractFieldMapper
AbstractFieldMapper.OpenBuilder<T extends AbstractFieldMapper.Builder,Y extends AbstractFieldMapper>
 
Nested classes/interfaces inherited from interface org.elasticsearch.index.mapper.Mapper
Mapper.BuilderContext
 
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.MapParams, ToXContent.Params
 
Nested classes/interfaces inherited from interface org.elasticsearch.index.mapper.FieldMapper
FieldMapper.Names
 
Field Summary
static String CONTENT_TYPE
           
 
Fields inherited from class org.elasticsearch.index.mapper.core.NumberFieldMapper
dFuzzyFactor, fuzzyFactor, ignoreMalformed, includeInAll, precisionStep
 
Fields inherited from class org.elasticsearch.index.mapper.core.AbstractFieldMapper
boost, index, indexAnalyzer, indexOptions, names, omitNorms, searchAnalyzer, store, termVector
 
Fields inherited from interface org.elasticsearch.index.mapper.Mapper
EMPTY_ARRAY
 
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
 
Constructor Summary
protected DoubleFieldMapper(FieldMapper.Names names, int precisionStep, String fuzzyFactor, org.apache.lucene.document.Field.Index index, org.apache.lucene.document.Field.Store store, float boost, boolean omitNorms, org.apache.lucene.index.FieldInfo.IndexOptions indexOptions, Double nullValue, boolean ignoreMalformed)
           
 
Method Summary
protected  String contentType()
           
protected  boolean customBoost()
          Derived classes can override it to specify that boost value is set by derived classes.
protected  void doXContentBody(XContentBuilder builder)
           
 FieldDataType fieldDataType()
           
 org.apache.lucene.search.Filter fieldFilter(String value, QueryParseContext context)
          Numeric field level filter are basically range queries with same value and included.
 org.apache.lucene.search.Query fieldQuery(String value, QueryParseContext context)
          Numeric field level query are basically range queries with same value and included.
 org.apache.lucene.search.Query fuzzyQuery(String value, double minSim, int prefixLength, int maxExpansions)
           
 org.apache.lucene.search.Query fuzzyQuery(String value, String minSim, int prefixLength, int maxExpansions)
           
 String indexedValue(String value)
          Returns the indexed value.
protected  org.apache.lucene.document.Fieldable innerParseCreateField(ParseContext context)
           
protected  int maxPrecisionStep()
           
 void merge(Mapper mergeWith, MergeContext mergeContext)
           
 org.apache.lucene.search.Filter nullValueFilter()
          Null value filter, returns null if there is no null value associated with the field.
 org.apache.lucene.search.Filter rangeFilter(Double lowerTerm, Double upperTerm, boolean includeLower, boolean includeUpper)
           
 org.apache.lucene.search.Filter rangeFilter(FieldDataCache fieldDataCache, String lowerTerm, String upperTerm, boolean includeLower, boolean includeUpper, QueryParseContext context)
          A range filter based on the field data cache.
 org.apache.lucene.search.Filter rangeFilter(String lowerTerm, String upperTerm, boolean includeLower, boolean includeUpper, QueryParseContext context)
          Constructs a range query filter based on the mapper.
 org.apache.lucene.search.Query rangeQuery(String lowerTerm, String upperTerm, boolean includeLower, boolean includeUpper, QueryParseContext context)
          Constructs a range query based on the mapper.
 Double value(org.apache.lucene.document.Fieldable field)
          Returns the actual value of the field.
 Double valueFromString(String value)
           
 
Methods inherited from class org.elasticsearch.index.mapper.core.NumberFieldMapper
close, includeInAll, includeInAllIfNotSet, parseCreateField, parseFuzzyFactor, popCachedStream, precisionStep, useFieldQueryWithQueryString, valueAsString, valueForSearch
 
Methods inherited from class org.elasticsearch.index.mapper.core.AbstractFieldMapper
analyzed, boost, index, indexAnalyzer, indexed, indexOptions, indexOptionToString, name, names, omitNorms, parse, prefixFilter, prefixQuery, queryStringTermQuery, searchAnalyzer, searchQuoteAnalyzer, store, stored, termVector, toXContent, traverse, traverse
 
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.Mapper
name, parse, traverse, traverse
 
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContent
toXContent
 

Field Detail

CONTENT_TYPE

public static final String CONTENT_TYPE
See Also:
Constant Field Values
Constructor Detail

DoubleFieldMapper

protected DoubleFieldMapper(FieldMapper.Names names,
                            int precisionStep,
                            String fuzzyFactor,
                            org.apache.lucene.document.Field.Index index,
                            org.apache.lucene.document.Field.Store store,
                            float boost,
                            boolean omitNorms,
                            org.apache.lucene.index.FieldInfo.IndexOptions indexOptions,
                            Double nullValue,
                            boolean ignoreMalformed)
Method Detail

maxPrecisionStep

protected int maxPrecisionStep()
Specified by:
maxPrecisionStep in class NumberFieldMapper<Double>

value

public Double value(org.apache.lucene.document.Fieldable field)
Description copied from interface: FieldMapper
Returns the actual value of the field.


valueFromString

public Double valueFromString(String value)

indexedValue

public String indexedValue(String value)
Description copied from interface: FieldMapper
Returns the indexed value.

Specified by:
indexedValue in interface FieldMapper<Double>
Overrides:
indexedValue in class AbstractFieldMapper<Double>

fuzzyQuery

public org.apache.lucene.search.Query fuzzyQuery(String value,
                                                 String minSim,
                                                 int prefixLength,
                                                 int maxExpansions)
Specified by:
fuzzyQuery in interface FieldMapper<Double>
Specified by:
fuzzyQuery in class NumberFieldMapper<Double>

fuzzyQuery

public org.apache.lucene.search.Query fuzzyQuery(String value,
                                                 double minSim,
                                                 int prefixLength,
                                                 int maxExpansions)
Specified by:
fuzzyQuery in interface FieldMapper<Double>
Specified by:
fuzzyQuery in class NumberFieldMapper<Double>

fieldQuery

public org.apache.lucene.search.Query fieldQuery(String value,
                                                 @Nullable
                                                 QueryParseContext context)
Description copied from class: NumberFieldMapper
Numeric field level query are basically range queries with same value and included. That's the recommended way to execute it.

Specified by:
fieldQuery in interface FieldMapper<Double>
Overrides:
fieldQuery in class NumberFieldMapper<Double>

rangeQuery

public org.apache.lucene.search.Query rangeQuery(String lowerTerm,
                                                 String upperTerm,
                                                 boolean includeLower,
                                                 boolean includeUpper,
                                                 @Nullable
                                                 QueryParseContext context)
Description copied from interface: FieldMapper
Constructs a range query based on the mapper.

Specified by:
rangeQuery in interface FieldMapper<Double>
Specified by:
rangeQuery in class NumberFieldMapper<Double>

fieldFilter

public org.apache.lucene.search.Filter fieldFilter(String value,
                                                   @Nullable
                                                   QueryParseContext context)
Description copied from class: NumberFieldMapper
Numeric field level filter are basically range queries with same value and included. That's the recommended way to execute it.

Specified by:
fieldFilter in interface FieldMapper<Double>
Overrides:
fieldFilter in class NumberFieldMapper<Double>

rangeFilter

public org.apache.lucene.search.Filter rangeFilter(String lowerTerm,
                                                   String upperTerm,
                                                   boolean includeLower,
                                                   boolean includeUpper,
                                                   @Nullable
                                                   QueryParseContext context)
Description copied from interface: FieldMapper
Constructs a range query filter based on the mapper.

Specified by:
rangeFilter in interface FieldMapper<Double>
Specified by:
rangeFilter in class NumberFieldMapper<Double>

rangeFilter

public org.apache.lucene.search.Filter rangeFilter(Double lowerTerm,
                                                   Double upperTerm,
                                                   boolean includeLower,
                                                   boolean includeUpper)

rangeFilter

public org.apache.lucene.search.Filter rangeFilter(FieldDataCache fieldDataCache,
                                                   String lowerTerm,
                                                   String upperTerm,
                                                   boolean includeLower,
                                                   boolean includeUpper,
                                                   @Nullable
                                                   QueryParseContext context)
Description copied from class: NumberFieldMapper
A range filter based on the field data cache.

Specified by:
rangeFilter in class NumberFieldMapper<Double>

nullValueFilter

public org.apache.lucene.search.Filter nullValueFilter()
Description copied from interface: FieldMapper
Null value filter, returns null if there is no null value associated with the field.

Specified by:
nullValueFilter in interface FieldMapper<Double>
Overrides:
nullValueFilter in class AbstractFieldMapper<Double>

customBoost

protected boolean customBoost()
Description copied from class: AbstractFieldMapper
Derived classes can override it to specify that boost value is set by derived classes.

Overrides:
customBoost in class AbstractFieldMapper<Double>

innerParseCreateField

protected org.apache.lucene.document.Fieldable innerParseCreateField(ParseContext context)
                                                              throws IOException
Specified by:
innerParseCreateField in class NumberFieldMapper<Double>
Throws:
IOException

fieldDataType

public FieldDataType fieldDataType()
Specified by:
fieldDataType in interface FieldMapper<Double>
Specified by:
fieldDataType in class NumberFieldMapper<Double>

contentType

protected String contentType()
Specified by:
contentType in class AbstractFieldMapper<Double>

merge

public void merge(Mapper mergeWith,
                  MergeContext mergeContext)
           throws MergeMappingException
Specified by:
merge in interface Mapper
Overrides:
merge in class NumberFieldMapper<Double>
Throws:
MergeMappingException

doXContentBody

protected void doXContentBody(XContentBuilder builder)
                       throws IOException
Overrides:
doXContentBody in class NumberFieldMapper<Double>
Throws:
IOException


Copyright © 2009-2012. All Rights Reserved.