org.elasticsearch.index.mapper.geo
Class GeoShapeFieldMapper

java.lang.Object
  extended by org.elasticsearch.index.mapper.core.AbstractFieldMapper<String>
      extended by org.elasticsearch.index.mapper.geo.GeoShapeFieldMapper
All Implemented Interfaces:
ToXContent, FieldMapper<String>, Mapper

public class GeoShapeFieldMapper
extends AbstractFieldMapper<String>

FieldMapper for indexing Shapes.

Currently Shapes can only be indexed and can only be queried using GeoShapeFilterParser, consequently a lot of behavior in this Mapper is disabled.

Format supported:

"field" : { "type" : "polygon", "coordinates" : [ [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ] ] }


Nested Class Summary
static class GeoShapeFieldMapper.Builder
           
static class GeoShapeFieldMapper.Defaults
           
static class GeoShapeFieldMapper.Names
           
static class GeoShapeFieldMapper.TypeParser
           
 
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
 
Field Summary
static String CONTENT_TYPE
           
static com.spatial4j.core.context.SpatialContext SPATIAL_CONTEXT
           
 
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
GeoShapeFieldMapper(FieldMapper.Names names, SpatialPrefixTree prefixTree, double distanceErrorPct)
           
 
Method Summary
protected  String contentType()
           
protected  void doXContentBody(XContentBuilder builder)
           
protected  org.apache.lucene.document.Fieldable parseCreateField(ParseContext context)
           
 SpatialStrategy spatialStrategy()
           
 String value(org.apache.lucene.document.Fieldable field)
          Returns the actual value of the field.
 String valueAsString(org.apache.lucene.document.Fieldable field)
          Returns the actual value of the field as string.
 String valueFromString(String value)
           
 
Methods inherited from class org.elasticsearch.index.mapper.core.AbstractFieldMapper
analyzed, boost, close, customBoost, fieldDataType, fieldFilter, fieldQuery, fuzzyQuery, fuzzyQuery, index, indexAnalyzer, indexed, indexedValue, indexOptions, indexOptionToString, merge, name, names, nullValueFilter, omitNorms, parse, prefixFilter, prefixQuery, queryStringTermQuery, rangeFilter, rangeQuery, searchAnalyzer, searchQuoteAnalyzer, store, stored, termVector, toXContent, traverse, traverse, useFieldQueryWithQueryString, valueForSearch
 
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

SPATIAL_CONTEXT

public static final com.spatial4j.core.context.SpatialContext SPATIAL_CONTEXT
Constructor Detail

GeoShapeFieldMapper

public GeoShapeFieldMapper(FieldMapper.Names names,
                           SpatialPrefixTree prefixTree,
                           double distanceErrorPct)
Method Detail

parseCreateField

protected org.apache.lucene.document.Fieldable parseCreateField(ParseContext context)
                                                         throws IOException
Specified by:
parseCreateField in class AbstractFieldMapper<String>
Throws:
IOException

doXContentBody

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

contentType

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

value

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


valueFromString

public String valueFromString(String value)

valueAsString

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


spatialStrategy

public SpatialStrategy spatialStrategy()


Copyright © 2009-2012. All Rights Reserved.