How onsdigital/address-index-api works
Address Index is a Play API for resolving submitted addresses to likely indexed records and UPRNs, with a demo UI as one client. The main workflow is address input → request validation → Elasticsearch search → formatted match response; batch matching follows the same purpose at batch scale. Separate API capabilities include UPRN, postcode, partial-address/typeahead, and other specialized searches. The graph also shows the UI client and the Elasticsearch boundary. README and sampled excerpts support the broad capability map, but unsampled controller-to-repository wiring is shown only where evidence supports it.
Main entry points: ElasticsearchRepository.scala Search repository · AddressIndexClient.scala API client · AddressController.scala Address matching · response API response models
Components 18
Demo UI
- Single match
demo-ui/app/uk/gov/ons/addressIndex/demoui/controllers/SingleMatchController.scala - Bulk match
demo-ui/app/uk/gov/ons/addressIndex/demoui/controllers/BulkMatchController.scala - Clerical search
demo-ui/app/uk/gov/ons/addressIndex/demoui/controllers/ClericalToolController.scala - Other searches
demo-ui/app/uk/gov/ons/addressIndex/demoui/controllers - API client
client/src/main/scala/uk/gov/ons/addressIndex/client/AddressIndexClient.scala
API endpoints
- Address matching
server/app/uk/gov/ons/addressIndex/server/controllers/AddressController.scala - Batch matching
server/app/uk/gov/ons/addressIndex/server/controllers/BatchController.scala - UPRN lookup
server/app/uk/gov/ons/addressIndex/server/controllers/UPRNController.scala - Postcode search
server/app/uk/gov/ons/addressIndex/server/controllers/PostcodeController.scala - Partial search
server/app/uk/gov/ons/addressIndex/server/controllers/PartialAddressController.scala - Specialized searches
server/app/uk/gov/ons/addressIndex/server/controllers
Search runtime
- Request validation
server/app/uk/gov/ons/addressIndex/server/modules/validation - Search repository
server/app/uk/gov/ons/addressIndex/server/modules/ElasticsearchRepository.scala
Models and responses
- Query parameters
server/app/uk/gov/ons/addressIndex/server/model/dao/QueryValues.scala - Indexed address models
model/src/main/scala/uk/gov/ons/addressIndex/model/db/index - API response models
model/src/main/scala/uk/gov/ons/addressIndex/model/server/response
Other components
- API or UI user
- Elasticsearch index
Connections 28
- API or UI user → Single match: submits address
- API or UI user → Bulk match: submits batch
- API or UI user → Clerical search: requests review
- API or UI user → API client: calls API
- Single match → API client: calls
- Bulk match → API client: calls
- Clerical search → API client: calls
- Other searches → API client: calls
- API client → Address matching: sends query
- API client → Batch matching: sends batch
- Address matching → Request validation: validates
- Address matching → Search repository: searches
- Batch matching → Request validation: validates
- Batch matching → Search repository: bulk searches
- UPRN lookup → Search repository: looks up
- Postcode search → Search repository: searches
- Partial search → Request validation: validates
- Partial search → Search repository: searches
- Specialized searches → Search repository: searches
- Search repository → Elasticsearch index: queries
- Search repository → Indexed address models: returns records
- Address matching → Query parameters: builds parameters
- Request validation → Query parameters: checks parameters
- Address matching → API response models: formats response
- UPRN lookup → API response models: formats response
- Postcode search → API response models: formats response
- Partial search → API response models: formats response
- Batch matching → API response models: formats response