public abstract class ContextBuilder<E extends ContextMapping> extends Object
Constructor and Description |
---|
ContextBuilder(String name) |
protected String name
public ContextBuilder(String name)
public abstract E build()
public static GeolocationContextMapping.Builder location(String name)
GeolocationContextMapping
public static GeolocationContextMapping.Builder location(String name, int precision, boolean neighbors)
GeolocationContextMapping
with given precision and
neighborhood usageprecision
- geohash lengthneighbors
- use neighbor cellspublic static CategoryContextMapping.Builder category(String name)
CategoryMapping
public static CategoryContextMapping.Builder category(String name, String defaultCategory)
CategoryMapping
with default categorydefaultCategory
- category to use, if it is not providedpublic static CategoryContextMapping.Builder reference(String name, String fieldname)
CategoryContextMapping
fieldname
- name of the field to usepublic static CategoryContextMapping.Builder reference(String name, String fieldname, Iterable<? extends CharSequence> defaultValues)
CategoryContextMapping
fieldname
- name of the field to usedefaultValues
- values to use, if the document not provides
a field with the given namepublic static SortedMap<String,ContextMapping> loadMappings(Object configuration) throws ElasticsearchParseException
ElasticsearchParseException
protected static ContextMapping loadMapping(String name, Map<String,Object> config) throws ElasticsearchParseException
ElasticsearchParseException
Copyright © 2009–2015. All rights reserved.