public abstract class ContextBuilder<E extends ContextMapping> extends Object
| Constructor and Description |
|---|
ContextBuilder(String name) |
| Modifier and Type | Method and Description |
|---|---|
abstract E |
build() |
static CategoryContextMapping.Builder |
category(String name)
Create a new
CategoryMapping |
static CategoryContextMapping.Builder |
category(String name,
String defaultCategory)
Create a new
CategoryMapping with default category |
protected static ContextMapping |
loadMapping(String name,
Map<String,Object> config,
Version indexVersionCreated) |
static SortedMap<String,ContextMapping> |
loadMappings(Object configuration,
Version indexVersionCreated) |
static GeolocationContextMapping.Builder |
location(String name)
Create a new
GeolocationContextMapping |
static GeolocationContextMapping.Builder |
location(String name,
int precision,
boolean neighbors)
Create a new
GeolocationContextMapping with given precision and
neighborhood usage |
static CategoryContextMapping.Builder |
reference(String name,
String fieldname)
Create a new
CategoryContextMapping |
static CategoryContextMapping.Builder |
reference(String name,
String fieldname,
Iterable<? extends CharSequence> defaultValues)
Create a new
CategoryContextMapping |
protected String name
public ContextBuilder(String name)
public abstract E build()
public static GeolocationContextMapping.Builder location(String name)
GeolocationContextMappingpublic 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)
CategoryMappingpublic 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)
CategoryContextMappingfieldname - name of the field to usepublic static CategoryContextMapping.Builder reference(String name, String fieldname, Iterable<? extends CharSequence> defaultValues)
CategoryContextMappingfieldname - 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, Version indexVersionCreated) throws ElasticsearchParseException
ElasticsearchParseExceptionprotected static ContextMapping loadMapping(String name, Map<String,Object> config, Version indexVersionCreated) throws ElasticsearchParseException
ElasticsearchParseExceptionCopyright © 2009–2017. All rights reserved.