public class DocStoreConfig extends Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
active
True when the Document store integration is active/on.
|
protected int |
bulkBatchSize
The default batch size to use for the Bulk API calls.
|
protected boolean |
create
When true the Document store should create any document indexes that don't already exist.
|
protected boolean |
dropCreate
When true the Document store should drop and re-create document indexes.
|
protected boolean |
generateMapping
Set to true means Ebean will generate mapping files on startup.
|
protected String |
mappingPath
Resource path for the Document store mapping files.
|
protected String |
mappingSuffix
Suffix used for mapping files.
|
protected String |
pathToResources
Location of resources that mapping files are generated into.
|
protected DocStoreMode |
persist
The default mode used by indexes.
|
protected String |
url
The URL of the Document store server.
|
| Constructor and Description |
|---|
DocStoreConfig() |
| Modifier and Type | Method and Description |
|---|---|
int |
getBulkBatchSize()
Return the default batch size to use for calls to the Bulk API.
|
String |
getMappingPath()
Return the mapping path.
|
String |
getMappingSuffix()
Return the mapping suffix.
|
String |
getPathToResources()
Return the relative file system path to resources when generating mapping files.
|
DocStoreMode |
getPersist()
Return the default behavior for when Insert, Update and Delete events occur on beans that have an associated
Document store.
|
String |
getUrl()
Return the URL to the Document store.
|
boolean |
isActive()
Return true if the Document store (ElasticSearch) integration is active.
|
boolean |
isCreate()
Create true if the document store should create mapped indexes that don't yet exist.
|
boolean |
isDropCreate()
Return true if the document store should recreate mapped indexes.
|
boolean |
isGenerateMapping()
Return true if Ebean should generate mapping files on server startup.
|
void |
loadSettings(PropertiesWrapper properties)
Load settings specified in properties files.
|
void |
setActive(boolean active)
Set to true to make the Document store (ElasticSearch) integration active.
|
void |
setBulkBatchSize(int bulkBatchSize)
Set the default batch size to use for calls to the Bulk API.
|
void |
setCreate(boolean create)
Set to true if the document store should create mapped indexes that don't yet exist.
|
void |
setDropCreate(boolean dropCreate)
Set to true if the document store should recreate mapped indexes.
|
void |
setGenerateMapping(boolean generateMapping)
Set to true if Ebean should generate mapping files on server startup.
|
void |
setMappingPath(String mappingPath)
Set the mapping path.
|
void |
setMappingSuffix(String mappingSuffix)
Set the mapping suffix.
|
void |
setPathToResources(String pathToResources)
Set the relative file system path to resources when generating mapping files.
|
void |
setPersist(DocStoreMode persist)
Set the default behavior for when Insert, Update and Delete events occur on beans that have an associated
Document store.
|
void |
setUrl(String url)
Set the URL to the Document store server.
|
protected boolean active
protected boolean generateMapping
protected boolean dropCreate
protected boolean create
protected DocStoreMode persist
protected int bulkBatchSize
protected String mappingPath
protected String mappingSuffix
protected String pathToResources
public DocStoreConfig()
public boolean isActive()
public void setActive(boolean active)
public void setUrl(String url)
For a local ElasticSearch server this would be: http://localhost:9200
public boolean isGenerateMapping()
public void setGenerateMapping(boolean generateMapping)
public boolean isDropCreate()
public void setDropCreate(boolean dropCreate)
public boolean isCreate()
public void setCreate(boolean create)
public int getBulkBatchSize()
public void setBulkBatchSize(int bulkBatchSize)
The batch size can be set on a transaction via Transaction.setDocStoreBatchSize(int).
public String getMappingPath()
public void setMappingPath(String mappingPath)
public String getMappingSuffix()
public void setMappingSuffix(String mappingSuffix)
public String getPathToResources()
public void setPathToResources(String pathToResources)
public DocStoreMode getPersist()
public void setPersist(DocStoreMode persist)
You might choose to use QUEUE if that particular index data is updating very frequently or the cost of indexing is expensive. Setting it to QUEUE can mean many changes can be batched together potentially coalescing multiple updates for an index entry into a single update.
You might choose to use IGNORE when you have your own external process for updating the indexes. In this case you don't want Ebean to do anything when the data changes.
public void loadSettings(PropertiesWrapper properties)
Copyright © 2016. All rights reserved.