Skip to main content

Index types

Index definition resources can include native settings.analysis alongside mappings. See Native analysis and migration for analyzer/normalizer examples, versioning rules, and required permissions. Existing mapping-only definitions remain supported.

An IndexType describes a business object that is searchable in OpenSearch. It defines the mapping (field names, types), the versioning scheme, and the alias names used for reading and writing. Index types are defined in separate Maven artifacts and consumed as dependencies by service instances.

Naming conventions​

ConceptPatternRegexExamples
SystemName of the business application[A-Z][a-z0-9]+JME, WVS, Precious
BusinessObjectType of the business object[A-Z][a-z0-9]+DecreeDocument, Registration
MajorVersionBreaking schema versionInteger1, 2
MinorVersionBackwards-compatible schema versionInteger0, 1
SequencePartition number6-digit zero-padded integer000001, 000002

Physical index​

A physical OpenSearch index holds the documents for one IndexTypeVersion and one partition. By default there is exactly one partition (-000001) per IndexTypeVersion, created once and written to indefinitely — the -000001 suffix supports a future rollover but does not itself trigger one. If an ISM rollover policy is deliberately attached (see Index lifecycle), new partitions are created automatically when rollover fires, and the write alias is atomically re-pointed to the new partition; the service's own naming and write-alias handling are identical either way.

Pattern: <System>_<BusinessObject>_v<MajorVersion>-<Seq>

Example
jme_decree_document_v1-000001
www_declaration_v2-000001
precious_registration_v1-000002

IndexWriteAlias​

The write alias points to the currently writable partition for a specific major version. All document writes target this alias rather than a physical index, so rollover is transparent to the service.

Pattern: <System>_<BusinessObject>_v<MajorVersion>_write

Example
jme_decree_document_v1_write
www_declaration_v2_write
precious_registration_v1_write

IndexReadAlias​

The read alias points to all partitions of an IndexType across all major versions. Use this alias for search queries so results span the entire history.

Pattern: <System>_<BusinessObject>_read

Example
jme_decree_document_read
www_declaration_read
precious_registration_read

IndexType artifact​

An IndexType artifact is generated by the jeap-opensearch-index-type-registry-maven-plugin from a mapping definition file. The artifact provides:

  • An IndexTypeDescriptor Spring bean that registers the index type with the service
  • A generated Java data class with @JsonProperty("snake_case_name") annotations for every field
  • The OpenSearch mapping JSON embedded in the artifact

Service instances consume an index type artifact as a Maven dependency. The IndexTypeDescriptor is auto-discovered via Spring bean scanning and registered with the IndexTypeRepository at startup.

Field naming​

All field names in the data.properties section of an IndexType mapping must be snake_case. The registry Maven plugin enforces this at build time — any camelCase field name fails the build.

The generated data class carries @JsonProperty annotations on every field so that Jackson writes the correct snake_case names to OpenSearch, regardless of how the SearchItem provider serialised the data on the wire.

Schema versioning​

Each IndexType has a MajorVersion (breaking change) and a MinorVersion (backwards-compatible change). The minor version is stored in the _meta.schema_version field of the OpenSearch mapping and compared at startup — if it differs the service pushes an updated mapping to the current write index. A major version bump requires a new index (new major version pattern and new write alias).