Class NestedElasticsearchSink.Processor
- java.lang.Object
-
- io.annot8.common.components.AbstractComponent
-
- io.annot8.common.components.AbstractProcessor
-
- io.annot8.components.elasticsearch.processors.AbstractElasticsearchSink
-
- io.annot8.components.elasticsearch.processors.NestedElasticsearchSink.Processor
-
- All Implemented Interfaces:
io.annot8.api.components.Annot8Component,io.annot8.api.components.Processor,AutoCloseable
- Enclosing class:
- NestedElasticsearchSink
public static class NestedElasticsearchSink.Processor extends AbstractElasticsearchSink
-
-
Field Summary
Fields Modifier and Type Field Description static StringANNOTATIONSstatic StringCONTENTSstatic StringGROUPS-
Fields inherited from class io.annot8.components.elasticsearch.processors.AbstractElasticsearchSink
client, forceString, index
-
-
Constructor Summary
Constructors Constructor Description Processor(NestedElasticsearchSink.Settings settings)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<org.elasticsearch.action.index.IndexRequest>itemToIndexRequests(io.annot8.api.data.Item item)protected static Map<String,Object>transformItem(io.annot8.api.data.Item item, boolean forceString)Transforms an Annot8 Item into a Map with the following format:{ "parent": parentId "properties: {} "contents": [ { "id": contentId "contentType": contentType "description": contentDescription "content": content "properties": {} "annotations": [ { "id": entityId "type": entityType "boundsType": entityBoundsType "value": entityValue "begin": entityBegin "end": entityEnd "properties": {} } ] } ] "groups": [ { "id": groupId "type": groupType "properties: {} "roles": { "ROLE_TYPE": [ { "annotationId": annotationId "contentId": contentId } ] } } ] }-
Methods inherited from class io.annot8.components.elasticsearch.processors.AbstractElasticsearchSink
close, getMapping, process
-
-
-
-
Field Detail
-
ANNOTATIONS
public static final String ANNOTATIONS
- See Also:
- Constant Field Values
-
CONTENTS
public static final String CONTENTS
- See Also:
- Constant Field Values
-
GROUPS
public static final String GROUPS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Processor
public Processor(NestedElasticsearchSink.Settings settings)
-
-
Method Detail
-
itemToIndexRequests
protected List<org.elasticsearch.action.index.IndexRequest> itemToIndexRequests(io.annot8.api.data.Item item)
- Specified by:
itemToIndexRequestsin classAbstractElasticsearchSink
-
transformItem
protected static Map<String,Object> transformItem(io.annot8.api.data.Item item, boolean forceString)
Transforms an Annot8 Item into a Map with the following format:{ "parent": parentId "properties: {} "contents": [ { "id": contentId "contentType": contentType "description": contentDescription "content": content "properties": {} "annotations": [ { "id": entityId "type": entityType "boundsType": entityBoundsType "value": entityValue "begin": entityBegin "end": entityEnd "properties": {} } ] } ] "groups": [ { "id": groupId "type": groupType "properties: {} "roles": { "ROLE_TYPE": [ { "annotationId": annotationId "contentId": contentId } ] } } ] }
-
-