org.elasticsearch.index.mapper.geo
Class GeoPointFieldMapper

java.lang.Object
  extended by org.elasticsearch.index.mapper.geo.GeoPointFieldMapper
All Implemented Interfaces:
ToXContent, Mapper, ArrayValueMapperParser

public class GeoPointFieldMapper
extends Object
implements Mapper, ArrayValueMapperParser

Parsing: We handle:

- "field" : "geo_hash" - "field" : "lat,lon" - "field" : { "lat" : 1.1, "lon" : 2.1 }


Nested Class Summary
static class GeoPointFieldMapper.Builder
           
static class GeoPointFieldMapper.Defaults
           
static class GeoPointFieldMapper.GeoStringFieldMapper
           
static class GeoPointFieldMapper.Names
           
static class GeoPointFieldMapper.TypeParser
           
 
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
 
Field Summary
static String CONTENT_TYPE
           
 
Fields inherited from interface org.elasticsearch.index.mapper.Mapper
EMPTY_ARRAY
 
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
 
Constructor Summary
GeoPointFieldMapper(String name, ContentPath.Type pathType, boolean enableLatLon, boolean enableGeoHash, Integer precisionStep, int precision, DoubleFieldMapper latMapper, DoubleFieldMapper lonMapper, StringFieldMapper geohashMapper, GeoPointFieldMapper.GeoStringFieldMapper geoStringMapper, boolean validateLon, boolean validateLat, boolean normalizeLon, boolean normalizeLat)
           
 
Method Summary
 void close()
           
 boolean isEnableLatLon()
           
 DoubleFieldMapper latMapper()
           
 DoubleFieldMapper lonMapper()
           
 void merge(Mapper mergeWith, MergeContext mergeContext)
           
 String name()
           
 void parse(ParseContext context)
           
 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params)
           
 void traverse(FieldMapperListener fieldMapperListener)
           
 void traverse(ObjectMapperListener objectMapperListener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_TYPE

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

GeoPointFieldMapper

public GeoPointFieldMapper(String name,
                           ContentPath.Type pathType,
                           boolean enableLatLon,
                           boolean enableGeoHash,
                           Integer precisionStep,
                           int precision,
                           DoubleFieldMapper latMapper,
                           DoubleFieldMapper lonMapper,
                           StringFieldMapper geohashMapper,
                           GeoPointFieldMapper.GeoStringFieldMapper geoStringMapper,
                           boolean validateLon,
                           boolean validateLat,
                           boolean normalizeLon,
                           boolean normalizeLat)
Method Detail

name

public String name()
Specified by:
name in interface Mapper

latMapper

public DoubleFieldMapper latMapper()

lonMapper

public DoubleFieldMapper lonMapper()

isEnableLatLon

public boolean isEnableLatLon()

parse

public void parse(ParseContext context)
           throws IOException
Specified by:
parse in interface Mapper
Throws:
IOException

close

public void close()
Specified by:
close in interface Mapper

merge

public void merge(Mapper mergeWith,
                  MergeContext mergeContext)
           throws MergeMappingException
Specified by:
merge in interface Mapper
Throws:
MergeMappingException

traverse

public void traverse(FieldMapperListener fieldMapperListener)
Specified by:
traverse in interface Mapper

traverse

public void traverse(ObjectMapperListener objectMapperListener)
Specified by:
traverse in interface Mapper

toXContent

public XContentBuilder toXContent(XContentBuilder builder,
                                  ToXContent.Params params)
                           throws IOException
Specified by:
toXContent in interface ToXContent
Throws:
IOException


Copyright © 2009-2012. All Rights Reserved.