Class SchemaDao
java.lang.Object
gov.nasa.pds.registry.common.es.dao.schema.SchemaDao
Elasticsearch schema DAO (Data Access Object).
This class provides methods to read and update Elasticsearch schema.
- Author:
- karpenko
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCall Elasticsearch "mappings" API to get a list of field names.voidupdateSchema(List<Tuple> fields) Add new fields to Elasticsearch schema.
-
Constructor Details
-
SchemaDao
Constructor- Parameters:
client- Elasticsearch clientindexName- Elasticsearch index name
-
-
Method Details
-
getFieldNames
Call Elasticsearch "mappings" API to get a list of field names.- Returns:
- a collection of field names
- Throws:
Exception- an exception
-
updateSchema
Add new fields to Elasticsearch schema.- Parameters:
fields- A list of fields to add. Each field tuple has a name and a data type.- Throws:
Exception- an exception
-