Skip to main content

Mapping file

Each mapping version has its own JSON file. The file is a standard OpenSearch mapping object with three required top-level sections.

Required structure

{
"mappings": {
"dynamic": false,
"_meta": { "schema_version": 0 },
"properties": {
"search_item": { ... },
"origin": { ... },
"data": { ... }
}
}
}

dynamic: false is required — the plugin validates its presence. The three sections map to the responsibilities of the index writer service and the domain service:

SectionWritten byPurpose
search_itemjEAP Index WriterIndexing metadata: write timestamp, major and minor version.
originjEAP Index WriterReference back to the source business object.
dataDomain serviceApplication-defined business fields — this section is mapped to Java.

search_item section (fixed)

"search_item": {
"type": "object",
"properties": {
"upserted_at": { "type": "date", "format": "strict_date_optional_time||epoch_millis" },
"major_version": { "type": "integer" },
"minor_version": { "type": "integer" }
}
}

This section must conform to the bundled IndexTypeMappingDescriptor.schema.json validated by the plugin.

origin section (fixed)

"origin": {
"type": "object",
"properties": {
"id": { "type": "keyword" },
"version": { "type": "keyword" },
"bp_id": { "type": "keyword" },
"tenant": { "type": "keyword" },
"created": { "type": "date", "format": "strict_date_optional_time||epoch_millis" },
"modified": { "type": "date", "format": "strict_date_optional_time||epoch_millis" },
"reference": { "type": "object", "enabled": false }
}
}

data section (application-defined)

The data section defines the business fields specific to the index type. Field names must be snake_case — the plugin rejects camelCase names at build time.

"data": {
"type": "object",
"properties": {
"document_id": { "type": "keyword" },
"document_title": { "type": "text" },
"issued_by": {
"type": "object",
"properties": {
"name": { "type": "keyword" },
"office": { "type": "keyword" }
}
},
"created_at": { "type": "date", "format": "strict_date_optional_time||epoch_millis" }
}
}

OpenSearch to Java type mapping

The plugin generates Java records from the data section. Nested object fields with sub-properties become inner records.

OpenSearch typeJava type
keyword, text, wildcard, constant_keywordString
integer, short, byteInteger
longLong
float, half_floatFloat
double, scaled_floatDouble
booleanBoolean
datejava.time.Instant
binaryString
object / nested with no sub-propertiesJsonNode
object / nested with sub-propertiesGenerated inner record

Fields whose JSON name differs from the Java identifier convention get a @JsonProperty annotation. For example, document_id@JsonProperty("document_id") String documentId.