public class IndexMappings extends Object implements sirius.kernel.Startable
Elasticsearch entities
.Modifier and Type | Field and Description |
---|---|
static String |
MAPPING_DOC_VALUES
Mapping key used to tell ES about the doc_values setting.
|
static String |
MAPPING_INDEX
Mapping key used to tell ES if a property is indexed (searchable).
|
static String |
MAPPING_NORMS
Mapping key used to tell ES if and how to store norms.
|
static String |
MAPPING_STORED
Mapping key used to tell ES if and how a property is stored
|
static String |
MAPPING_TYPE
Mapping key used to tell ES the mapping type of a field.
|
static String |
MAPPING_TYPE_KEWORD
Mapping value used to mark a field as "keywors" meaning that it is indexed but not analyzed.
|
Constructor and Description |
---|
IndexMappings() |
Modifier and Type | Method and Description |
---|---|
void |
ensureYearlyIndexExists(EntityDescriptor ed,
int year)
Ensures that the index for the given entity type and year exists and contains the appropriate mappings.
|
protected boolean |
setupEntity(EntityDescriptor ed) |
void |
started() |
boolean |
yearlyIndexExists(String name)
Determines if the given yearly index exists.
|
public static final String MAPPING_STORED
public static final String MAPPING_INDEX
public static final String MAPPING_DOC_VALUES
public static final String MAPPING_NORMS
public static final String MAPPING_TYPE
public static final String MAPPING_TYPE_KEWORD
public void started()
started
in interface sirius.kernel.Startable
protected boolean setupEntity(EntityDescriptor ed)
public boolean yearlyIndexExists(String name)
As we might check this frequently (for queries against entities stored per year) the result is cached.
name
- the name of the index to check.public void ensureYearlyIndexExists(EntityDescriptor ed, int year)
ed
- the descriptor of the entity typeyear
- the year to create the index forCopyright © 2018. All rights reserved.