public abstract class ContextBuilder<E extends ContextMapping>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
name |
Constructor and Description |
---|
ContextBuilder(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
abstract E |
build() |
static CategoryContextMapping.Builder |
category(java.lang.String name)
Create a new
CategoryContextMapping |
static CategoryContextMapping.Builder |
category(java.lang.String name,
java.lang.String defaultCategory)
Create a new
CategoryContextMapping with default category |
protected static ContextMapping |
loadMapping(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> config,
Version indexVersionCreated) |
static java.util.SortedMap<java.lang.String,ContextMapping> |
loadMappings(java.lang.Object configuration,
Version indexVersionCreated) |
static GeolocationContextMapping.Builder |
location(java.lang.String name)
Create a new
GeolocationContextMapping |
static GeolocationContextMapping.Builder |
location(java.lang.String name,
int precision,
boolean neighbors)
Create a new
GeolocationContextMapping with given precision and
neighborhood usage |
static CategoryContextMapping.Builder |
reference(java.lang.String name,
java.lang.String fieldname)
Create a new
CategoryContextMapping |
static CategoryContextMapping.Builder |
reference(java.lang.String name,
java.lang.String fieldname,
java.lang.Iterable<java.lang.String> defaultValues)
Create a new
CategoryContextMapping |
public abstract E build()
public static GeolocationContextMapping.Builder location(java.lang.String name)
GeolocationContextMapping
public static GeolocationContextMapping.Builder location(java.lang.String name, int precision, boolean neighbors)
GeolocationContextMapping
with given precision and
neighborhood usageprecision
- geohash lengthneighbors
- use neighbor cellspublic static CategoryContextMapping.Builder category(java.lang.String name)
CategoryContextMapping
public static CategoryContextMapping.Builder category(java.lang.String name, java.lang.String defaultCategory)
CategoryContextMapping
with default categorydefaultCategory
- category to use, if it is not providedpublic static CategoryContextMapping.Builder reference(java.lang.String name, java.lang.String fieldname)
CategoryContextMapping
fieldname
- name of the field to usepublic static CategoryContextMapping.Builder reference(java.lang.String name, java.lang.String fieldname, java.lang.Iterable<java.lang.String> defaultValues)
CategoryContextMapping
fieldname
- name of the field to usedefaultValues
- values to use, if the document not provides
a field with the given namepublic static java.util.SortedMap<java.lang.String,ContextMapping> loadMappings(java.lang.Object configuration, Version indexVersionCreated) throws ElasticsearchParseException
ElasticsearchParseException
protected static ContextMapping loadMapping(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> config, Version indexVersionCreated) throws ElasticsearchParseException
ElasticsearchParseException